By using this site, you agree to our Privacy Policy and our Terms of Use. Close
Katilian said:
Plaupius said:
C and C++ are related in such a way that C is a subset of C++, meaning that a program written in C should compile also using a C++ compiler. They share the same basic syntax with C++ having a number of additions over C, but most of programming IS basic syntax, so if you learn C++ you definitely learn C as well.

For ease of learning, though, I would recommend Java. The basic syntax is still the same as C, but you don't have to worry about memory management, pointers etc. and you'll learn objective oriented programming. Just make sure you don't get stuck on Java, learn the basics there and then move on to C or C++ (or even objective-C if you'd like to try OS X or iPhone programming). Learning just Java will lead to some poor coding habits, so it's good to move to the C-family to see what is going on under the hood, so to speak.

So, in a nutshell: Java, C++ and objective-C all have the same basic syntax that is based on C.

Not true, you can write perfectly legitimate C programs which will not compile on a C++ compiler. That said, *most* C programs will compile with a C++ compiler.

For the OP, I'd suggest starting with something like C++ or Java or perhaps Python to get the basics of programming. If you are interested in a career however, I'd heavily suggest moving onto something lower level (C/C++ or Asmembly depending on how keen you are) for at least a small project to get a good understand of how things work under the hood. I'd also suggest picking up a book on computing algorithms (even if you are just sticking to it as a hobby). I've seen way too many "Java graduates" who can write code, but have no concept of what their code actually does, which leads to some attrocious code.

If you decide you are just in it as a hobby, feel free to stick with the hand holding langauges

I was half expecting this to come up. Yes, you are right, and that is why I put the "should compile" there instead of "will compile". If one wants to learn an OO extension that is 100% ANSI-C compliant, then one should try Objective-C which to my understanding is 100% compliant. But this is all nitpicking and has about zero relevance to somebody who is just starting to learn programming.

As to the point of getting a book of algorithms, that is something that I strongly support. Maybe it's not the first priority right now, but once you get the hang of things and learn to do some proper code, you will run into things that require some sort of algorithms and if you're armed with a good book, you'll go miles further. I have "Data Structures and Algorithm Analysis in C" by Mark Allen Weiss and it has served me well. It is also available for C++ and Java and some other languages, so that is one option for you and I'm sure others can recommend you different books.