What language would you recommend for a beginner?

stereobooster on October 05, 2019

This post is inspired by this tweet: 1. First language: Basic / Java2. Had difficulties: Java3. Most used: JavaScript / Python4. Totally hate: Ja... [Read Full]
markdown guide
 

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

(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)

 

Really glad to see a question like this!

I started my programming journey with C#, which basically taught me what programming was and what I could achieve with it. After that, learning other languages was a light trip (Java, JavaScript, Python...).

Lately I've been hearing a lot that everyone should go and start with Python because "it is easy". Well, it is not easy, it seems easy because you understand the hard things that Python is doing behind its 'easy' interface... But in order to understand it, you must've done it before in the 'hard way'.

As a final conclusion... I'd say C or C# would suit begginers.

 

IMHO, keep it simple. Teach them in a well understood and limited environment that will expose them to some of the pain points (but not enough to totally ruin their day).

For this reason I also reccomend C, though I come from embedded / systems programming, not webdev or data science. Giving C a bit of a critical look over, the main pain points are:
No inbuilt package management (you'll need to learn other tools alongside it like GNU make)
Types (at least for me) felt really scary when I was learning it.
Pointers are... An experience in and of themselves. I'd say this is the part of the language I really wouldn't want to force on a beginner, but pointers (in my experience) are such a core part of lower level programming, even with other languages. You NEED to grasp your memory model and how it relates to C or you're fscked. I'm still trying to think over a good way to teach pointers. Maybe teach a safe subset of their behavior first, treating them more like a reference in java. Avoid freaky pointer math.

 
 

Because a lot of people with a lot of experience manage to shoot in the foot with pointers. And we talking about beginners... they would be frustrated by it. And we can entirely avoid the subject by using garbage collector. Do you want somebody spent time learning subject which can be avoided at all?

I want people to learn the most part of things in programming in the easy way, and C/C# makes it a lot easier than any other language. You can't focus in just 1 thing nor put everyone else's experience in front of begginers, I've seen begginers colleagues improving in no time and others who needed 3 more months. Besides, you can't decide we all started programming for the same, right? I started with games, others with webs, others with Apps... And still, learning how to program games in C# made me understand how to connect a sensor to a webpage in Python!

Last time I tried C++ compiler its error message were quite confusing

 

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.

 
 

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.

 

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.

 

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 and black 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:

python3 -m venv myvenv  # create virtual environment
source venv/bin/activate  # turn on virtual environment
pip install <whatever>  # install stuff
deactivate  # when you're done

(That's on Linux. Just as easy on Windows, the commands are only slightly different.)

 

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/or venv won't be much of an issue to work with).

Others that come to mind include:

  • C. Especially for those looking at doing systems or embedded programming. It's easy to branch out from (C++, C#, Objective-C, Cilk, even Rust to a certain extent), provides a solid understanding of the true fundamentals, and it's a very marketable skill by itself. Doing well though really requires knowing how to read documentation.
  • Lua. Super-lightweight, runs on almost anything (any platform with an ANSI C implementation can run Lua), relatively easy to learn, and remarkably useful. Package management is not bad, but not great either, and you kind of need to use it to do many useful things in standalone Lua. The downside is that Lua has some quirks that are a bit odd by most standards (like arrays actually being tables under the hood).
  • Ruby. I have little to no experience with it myself, but that's mostly due to not needing any so far. What I do know of it indicates that it's a relatively good language for beginners. My only complaint given my limited experience with it is that some of the naming is a bit... odd.

For specific types of programming:

  • Web Development: JS. Syntactically and semantically it's not very beginner friendly, but package management is wonderfully simple, you don't need any special IDE, and you don't need to worry about portability anywhere near as much as with many other languages.
  • Game development: C#. Essentially, just start using Unity directly. There are all kinds of other game engines and languages they use, but C# plus Unity is one of the easiest combinations out there for learning.

Ones I'd say for beginners to avoid:

  • BASIC. Encourages lots of bad habits, not particularly portable, not particularly salable, and has very limited utility in the modern world.
  • Java. Encourages lots of bad habits and has a number of performance and efficiency issues.
  • Ada. Not a bad language, but seriously over-complicates many things in ways that are challenging even for some experienced developers to understand.
  • Almost any pure FP language (Haskell, Erlang, Elixir, ML etc). FP is seriously hard for a lot of people, and traditional procedural paradigms are often challenging enough for new programmers.
 

English.

Please don't hit me. You heard right. English. For native English speakers, this is obviously nothing, but for the rest of the world, please learn English before doing anything. Programming languages come and die, technologies come and die. Ideas rise and set. With English, you can learn anything you want.

 

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.

 

I would agree with that. On the other side, it is kind of sad that you need to pass this barrier before you can get to the programming-thing

 

I was lucky that I have had chance to self taught English and programming to change my life, and I know there are millions of people in my country can't have that luck just because of the language barrier, that's why I'm trying to build a platform to help them.

It's hard and take time, but I'm happy with it.

 

For beginners I think it's not just about the language. They need to understand core parts of programming.

  1. basic stuff (function, loop, list.. Etc)
  2. Package management
  3. Platform you're targeting

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 think Ruby is a great beginner language for so many reasons. There are so many great tutorials and courses out there. And from my experience the community is really welcoming.

To me it also made that first jump into writing my first small programs a lot more approachable. Ruby reads like english sometimes (with good variable naming 😉), and is quite forgiving for beginners. While the forgiving nature can lead to bugs, and some lack of understanding around some of the deeper concepts, I think the trade off in approachability is worth it for beginners. Especially people who may be switching careers and may be daunted by some more complicated looking languages

Disclaimer: I started with Ruby and work primarily with Ruby so may be a bit biased 😉

 

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

 

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 ES6

 

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

 

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.

 

Go without hesitation. It's incredibly readable and very simple. There is a lot of good libraries and good documentations. The "almost one way to do one thing" is also very important for beginners. It's not a belief, I saw it around me. 5 years ago I would have recommended python.

 

Go is a kind of modern Pascal (which is beginner-friendly). Package manager situation for Go is sad though

 

Ruby wasn’t my first language but I wish it was. Tons of documentation and examples to follow.

Object oriented principles that are standard with ruby really help to develop solid code.

10/10 would recommend

 

My first response is always that Python seems like the best entry-level language, for all the reasons everyone has already said.

But JavaScript has some giant plusses that make it worth the struggle to persevere through its endless surprises (hey, it's not that hard start with).

  1. No installation, it's everywhere.
  2. No compiling, and therefore, instant feedback / gratification.
  3. Very easy to see the benefit / come up with own ideas.
  4. Very to find help and inspiration from the community.

The fundamentals can come later, but for a lot of people like myself who never imagined that programming could be real thing they'd do, lighting the fire and getting results goes a long long way.

 

No compiling, and therefore, instant feedback / gratification.

Any interpreted language behaves likes this e.g. Python, Ruby, Lisp, etc. But this doesn't mean fast feedback every-time, what if you want develop server? In this case you need to change file, restart server to see feedback. Or if you use const you need to restart REPL

 

Anything where you can be productive immediately. I think it's more important to have a positive first experience with programming than what the language is.

 

I would say a language is good for beginners if they can install it easily, so python is good for beginners, apart from python I would choose c#.

 

COBOL, provided your first language in English.

 
 

In a classroom-like setting where an instructor can provide ample support to a student, I'd go with C. Otherwise, for self-studying, it can't get any better than Python.

 

In my opinion, depending on the needs and the field or niche occupied. For me it might be PHP.

 
 
code of conduct - report abuse