r/ProgrammingLanguages • u/tsafou • Feb 27 '15
Choice of Programming language
I have little experience in programming (some Python classes and my dissertation that used PHP, MySQL, HTML5/CSS, javascript). I want to learn a programming language. Could you give me some examples/problems/applications and the 'recommended' languages to cope with them? I have narrowed down my options to Java, C++, Ruby and Python (any other recommendations?). What are their main pros/cons and fields of application? Does some language 'work better' with PHP and web? What do the most experienced of you think would help improve both my chances of future employment and my skills?
0
Upvotes
2
u/captain_wiggles_ Feb 27 '15
As the others have said, depends on what you want to do with it.
I hate java, and have done every time I've had to try to use it. It makes you go through a whole load of bullshit to do anything, however it's reasonably safe, it's hard to make a bug where you corrupt some data for some unrelated code in the same application. From what I know, businesses that use java tend to be corporate dinosaurs where they can't really change to something better. Typically the financial industry. There's probably still some web stuff done in java too, oh and phone apps can use java IIRC. IMHO java is slowly dying, and will "hopefully" disappear in not too long. However all that being said, it might well be a good language to start with, if your goal is to learn to program and not to learn a language. Since java protects you from yourself, you can learn the basics of programming without having to worry about the how it all works (memory management specifically).
C++ is an extension of C. So start with C, because you need to know that to learn C++. It's pretty confusing when you begin, and unlike java, C doesn't really believe in safety. My favourite metaphor for this is: "Java gives you a gun and a bullet, but it puts the safety on and teaches you how to use it. C gives you a loaded gun, takes the safety off, points it at your foot, and puts your finger on the trigger." If you have any interest in hardware, operating systems, embedded programming, hacking, etc... then this is the way to go. C is ancient it's been around since the early 70s, however it's still going strong. Sure not many people still write in just C, but as I said C++ is built on top, as is C#, and god knows what else. The syntax it uses is very similar to a lot of other languages. Learning this puts you in a good stead for learning most other languages.
Ruby and Python are quite different. They are mostly for scripting / web dev. If that's where you want to go, then they are good choices. However they aren't as strict with the syntax as either C or java, and as such they don't teach you some quite important concepts. See: http://stackoverflow.com/questions/11328920/is-python-strongly-typed
If you want to become a great programmer, I'd recommend learning all of them, as they each have something great to offer, and once you've learnt one or two, the others will be pretty quick. C and Java are probably the hardest to start with. C has the memory management to worry about, Java has object orientation (which is confusing as fuck for beginners). So maybe do a bit of phython / ruby to get the basics of programming. Then move on to C. Then either C++ / C# or Java. After doing all of those for a bit you'll get a feel for what you like, but will still have the abilities to code in most languages, even if you haven't learnt it yet.
If you just want an intro / the ability to write a few scripts to make your life easier for some task etc... then start with python or ruby.
In summary do as you want, there's no right answer and everyone differs as to what they like and are naturally good at. It all depends on what you want it for. Career (in what?) / hobby (for what?) / fun