This post is inspired by this tweet:
1. First language: Basic / Java
— Vx. Super Di 🦄 (@cotufa82) October 3, 2019
2. Had difficulties: Java
3. Most used: JavaScript / Python
4. Totally hate: Java
5. Most loved: Go / Python
6. For beginners: Python / Ruby
What about you?
People mention all kinds of languages in responses including JavaScript, Java, C, etc.
I wonder how would anyone consider JS as beginner-friendly? It has this
, prototypal inheritance, complicated coercion rules and many more.
I'm ok with JS. This is my primary language at the moment (TypeScript and JavaScript to be precise). I'm just would not consider it beginner-friendly.
As well I would not consider Java beginner-friendly and many others. (All those languages are ok, but not beginner friendly IMO).
What would you consider as a beginner-friendly language? And what would be your criteria?
Top comments (54)
Python. It's very readable, can do basically anything you want, and there's tons of documentation and educational resources available for free.
What about package manager? It was quite frustrating when I tried it last time
Pip is okay, but if you're going to work with Python extensively I recommend really learning venv.
Well, you see this is my point about beginner friendliness. Experience should be butter smooth. We are talking about absolute beginners. (Again I'm not talking about best language in general, the main focus on beginners)
Absolute beginners likely won't be using pip extensively, so I think your point is likely moot. If you're to the point where you need pip, then you should be able to read documentation and use venv.
There are languages which come with built-in package managers which just work out of the box though
So does pip for most people. When you get to running your code in production though just running "pip install X" on a server isn't really a good idea.
But it installs dependencies globally, right? There are package managers that install locally by default. Again, my point is to make the ideal experience from the start. Python is a good language, I'm just saying that developer experience can be improved. And the fact that you know how "easily" overcome those complications, those small caveats, doesn't make those caveats go away. Some people could easily spend hours and those small things
No experience is going to be "ideal" from the start - if you chase that unicorn you'll continually switch from language to language and never gain any mastery. You asked for opinions beginner friendly languages, and IMO Python is it.
Edit - Apparently others agree
Yes it won't be ideal in general, but the question of package managers solved in many languages quite well (bundler, cargo, elm)
You didn't ask about package managers specifically, you asked about recommended languages for beginners, and the answer for tons of people (including top universities teaching CS degrees) is Python.
I know, for example, MIT 6.0001. But this argument based on authority - look smart people doing it, so it supposes to be right.
Your answer is Python. I tried to question it and I feel like we won't get any further in this discussion
It's not an argument based on authority, it's an example of multiple scenarios (universities) where people who aren't experts (students) are literally paying to learn programming languages and the majority of those teach Python to beginners. How is that not a relevant example in this case?
The fact that many people are doing it this way doesn't make it ideal. We have a lot of examples through history of people doing strange things, just because a lot of people were doing it this way before. This is not an argument, this is just a fact that a lot of people doing it right now.
Yeah you're right, we're not going to get anywhere with this conversation - you are arguing philosophical ideals now and have diverged very far away from the original question.
I also think Python is the best among all popular ones currently.
If you asked: "what is the best floor for a kid to learn to walk?"
I would say: "a flat floor, smooth, maybe just a bit soft"
That doesn't mean the kid won't fall along the way, hit the floor many times before being able to stand still first.
Learning is difficult by nature. A beginner will fall. Will experience some frustration. Will have to face his own immaturity.
So, for programming, python is that floor. Sure, pip isn't perfect. But it's like if the other languages weren't even a flat floor, so it's better to compromise with pip that mess with the other stuff right from start.
A lot of schools that I have been in use Python. The teacher I spoke to most recently said that students found it easier to read code without curly braces as it follows natural language paragraph indentation. I would be interested to hear how the students viewed the package manager though...
I wanted to say that the simplicity of Python comes from the fact that it is context-free grammar, but apparently, it is not 🤔(I searched the internet right now)
If you really want to understand core concepts then start with C and cover the basic topics like printing, input, variables, primitives, macros, command line, arrays, struct, union, function, pointers and DMA then start implementing Data Structures and Algorithms in C. Shift to Traditional C++ and learn about OOP Concepts after covering all that do Modern C++ (Modern C++ doesn't have proper documentation so this would be hard) then look at the code of open source projects and try to understand them. Have a language reference by your side and find something if you don't understand. Join communities if you can't get help online.
If you want to take the easy way then start with Python. Its syntax is easily to understand. But it doesn't really explain all concepts in depth (at least I couldn't understand the concepts of it much).
Disclaimer: I am not discouraging anyone. Its up to you if you are able to understand the core concepts in any language. C was my first language so I mostly tell people to learn that first.
Depends on how you define "core concepts"
Those concepts which are normally in any language and could be used to relate real life probelms.
Yes, but this is very wide surface. Some languages are ver far away from each other, for example, Prolog, Agda, C, TLA+
Yes things may differ because of different purposes but terminology from which it derives is same (sort of).
Not quite. When people learn type system from C/C++ they end up with wrong mental model about types (often hate types), you need to get introduced on types with good type system and type checker with nice error messages, for example, Elm.
Agreed
I first started with python, then went to javascript. I have no idea why but js "clicked" for me very fast, while i didn't understand too much (intermediate / advanced) python after a few months of playing with it.
I know some begginers have problems with understanding concepts such as "closures", "prototypes" and "higer order functions", but in my experience, those came naturally. I was "expecting" it to work that way (except for prototypes, which i didn't understand that fast, but when i did it made sense).
The hardest question to understand the answer of while learning js was:
why doesn't my game render if i put the logic inside a while true loop?
After using js for a while and then once in a while going back and playing with python, a lot of things made sense, and I can see why so many recommend it. It's definitly better for things like "courses" where someone explains someone else something. My route was more the "start a project you always wanted to do and then google all the problems you encounter" route:)
A year ago I switched to typescript (and i'm never going back:))
Also, for the last month or so i've been learning c++ and it's cool, but definitly not begginer-friendly...
Disclaimer: english is not my first lang, so please forgive the typos & grammar mistakes.
For absolute beginners, Python. That's kind of what it's designed for, and it's got a big standard library that includes a lot of stuff you'd otherwise have to go searching for, so at least at the beginning you don't even need to touch a package manager (and by the time you do, you should have a solid enough understanding that
pip
and/orvenv
won't be much of an issue to work with).Others that come to mind include:
For specific types of programming:
Ones I'd say for beginners to avoid:
I definitely recommend Python. It provides a good foundation for understanding computer programming. It has plenty of technical aspects to grow into as you're ready, but keeps the complicated stuff mostly out of sight until you want it.
It also doesn't encourage bad habits, rather guiding towards good habits and style, without whacking you on the knuckles if you get it wrong. Tools like
flake8
andblack
help with this. You can then jump from (idiomatic) Python to any other language, and you'll find a lot of the good practice ports.Python also works well with the functional, object-oriented, and procedural paradigms, or any combination thereof. You aren't forced to use any one of them. As with literally any language, you have to learn how to use these well, but they're all supported in a way that accommodates responsible mix-and-match.
And yes, virtual environments are easy. They're actually easier than having to mess with system-wide stuff, because you can have multiple venvs like sandboxes, each with precisely the tools and packages you need for any given project. Here's the only four commands you need:
(That's on Linux. Just as easy on Windows, the commands are only slightly different.)
It's my interest in computers in the mid-80s that "forced" me to learn to read English (before that, I often didn't understand most of what I was reading). All the good programming magazines (what's that?) and books were in English.
Whichever language you have the best support structure for. Some languages are definitely harder than others, but being alone is way harder.
That being said, if you have no human beings around to support, I would say JavaScript or Python. There are tons of resources aimed at beginners for those two.
But JavaScript has a tone of legacy confusing things, like
this
and coercion rules. And resource about JS are confusing, because some use some libraries, like jQuery, so you start to learn jQuery instead of JS, some use ES5 syntax some use ES6You are absolutely right. My advice is to pick one educational resource at a time and put good effort in. Being an expert at is a very different thing than learning as a beginner. I think this is a big benefit of a mentor or community. They can help you know what to ignore for right now.
Every language has weird spots to fall in.
For beginners I think it's not just about the language. They need to understand core parts of programming.
If you get the basic fast enough the it's no problem what language you're using.
Coercion,
this
, and prototype inheritance are next step from beginners level. It's language feature.So yes JavaScript, because it's already on a browser no pain to set up the env
I like Ruby. My concern is that it locks mind in OOP-paradigm, it takes some time to recognize there are other approaches. On the other hand, I guess any language will lock you in one or another paradigm
As a Ruby developer by trade I would second the recommendations for Python. It is readable, can do anything you want and it is an excellent scripting language for server administration and such as well. Not to mention all the machine learning stuff.