I often seem to end up advising people on what to do when they're just starting out with programming - so I thought I'd put all the information here in one place. It's not the shortest of reads, but if you want some advice on the best route to go down, then here it is! Where applicable, I've backed up claims and shown sites / locations with some references which can be found at the bottom. Sadly this wouldn't all fit into one post, so it had to span a couple!
There's many options available to you if you're just starting out with programming, and if you've had a look around for any period of time this huge array of options can be quite bewildering. There's a fair few choices to make, from what type of language to go for to what tutorials or worksheets to follow through - and to some this choice is enough to put them off altogether! There's hundreds, if not thousands of languages out there in one form or another and for the more popular ones there's probably at least this number of tutorials per language. Where on earth do you start?
Probably the most important thing to start with is to choose a language, and this is a topic of much debate and sometimes outright disagreement. However, to get rid of one common perception from the word go - HTML is not a programming language. (1) It's a markup language. It's an arguably useful tool to learn, and pretty much everyone working in the programming industry will know the basics of it and CSS, but a programming language it is not.
There's lots of actual programming languages people recommend though - I'll try and cover the main ones here with their pros and cons. Before I kick off though I'm going to exclude languages in 2 main categories:
Old languages. Things like C, Fortran, COBOL, ASM - they were good in their day, they're not now and with the exception of C (which is good for very low level stuff but not much else these days) I'd question whether it's worth learning them at all. By all means give them a look if and when you're an experienced coder to see what they're like, but it's a terribly bad idea to base your programming experience on one of these!
Secondly, unused languages. Well, not always unused, but at least rarely used. Things like Realbasic (only EVER used for teaching), haskell (a great tool to have under your belt but not to start with!) and D (a good idea but no-one really uses it) are interesting things to have a look at, but again it's a bad idea to base your programming knowledge on a language that might be redundant, obsolete and unused in a year or so.
One of the most common beginner languages in use is VB
.NET - it's a Microsoft creation geared pretty specifically to make it easy to get started with a language, and as such it really is very simple to pick up. A lot of people start out with this language, and it's not as dead end as many think, it's sometimes used in a corporate setting as well, and the APIs behind it are pretty extensive.
However, despite these points I'd personally advise quite strongly against it. It's major strong point (its ease of use) is also its biggest drawback, it lets you slip into LOTS of horrible programming practices that make migrating to other languages properly (not just by hacking things to work) an absolute nightmare. It's also very easy to write horrible code in VB
itself - out of all the bad code I've seen, most of the worst has been in VB
. And as such, if you google around you'll find there's lots of awful tutorials on it as well that teach these bad practices (usually because the person who's writing it doesn't know any better.) If all you'll ever want to do is knock together a few quick scripts, and it's just for personal reasons and you'll never want to program for a living then fair enough. VB
.NET might just provide the quick and dirty approach that you need! If however you're looking to learn how to do things properly and want to get into good habits then I'd give this a miss. In fairness a lot of decent programmers I know have started programming this way and for some it's even proved useful in retrospect (mainly when they've been given old, buggy VB
code to maintain or fix). But going back now, very few of them would recommend it as a good language to kick off with.
Another common one that's branded around the place is PHP. Not a bad language in itself, and definitely nicer than the perl CGI scripts that preceeded it, it's a very commonly used language and an absolute necessity if you want to get into web programming. This and Microsoft's ASP.NET are literally the two dynamic languages around on the web at the moment. Sure there's others, but these two rule the roost, most open source (and a lot of closed source) web apps use this - mediawiki, drupal and joomla to name just the first 3 that came to mind. It's also pretty easy to pick up, but it's not as much of a running joke as VB
tends to be and doesn't let you slip into quite as many bad practices.
That said, it still does let you slip into lots of bad practices, and while you can quite happily "tame" these if you've been programming in a nicer language already it's perhaps not the wisest move to expose yourself to them from the word go. There's also the obvious point that PHP is a web based scripting language and not a general purpose "traditional" programming language (which, depending on what you want to do, could be a pro or a con.) Again, because it's so widely used and pretty easy to pick up, you also get a lot of badly written and sometimes plainly wrong tutorials around for it - though at least the W3C provide some good, certified ones that you can be sure are accurate and reliable. (2)
So should you go with it as an initial choice of language? Unless you only ever want to do web based stuff I'd steer clear, and even then I'd be careful. I'm no PHP expert but I can do bits in it and MySQL that I need to, and coming from Java background it didn't take me more than a couple of weeks to comprehensively pick the basics up and get going with it in a useful way. It's a possibility, but I honestly wouldn't recommend starting with a web based language unless you only ever intend to do web based work. Migrating from a "normal" language to a web based one is pretty trivial, the other way round tends to be rather more difficult.
Next on the agenda is C++. On the face of it this might seem like a poor choice, it's a comparatively hard language to learn and to debug and can take a lot of time and effort to construct a good, reliable and useful application. However, it's recommendation is not completely unfounded - it's a case sensitive, strongly typed language so it gets you into some very good habits in that respect. It's object oriented so it gets you into the "modern" way of thinking (object orientation is how all big applications are coded these days.) And it's arguably the most used language out there - while a lot of its use is fading as more modern languages like Java step in, there's so many legacy applications out there that you can be sure a good grounding in C++ is something that'll serve you well for many decades yet! It was a standard for many years and it shows, there's lots of good books and tutorials on it, a lot of free, optimised compilers around for it and it's a very stable and mature language.
Despite all that though, I wouldn't really recommend it as a starting point - I definitely would advise however coming back and learning it later on. While it's a great language in itself, as a beginner language it's really not brilliant at all, the compiler lets things through that seem illogical from a beginners perspective and it's got some antiquated features left over from C which, while are brilliant in the right setting, can really get quite confusing if you're trying to understand things from a pure and theoretical perspective! The syntax is also pretty complicated in terms of defining things in header files and suchlike, it's not the most logical thing for a beginner to handle. And due to you having to do your own garbage collection, it's very easy to introduce bugs that you don't even know about (because memory is in such abundant supply these days!) So yes, C++ is a great language to learn. But no, it's not a great language to start with.