-3

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.

  • 1
    The 'best language' to learn is the one that presents the concepts in a way that you understand. – Jeff Zeitlin May 3 at 15:36
  • 1
    Seek a discussion site such as CodeRanch.com. And always search there before posting. – Basil Bourque May 6 at 0:22
2

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.
  • Javascript. Also extremely popular and very useful as a selling point. Javascript is a good place to learn event-drive programming and it's critical if you want to do web development, but I'd argue it's not the best starting language for anything else because it's really different in a lot fo ways from many other mainstream languages. It's still decent for learning basic programming concepts though, but you really need to learn three languages (Javascript, HTML, and CSS) to do much of practical use with it.
  • 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).
  • This is a good answer although including Lua instead of Ruby is odd. I do think Python is an excellent choice and there are many good resources for learning it. MIT’s into to computer science class is free online and uses Python. It is surprising gentle. – Eric Shain May 3 at 22:32
  • @EricShain I've included Lua because I've personally found it to be a decent language for teaching basic low-level programming concepts. Rust wasn't included simply because I know essentially nothing about it (I've at least looked at Go and read a lot about it, I haven't even done that with Rust), though I've heard it's easy to learn. – Austin Hemmelgarn May 4 at 1:40
0

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 ...

  • 1
    While there may be some jobs in cobol programming, it a really obsolete language. Python, on the other hand is modern, widely used, and easier to learn than most other popular languages. There are lots of learning resources for Python and it’s easy and free to install. – Eric Shain May 3 at 22:26

Not the answer you're looking for? Browse other questions tagged or ask your own question.