What's the best programming language to learn as a beginner.
closed as too broad by RockPaperLizard♦ May 4 at 5:40
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
There isn't one, just like there isn't a 'best' programming language in general. What matters is learning something that will work well for what you want to do.
If you're dead set on just learning something to learn programming in general though, good options include:
- Python. Part of the original design purpose for Python was to be a teaching language you could still use for useful things. It's one of the few languages designed for teaching that's actually usable for really advanced stuff too. The combination of the simple syntax, good documentation (the language tutorial actually does a good job of covering most of the basic programming concepts by itself), and the flexibility of the language paradigm (it doesn't lock you into a specific type of programming, it works just was well with functional, object oriented, or procedural approaches) make it a good language for learning in general, and it's near the top of the list of the most widely used languages in the world so knowing Python is actually a salable skill.
- Lua. Lua is a bit of an odd case, it's a tiny little language that can run on almost anything (no, literally almost anything, it's been ported to LEGO Mindstorms, Arduino, most game consoles, and even some really ancient systems nobody sane even uses anymore). It's very widely used as an embedded scripting language (that's kind of what it was designed for) in things ranging from video games to professional multimedia software, the syntax is not hard to learn, and it's also rather paradigm neutral like Python. THe downside is that it's much less 'batteries included' than Python is, so it's not something I would suggest unless you're already good at mathematical logic and have a decent understanding of how a computer actually works.
- Go. Go is a relatively new language from Google. Unlike the rest of the list, I've not really done much of anything with it myself, so I can't say much about it other than commenting that it's become a really popular teaching language because it's reasonably easy to learn and extremely powerful (and also saves you from most of the headaches relating to parallelization in other languages).
- C. Potentially going to catch flak for this one, but I actually consider C to be a good starting place for learning basic programming. It's not exactly easy to learn, but learning it will give you a far better understanding of the low-level workings of a computer than almost any other language that's actively taught today, and that knowledge by itself is arguably more valuable than almost any other skill you can learn as a programmer because it gives you a much better idea about how to do things efficiently. Learning C also makes learning a handful of other very widely used languages (C++, C#, Objective-C, and to a certain extent Go and Java), making it a decent starting point for someone who doesn't know what they want to do long-term.
Also, a few languages to specifically avoid for this despite their widespread usage as teaching languages:
- BASIC: Avoid this like the plague. No major company is looking for people who know BASIC, it encourages a lot of very bad programming habits, and the language itself is significantly different from almost any widely used programming languages today.
- Java: Not anywhere near as bad as BASIC, and actually a reasonably valuable skill. The issue is that it's also very different in many respects from other widely used languages, just like BASIC it tends to encourage a number of bad programming habits, and on top of all that it's horrendous in terms of resource efficiency and performance (it's technically possible to write high-performance Java code, it just will usually run slower than the same thing in, say, Go or C and use significantly more memory while doing so).
- C++: Just like C, this is probably going to start a flame war. C++ is not a bad language per-se, and it's not even a bad language for learning basic programming with, the issue is that it's usually taught in a way that encourages bad coding habits (like overusing the STL), and just like Java it potentially has some serious performance issues (most notably it's over-eager use of on-demand memory allocation).
- Pretty much anything that uses a visual form for the source code instead of plain text: The best known example of these languages is probably Scratch, Wikipedia lists quite a few more. These are decent for teaching kids basic programming concepts, but they tend to be very limited in what they can actually do, and the difference in how they present the code and logic can actually make it harder to learn a regular text-based programming language later on (because you get used to the visual control flow representation and it impacts how you actually read source code).
Good old C.O.B.O.L. ... !!!
... you'd be surprised to know how major (global) companies still depend on it, for things which are typically business critical to them.
PS: and compile / link / run it in zOS ...