I want to learn programming -- How?

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

Discussion Overview

The discussion revolves around learning programming, particularly for someone with a background in Matlab and an interest in expanding their skills to other programming languages. Participants explore various approaches to self-learning versus formal education, the suitability of different languages, and resources for beginners.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Homework-related

Main Points Raised

  • Some participants suggest starting with C as a foundational language due to its general-purpose nature and influence on other languages.
  • Others argue that self-teaching is possible, especially with prior experience in programming concepts like loops and functions.
  • A participant mentions the benefits of taking classes at community colleges, highlighting the value of instructor feedback and structured learning.
  • There are differing opinions on the effectiveness of learning through online platforms versus traditional textbooks.
  • Some participants emphasize the importance of practical experience and experimentation in learning programming.
  • Concerns are raised about the steep learning curve associated with languages like C and C++, particularly regarding system-level programming and potential errors.
  • One participant expresses interest in game development and seeks clarification on how graphics are created in games, indicating a desire to understand the tools and engines used.
  • Javascript is mentioned as a useful language for web-based graphics, with suggestions for hands-on learning through example programs.

Areas of Agreement / Disagreement

Participants generally agree that C is a good starting point for learning programming, but there are multiple competing views on the best approach to learning, including self-study, online resources, and formal education. The discussion remains unresolved regarding the optimal path for individual learners.

Contextual Notes

Some participants note that the effectiveness of learning methods may depend on personal learning styles and prior experience. There are also mentions of varying levels of difficulty associated with different programming languages and the importance of understanding foundational concepts.

Who May Find This Useful

This discussion may be useful for individuals interested in learning programming, particularly those with a background in engineering or related fields, as well as those considering various educational paths and resources for self-study.

  • #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
1K
Replies
86
Views
2K
Replies
16
Views
3K
  • · Replies 102 ·
4
Replies
102
Views
3K
  • · 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