I want to learn programming -- How?

  • Thread starter Thread starter Thermo
  • Start date Start date
  • Tags Tags
    Programming
Click For Summary
SUMMARY

The discussion centers on learning programming languages, particularly for individuals with a background in Matlab. Participants recommend starting with C due to its foundational role in programming and its relevance to other languages. Community colleges are highlighted as valuable resources for structured learning, offering courses in C, Java, and C++. Additionally, online platforms like Codecademy and MIT OpenCourseWare are suggested for self-study. The conversation emphasizes the importance of practical experience and the potential for programming skills to enhance career opportunities in various fields.

PREREQUISITES
  • Basic understanding of programming concepts such as variables, loops, and functions.
  • Familiarity with Matlab or similar programming environments.
  • Access to online learning platforms like Codecademy or MIT OpenCourseWare.
  • Willingness to engage in hands-on coding practice and experimentation.
NEXT STEPS
  • Enroll in a community college course for C programming to gain structured guidance.
  • Explore online resources for learning C, such as tutorials and textbooks.
  • Practice JavaScript and HTML5 for web development and game programming.
  • Investigate game engines like Unity or Unreal for practical application of programming skills.
USEFUL FOR

Individuals interested in transitioning from Matlab to programming, aspiring game developers, and those seeking to enhance their technical skills for career advancement in engineering or software development.

  • #31
Games are very diversified industry. The top selling games are probably Candy Crush and Minecraft. They're both very different from a programming perspective. Then you have the specialist games like DOTA, Call of Duty, World of Warcraft, which have vastly higher design and development requirements.

If you learned HTML5/CSS, Unity/Unreal and some basic art skills like how to make seamless tiles, you'd be well placed to start as an indie developer.
 
Technology news on Phys.org
  • #32
I've uploaded something for you to start you off with.
 

Attachments

  • Like
Likes   Reactions: Thermo
  • #33
thankz said:
I've uploaded something for you to start you off with.

This is the first time I have seen a "learn programming" book that contains no code. May I ask what you personally gained from this book? I am trying to understand it.
 
  • #34
Checkout the open source Processing.org website. Processing is designed for casual programmers and interactive graphic artists. Programs are called sketches and there is a large collection of samples and books to learn from.

The Processing IDE supports several languages: java, javascript, python and scala (earlier version of the IDE)

We've used it at work for quick prototyping. The programming model is extremely simple. You define a setup() method that is run once and a draw() method that is called by default 60 times a second.

Java:
void setup() {
    size(200,200);
}

void draw() {
    ellipse(mouseX,mouseY,10,10);
}

The sketch shown above creates a 200x200 pixel window and reacts to mouse movement drawing a circle about each mouse cursor position.

Processing also supports an ANDROID mode where your program can be sideloaded onto an Android device which can make Android development a lot of fun.
 
  • Like
Likes   Reactions: Thermo
  • #35
nothing, as I've personally not read it :wink:
 
  • #36
jedishrfu said:
Checkout the open source Processing.org website. Processing is designed for casual programmers and interactive graphic artists. Programs are called sketches and there is a large collection of samples and books to learn from.

The Processing IDE supports several languages: java, javascript, python and scala (earlier version of the IDE)

We've used it at work for quick prototyping. The programming model is extremely simple. You define a setup() method that is run once and a draw() method that is called by default 60 times a second.

Java:
void setup() {
    size(200,200);
}

void draw() {
    ellipse(mouseX,mouseY,10,10);
}

The sketch shown above creates a 200x200 pixel window and reacts to mouse movement drawing a circle about each mouse cursor position.

Processing also supports an ANDROID mode where your program can be sideloaded onto an Android device which can make Android development a lot of fun.

You made me dig up some of my old Processing code. Here's an old sketch I made a long time ago:

Java:
//Recursively draw a leaf.
float aa = -PI / 3; //Angle a.
float ab = (11 * PI) / 36;  //Angle b.

void setup(){
    size(1400, 900);
    background(255);
    stroke(0, 200, 0);
    strokeWeight(1.25);
    drawStem(0, height / 3, 0, 150);
}

void drawStem(float x, float y, float angle, float lineLength){
  if(lineLength > 1){
      float endX = x + (lineLength * cos(angle));
      float endY = y + (lineLength * sin(angle));
      line(x, y, endX, endY);

      drawStem(endX, endY, angle + 0.05, lineLength * 0.9); //Main stem.
      drawStem(x + (endX - x)/3, y + (endY - y)/3, angle + ab, lineLength / 3); //Bottom leafs.
      drawStem(endX, endY, angle + aa, lineLength / 3); //Top leafs.
  }
}

I remember having a lot of fun with this language.
 
Last edited:
  • #37
Zondrina said:
You made me dig up some of my old Processing code. Here's an old sketch I made a long time ago:

Java:
//Recursively draw a leaf.
float aa = -PI / 3; //Angle a.
float ab = (11 * PI) / 36;  //Angle b.

void setup(){
    size(1400, 900);
    background(255);
    stroke(0, 200, 0);
    strokeWeight(1.25);
    drawStem(0, height / 3, 0, 150);
}

void drawStem(float x, float y, float angle, float lineLength){
  if(lineLength > 1){
      float endX = x + (lineLength * cos(angle));
      float endY = y + (lineLength * sin(angle));
      line(x, y, endX, endY);

      drawStem(endX, endY, angle + 0.05, lineLength * 0.9); //Main stem.
      drawStem(x + (endX - x)/3, y + (endY - y)/3, angle + ab, lineLength / 3); //Bottom leafs.
      drawStem(endX, endY, angle + aa, lineLength / 3); //Top leafs.
  }
}

I remember having a lot of fun with this language.

and it still runs under Processing 2.2.1:

Screen Shot 2015-07-04 at 8.52.29 PM.png


Nice work Zondrina!
 
  • Like
Likes   Reactions: Thermo
  • #38
Wooow. Is that how you make graphics? Amazing!
 
  • #39
  • Like
Likes   Reactions: jedishrfu
  • #40
DrZoidberg said:
Beautiful recursive image. btw. I translated it to JavaScript and put it on jsfiddle
https://jsfiddle.net/o5peosbj/

Please give @Zondrina of PhysicsForum some author credit for this program as she was the one to post it here.

Place a comment at the start of the program as to who wrote and where you discovered it. Its a real important courtesy that is too often neglected in the real world of programming. In some cases, it has caused great legal troubles to some companies who've incorporated code into a product without the proper attribution.
 
  • #41
To @Zondrina:

One cool improvement that could be done is to switch to using the draw() method and add some variation so that the fern fronds move in the wind or with respect to mouse movement somehow.
 
  • #42
On a related topic, processing variations are available on Android (see java-based APDE app) and on iPhone (see javascript-based ProcessingJS app).

In addition, iPhone has Codea (Lua programming) and Pythonista (Python programming) apps which I think can be exported as uploadable apps for the AppStore and the Textastic programmers editor for viewing and editing 80+ programming languages.

On Android, there is the AIDE app for developing Android apps on the device the perfect gift to the mobile hacker.
 
  • #43
Making art with programming is cool. It feels good to make a nice drawing, since I can't really draw with my hand too well.

I was fooling around with a cool program I was going to make into an app. I wrote it in processing some time ago, and it brought back memories of my naive programmer days:
Screen Shot 2015-07-05 at 7.11.56 PM.png

Screen Shot 2015-07-05 at 7.13.24 PM.png


Screen Shot 2015-07-05 at 7.12.18 PM.png
 
  • #44
Zondrina said:
Making art with programming is cool. It feels good to make a nice drawing, since I can't really draw with my hand too well.

I was fooling around with a cool program I was going to make into an app. I wrote it in processing some time ago, and it brought back memories of my naive programmer days:View attachment 85578
View attachment 85577

View attachment 85576
I don't understand any of this. I am self taught in C. C usually does not support graphics as it is intended as a universal language. You seem to be producing graphics with C. I am only able to get graphics with the SVGA library in command line C in Linux but it is hard to load the application and to get it to work. Also it seems to be outdated. I am also able to program graphics on a Raspberry Pi in C but this seems limited to the raspberry pi. How did you get your graphics to work? Please correct me if i am wrong. Also you are right it is fun to make computer graphics.
 

Similar threads

  • · Replies 25 ·
Replies
25
Views
950
Replies
86
Views
2K
Replies
16
Views
3K
  • · Replies 102 ·
4
Replies
102
Views
2K
  • · Replies 43 ·
2
Replies
43
Views
7K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 15 ·
Replies
15
Views
4K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
Replies
33
Views
3K