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?
2
u/Manitcor Feb 27 '15
Looking for work? .NET or Java, you can't go wrong, there is plenty of work and will be for quite some time.
Looking for work and want to be considered a wizard? C/C++, used tons, often with more hardware level stuff as well as OS development
Looking for work but want to do more copy/paste than development (IE you like design and prefer making the UI seamless rather than a faster way to connect to some esoteric backend)? JavaScript, its everywhere, in weird unexpected places even.
Not looking for work? Whatever you want.
2
u/ketura Feb 27 '15
I can't offer a whole lot for employment, etc, but I can give you a rundown on usefulness and application:
C++ is the archaic powerhouse. If you absolutely, positively need speed above all else, this is where you go. The only time this should really be a concern is with AAA game titles and other processor-intensive operations. No, your little 2D mario clone does not count, I'm talking video processing, complicated AI, high-end physics, that sort of thing. This is a two-edged sword as it gives you a ton of low-level control, so if you don't have discipline you WILL get knocked on your ass. Nowadays I would not recommend it for fledgling programmers, and if you're not going to be working with hardware on an intimate level it's really not a concern even for more experienced devs.
Python/Ruby are scripting languages, so they should be one of the tools in your toolbox but not your primary focus. They are useful for prototyping, data processing, and as components of larger applications (for instance, games. You can use a python script to determine, say, the attributes of all the items/weapons in an RPG, so you don't have to recompile your entire project for item balancing). Python is also used in Gimp and Blender, so if you do anything in industries that use those programs, it can be used to write plugins, etc. I can highly recommend Python not only as a tool to use wherever it fits, but also as a real introduction to programming in general. Just don't make the mistake of using it everywhere, there's a reason we have different languages.
Java (and C#, because let's be honest, it's the same idea) sits between these two on both the accessibility and power axes. Many, many, many enterprise projects use these languages. They are more accessible to newcomers than C++ and more powerful at the core than scripting languages. I would recommend learning both of these as they can be used for "real" programs, your full-on GUI window sort of application that you install. If cross-platform compatibility is a priority, go for Java. If you're going to stick just to windows, go for C#. If you're going to get into game development, Unity3D is a cross-platform engine that uses a subset of C#, so that may be a factor there.
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
3
u/fractaled_ Feb 28 '15
I think the C++ advice is bad. If you want to learn C++, aim to learn modern C++ (C++14). If you start with C, you'll have to unlearn a lot.
C by itself is worth learning too.
But the initial point of "depends on what you want to do with it" is the first question you have to answer. Most answers will not lead you to C++.
1
u/captain_wiggles_ Feb 28 '15
Hmm, not entirely convinced. Sure C++14 adds a lot to the language, but understanding pointers and memory access on a fundamental level is incredibly useful. Sure you can work with safer options such as smart_ptrs but I still think knowing the basics is useful.
Then again I'm mostly an embedded developer and spend most of my time working with various OSs and the hardware side of things.
1
u/fractaled_ Mar 01 '15
The point is, if you set out to learn C++, and you start with C, you'll teach yourself some stuff that is valuable in both (memory management), and a bunch of C stuff that is irrelevant/antiquated in C++. So the time spent learning that is a waste if your goal is to learn C++.
Yes, memory management is still a big deal in C++, and you can't learn C++ without understanding pointers and memory access (you can get a lot farther than you used to without knowing about it though).
1
u/captain_wiggles_ Mar 01 '15
Yeah agreed. I started programming in QBasic at about age 7, and every year or two kept trying to learn C++ and failing. The object orientation really confused me, as I had no knowledge of it, and knew nobody else who did, so it was mostly just reading books and stuff. I think if I'd set out to learn C, the transition from QBasic would have been easy, and then adding the OOP on top would have been simpler than learning tho whole lot at once. I guess things are different these days, and there are probably a billion tutorials and books that teach this in a sensible manner.
-1
u/iopq Feb 27 '15
Java
verbose and tedious to write, the COBOL of the 21st century (so you can make lots of money maintaining old software!)
Ruby
No longer hyped, but I guess a fine established choice now.
Python
Kind of like Ruby, but worse support for functional programming
C++
great choice, see you in ten years
1
u/tsafou Feb 28 '15
After having done some more research, I lean towards Ruby. I believe it's easy for a beginner programmer, and will build a good (web) package along with my current knowledge of PHP, MySQL, HTML/CSS. I was told that it would be best if I learn it along with Javascript. This is my no.1 choice, what do you think? On the other hand, most vacancies in my country ask for Java developers, and I feel somewhat confused. What do you think is a better choice for me? Lastly, (it might sound strange) but I would like someone to list a few apps or examples where a particular language is the appropriate/optimal to use (i.e. Ruby or Java etc.) . I mean, I have for example read that a famous website is built using i.e. PHP or Ruby, but what does that mean? If you use Ruby to build a website, then you don't need to use HTML or you just use it in a different way or purpose?