I think the most important parts are willpower to learn, curiosity, time, access to Internet and computers. If those are given, it may not matter THAT much where you start. In the IT world,
being able to learn things by yourself will definitely a huge plus.
To learners I want to say this:
You do not need schools or similar institutions. As long you are motivated, have time, have access to Internet and a computer, you have pretty much everything you need to become a good programmer.
In the Internet you will readily find many tutorials or references to the most known languages. I have learned pretty much all languages I know only from Internet tutorials.
But I also want to say that
programming languages are not everything. There are many other
best practices which are (mostly) independent of programming languages, such as using version control, writing useful comments, using design patterns, knowing the important algorithms, understanding algorithmic complexity, avoiding bloat, being able to use a debugger and whatnot. Programming is not just about writing code itself, but also how you organize it. I feel this part of programming is pretty much underestimated by many teachers, but I think this knowledge is important and valuable, especially in the long run.
Now for the languages themselves:
Short story- If you're serious about this and want a deeper understanding of programming early, start with Pascal and be prepared to go on with learning other programming languages later
- Lua gets a “Better than okay” rating by me
- If you're less serious about this, start with a language which you are most likely to use to solve an actual task, to get results fast. If you feel a particular lanaguage is too hard, try an easier one before.
- For starting, avoid languages where you have a hard time in even get started, that is, finding documentation, tutorials, introductions, etc. This will only lead to frustration
- If you're confident with a language, learn about the available tools for programmers (mentioned above)
Long storyLuaThe obvious pro for Lua is that is very easy to learn and can be used to quickly get going and get very quick results. Another upside is that it is interpreted, which means that testing is really fast either.
But for learning programming seriously, Lua is clearly not enough.
The downside of Lua is that it is a bit poorly designed in a few aspects and teaches some bad programming habits which the learner would have later to “un-learn” when continuing with other languages. Also, unlike many other languages, there is no free manual online, only a reference. But if you want to pay the price for a book, go ahead … But I think the reference is already very good; I am not sure if it is enough for complete newbies. Better start with another language with more accessible documentation.
Some of the design flaws in Lua include: Global scope is default, all identifiers are available without declaration, it is not statically typed. Lua is IMO also not really a general purpose language, at least in practice. Partially becaus the standard library is very small. Standalone Lua programs are possible, but rare. Oddly for learners is the lack of switch/case statements, but this is a lesser sin. :-)
Some hints for Lua learners:
- “local” is your new God. “Accidental” global variables are the source of many errors
- When you mastered Lua, use Luacheck
PascalFor people who want to seriously learn something about programming, I would recommend Pascal as the first language, or one of the first languages. This language strikes me as a very nicely-designed language which demonstrates many programming languages in a clean way. AFAIK Pascal was designed exactly for the goal to teach students structured programming. The program structure is very clear in Pascal.
I am not saying that Pascal is the silver bullet, I am just saying it can help a lot to understand concepts you find in pretty much other languages. Thus, I suppose learners will have an easier time in getting started with a LOT of other languages after mastering Pascal.
Other languagesI would recommend against early teaching/learning very abstract or very-high level languages like languages which are heavily object-oriented (Java) or functional programming languages (Haskell, etc.). Although those paradigms all have their place in the world, a newbie might get overwhelmed as this is maybe too much abstraction at once. But there's always the option of trying to learn these after mastering the “easier” languages. But if you're still interested in Java or Haskell anyway, well, go for it! :-)
Here are my comments on languages and how good I think they are suited as a first language.
- Pascal: Very good. Definite recommendation. (see above)
- Python: Good for motivated learners. (IMO) well-designed. A surprisingly very sophisticated language with many concepts included. You can get started quickly, but it takes a rather long time to master all its concepts; but after you did, you'll really feel accomplishment
- Lua: Better than okay. It is lightning-fast to learn and syntactically ultra-simple, but it has its quirks and it is easy to make silly mistakes without noticing. I recommend to learn another language after mastering Lua, to extend your horizont :-)
- C: Maybe. It has an awful syntax which takes time to getting used to but with C you learn about many low-level and high-level concepts. Pointers are going to be a major hurdle, however. Don't learn C without learning to use a debugger at basically the same time, it will save lots of nerves. :-)
- Java: Rather not, as object-orientation is an advanced topic not for beginners and is pretty much mandatory in Java. But OK after having mastered a structured and compiled language
- Haskell: No, but OK to learn later, if you are curious about functional programming
- C++: Hell no, too complex, but definitely OK to learn much later. Only after you mastered a couple of other compiled languages and you feel confident. Note that knowing C is not a prerequisite to learning C++
- C# (and .NET): Hell no. Although it has a nice syntax and many useful concepts for beginners, it is de facto too much limited to Microsoft products; using C# programs on non-Windows system is a real pain (I speak from experience). You should at least learn one language which does not restrict you to a particular platform. If you like C#'s syntax, learn Java instead, it is similar, but easily more general-purpose.
- PHP: Hell no, especially as a first language. This language is poorly designed, will make you dumber and teaches many totally bad habits. Don't be seduced by PHP's siren call for being easy to learn. This is only half-true, as this does not take into account the many hoops, quirks, bugs and outsight design flaws you have to know and work around in order to not totally screw up (and screwing up is easy in PHP). Debugging PHP code is also tricky, which is a no-go for newbies. Don't take this language seriously and avoid it if you can.
Going onBut I think the most important lesson is that
no programming language is perfect or really suited for all needs. To seriously get going with programming, learning only one language is clearly not enough. Languages vary greatly in scope and purpose. Understanding the difference between compiled and interpreted is important. Also, learners need to understand there are many different “paradigms” (procedural, functional, object-oriented, etc.). What is important to know that
all languages are just abstractions, and not the “real” thing.
But if you seriously want to learn programming, at the end of the day,
it might not matter that much with which languages you start first, when you learn a healthy number of programming languages anyway.
On the other hand, if all you want to do is writing some mods for Minetest, then Lua is obviously enough, but you should be definitely aware of its quirks.
Beyond programmingHere are other topics which are very valuable for programmers of all kinds (short excerpt):
- Debugging
- Version control system
- Algorithmic complexity
- Static code analysis / “linting” (e.g. Luacheck)