I want to learn programming -- How?

In summary, learning a programming language can be beneficial for finding a job, pursuing personal interests, and generating extra income. C is a good starting point for its wide usage and ability to understand other languages. However, it may be beneficial to also learn languages like C++ or Java, which offer more flexibility and easier ways to construct software. It is recommended to attend a course to fully grasp the language and its concepts.
  • #1
Thermo
50
6
I've been taugth Matlab in university but I want to improve my programming skills and learn other programming languages. I want to ask where to begin? Can I learn it on my own? I can go to some courses too.
 
Technology news on Phys.org
  • #2
What languages? You can search Google for tutorials or find a book on Amazon. You can definitely learn programming yourself.
 
  • Like
Likes Thermo
  • #3
Certainly a lot of people can learn on their own, but for many, it might be a more productive use of their time to take a class at a local college. If you are in the US, there are lots of community colleges (two-year colleges that don't award bachelors' degrees). Many of these schools offer courses in Basic, Java, or C++ (or maybe C). Having someone with experience direct your learning and critique your code is very beneficial for many people. Also, two-year schools usually have much smaller classes with tuition that is much more affordable.

IMO, the community colleges can do a better job in some areas of teaching for the reasons I listed above. In full disclosure, I am retired, but am teaching a class in C at a local CC near where I live. Some of the other instructors (including myself) have worked in the software industry for years, and bring a lot of real-world experience to the classroom.
 
  • Like
Likes Merlin3189 and Thermo
  • #4
Thermo said:
I've been taugth Matlab in university

Did this include programming-type type constuctions such as if-statements, loops and functions? If yes, then you should be able to learn another procedural language by self-teaching, with a suitable textbook and some help from online forums like this one. Scroll down through a few pages of threads in this forum and you'll probably find some other threads with recommendations for languages and textbooks etc.
 
  • Like
Likes Thermo
  • #5
Yes that was actually about if-statemes,loops, numerical methods and functions on matlab. Thanks. So I can start with C?
 
  • #6
Thermo said:
So I can start with C?
Yes that would be a fine start.
 
  • Like
Likes Thermo
  • #7
mit ocw has a full 20something python video course.
 
  • Like
Likes Thermo
  • #8
Thermo said:
. So I can start with C?
That would be a good place to start since many other languages use constructs originally defined for C.
If you have a good grasp of C, other languages become easier to grasp, though there are exceptions.
Knowing C won't help much if you are trying to understand code written in an assembly language.
 
  • #9
What do you mean by that?
 
  • #10
I'm just supporting your notion that the C language is a good place to begin learning since it's a very general purpose language, but nevertheless is powerful in that it allows to write code close to hardware level (low level code).
It does permit coding errors more readily than some higher level languages do, but that's actually quite a good thing for learning.
You can learn a lot more by understanding a mistake and fixing it than you can from a language which tries to limit what you can do so that mistakes don't happen.
 
  • #11
Thank you for the answer.

I study chemical enginnering but I want to learn a programming language also. My reasons:
1) I can find a good job. My job may require programming skill besides chemical engineering.
2) I am interested in.
3) I'd like to code a programme or a game and sell them for extra income.

I hope C is still a good choice to learn for those reasons also.
 
  • #12
There's this site that I enjoy quite a lot:
http://www.codecademy.com/learn
I could never quite make myself read a book on programming, but I'm managing to slowly progress with Java on that site.
It does not have C on the roster, though.
 
  • Like
Likes jackwhirl and Thermo
  • #13
1. For small applictions C is very widely used, and for large scale applications it's dervitive C++ even more widely.
2. If you know C, a lot of other languages become more readily understandable.
3. It's not going to be easy to make a commercial successful game or similar with no previous experience at all, regardless of what language you use
 
Last edited:
  • Like
Likes Thermo and Silicon Waffle
  • #14
You are right but I can give a try at least can do some things later.
 
  • #15
you can always add inline asm to your c code if you learn it.
 
  • #16
It is definitely good to start with C, as in this language you can write very compact and powerful programs and learn programming in a very "mathematical" way, but as this language is mainly used at system level in the industry, it is better to go to C++ after a while or right from the beginning if you want. A word of warning though, is that the extreme capabilities of control over the machine (OS for that matter), that these languages give, comes at the cost of hanging a system and other unhappy experiences, if you are not careful enough, as they deal directly with resources like memory. This is not to tell that they are so hard, but they have a steep learning curve, in order to write some serious programs and they demand serious efforts to get to that. Of course the prize, is to be a very good programmer, they give you back what you put in. Personally, as a Java developer for about 15 years, I would recommend also Java, as it is a really flexible and powerful language and an incredible tool for many tasks in every kind of platform. As for gaming, there are really many choices you can do and an extra one, is to go to Microsoft family of languages (VB, C#, F#) and .NET platform, that they give you an easier "match the blocks" way to construct software, that today's software high technical demands make an absolute necessity. So, it's after all a question of what you want to achieve and how much time and effort you are willing to spend. I agree that learning C, gives you an excellent background and programming mindset to learn other languages too - I can tell from my own experience, and that attending some college course or even an online if you want, is far better than studying alone: there are always things we think we have grasped but we have not and this becomes pretty evident when we take some course, so do it right from start!
 
  • Like
Likes Thermo
  • #17
Thank you. My advisor academician said I had some kind of talent on programming. I got AA in my first year and I haven't even attended one of the courses and didn't know anything about programming. I just got the notes and simply studied on my own and became the most successful while many of the students failed the class even if they attended the whole semester. And it was a very hard exam. So I think maybe I can try more on programming according to my advisor.

I also have a question for you. How do they make the all that graphics of games? I mean you cannot simply code it right? They use some other programs for that or even engines?
 
  • #18
coding-coding.png
 
  • Like
Likes jedishrfu
  • #19
As an experienced programmer I can say (for myself) the best way I learn is by doing.
Since one of your objectives is to possibly write some games, a very good place to
start learning is through trying a variety of example programs where you can see
the inputs and outputs directly. The internet itself is an excellent source.
The Javascript language will likely play a big part in achieving your efforts and there
are some excellent samples - freely available on the internet.
Here is a good approach ...
1. Look at each web page example and see if it displays graphics effects you like.
2. View the programming source code of the web page and study how it works.
3. Copy the source code to your own computer and run it - keep the original.
4. Experiment with the code (trial and error) by making minor changes.
5. Run your version to see if your changes do what you expect.
6. Look up questions on the html or language.
7. Go back to step 1 above.

The following site has lots of good examples and provides fairly good documentation:
http://stemkoski.github.io/Three.js/

With Javascript experience, you can fairly easily grasp some of the other popular
languages like C++, C, Java, etc.
I know I have taken a lot for granted here about existing background and skills you may have,
but if you run into things you do not understand, or don't know how to do, just consult
a website that provides reference information, or ask someone for more explanation or help.

Have fun with programming in Javascript.
 
  • Like
Likes Thermo
  • #20
Thermo said:
How do they make the all that graphics of games? I mean you cannot simply code it right? They use some other programs for that or even engines?
The production of graphics for commercial games, (and other animation), is a whole industry unto itself.
Typically a game studio employs several highly skilled artists who use high end software dedicated to producing 3D models, (eg 3D Studio max), and there are other specialised tools for making 2D animation frames etc.
Often the amount of human resource time dedicated to producing game art can be equal or even exceeding the coding effort.
 
  • Like
Likes Thermo
  • #21
Thermo said:
I also have a question for you. How do they make the all that graphics of games? I mean you cannot simply code it right? They use some other programs for that or even engines?

Games?

For web games you need Javascript because that what browsers use. All browsers. It's the only language they all speak. This isn't a philosophical argument about language preference. You also want HTML5 unless you want to depend on legacy stacks like Flash or Silverlight (cough).

On mobile, most Android gamedevs are using Java and C++ but you're free to choose anything. Apple IOS requires Objective-C and/or Swift due to Apple's control of the ecosystem, and that's not something you can realistically choose.

On a PC or a console, you're free to choose language. Most gamedevs work in C++ with some scripting in LUA or Python. A few more use Java. Many minorities exist.

If your game is non trivial, you will be using a game engine like Unity or Unreal, and they have their own scripting language requirements. I believe it's C# or Javasript for Unity and Unreal has its own graphical programming system.

Edit: If you just want to learn code to get stuff done, Python's really good for your first language. It's easy to learn and quick to write. After that, you will learn other languages pretty fast. I don't know any professional developers who only know one language.
 
Last edited:
  • Like
Likes Thermo
  • #22
The chart I shared also recommends python so I will go with it I suppose.
 
  • #23
If you are interested in higher abstraction languages such as Java, C++ or C# which are object oriented languages, You should check out design patterns. These are methods and solutions for common problems.
And also if you like to do graphics i would suggest C# or Java to start with.
 
  • #24
I like very much
"Introduction to Programming in Java" by Robert Sedgewick & Kevin Wayne

The 1st chapter is here: http://introcs.cs.princeton.edu/java/home/chapter1.pdf

There is a very good course online using a condensed version of this book with exercises and some solutions, many downloadable programs, etc...
http://introcs.cs.princeton.edu/java/home/

To start programming in Java on a pc, first you have to install a Java programming environment.
http://introcs.cs.princeton.edu/java/windows/

The previous link will install DrJava for beginners. http://drjava.sourceforge.net/
 
  • Like
Likes Thermo
  • #25
On the same note. What do you guys think of ActionScript to start with?
 
  • #26
Well I can recommend to you to start with C++, it's a difficult language but then when you understand the logic and the functionality the other languages, that also are derived from C++, will be pretty easy. I see that you eventually want to start mobile development, don't mix up two languages at the same time. First you can start C++ and then for mobile development you can start up with Android, that is Java and XML.
 
  • Like
Likes Thermo
  • #27
Dwabner said:
On the same note. What do you guys think of ActionScript to start with?

Isn't that what Flash uses? Why would you start a new project in that? Even Adobe are trying to get rid of it, and they bought it. If you are doing front-end web or browser games, I would consider JS and HTML5.
 
  • #28
Thermo said:
I've been taugth Matlab in university but I want to improve my programming skills and learn other programming languages. I want to ask where to begin? Can I learn it on my own? I can go to some courses too.
C is hard to learn but probably worth it as it is a basic language. I have spent some time running Linux in command line mode and programming in C. Graphics is a step beyond that. I wound up using SVGA but this is old and not supported very well. You may be better off using a Raspberry Pi. This does allow some pixel graphics in C. Perhaps others out there can help with good command line graphics programming in C. hope this helps.
 
  • #29
C is an okay language, but it may not be the best language to use when you first start coding.

The compiler used in a C environment (usually gcc) will allow you to make many more mistakes than you should at first. The way pointers and memory allocation work will set you up for disaster if you are unfamiliar with common coding conventions.

Perhaps a more beginner friendly language like Java would be suitable if you want to learn scope, syntax and program execution. The way Java does its pointers and memory will allow you to focus more on the core coding concepts you need to know at first before you delve into systems level programming.

Being familiar with the terrain will allow you to embark on a multilingual journey that never seems to end.
 
  • #30
Totally agree with rootone, games is a whole industry unto itself. If you want to enter it step by step, I think that your safe bet, is good knowledge of a "strong" language (like C++ or Java which is definitely more friendly) and of course there are ready-to-go game engines, to support you and of course great graphics by specialists are needed. IDEs which take a lot of burden from the developer, are usually commercial products and this is totally fair in my opinion. On the other hand there are many open source tools, libraries, engines that they can take you to some decent point in this career and yes I agree that internet is a great platform to use too. Just experimenting a bit with HTML5 and its gaming capabilities and adding a little bit of magic by using some JS framework can teach you a lot, but eventually if you want to get further, you'll need much more than scripting, so good efforts in an object oriented language/framework - no matter what this will be will do the trick.
 
  • #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.
 
  • #32
I've uploaded something for you to start you off with.
 

Attachments

  • blackart.pdf
    1.7 MB · Views: 340
  • Like
Likes 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 Thermo
  • #35
nothing, as I've personally not read it :wink:
 

Similar threads

  • Programming and Computer Science
Replies
16
Views
2K
  • Programming and Computer Science
Replies
1
Views
830
  • Programming and Computer Science
Replies
13
Views
966
  • Programming and Computer Science
Replies
15
Views
2K
  • Programming and Computer Science
Replies
8
Views
1K
  • Programming and Computer Science
Replies
3
Views
1K
  • Programming and Computer Science
Replies
6
Views
1K
  • Programming and Computer Science
Replies
33
Views
2K
  • Programming and Computer Science
Replies
5
Views
1K
  • Programming and Computer Science
Replies
8
Views
2K
Back
Top