DEV Community

stereobooster
stereobooster

Posted on

What language would you recommend for a beginner?

This post is inspired by this tweet:

1. First language: Basic / Java
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?

— Vx. Super Di 🦄 (@cotufa82) October 3, 2019

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)

Collapse
 
bak3y profile image
Bak3y

Python. It's very readable, can do basically anything you want, and there's tons of documentation and educational resources available for free.

Collapse
 
stereobooster profile image
stereobooster

What about package manager? It was quite frustrating when I tried it last time

Collapse
 
bak3y profile image
Bak3y

Pip is okay, but if you're going to work with Python extensively I recommend really learning venv.

Thread Thread
 
stereobooster profile image
stereobooster

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)

Thread Thread
 
bak3y profile image
Bak3y

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.

Thread Thread
 
stereobooster profile image
stereobooster

There are languages which come with built-in package managers which just work out of the box though

Thread Thread
 
bak3y profile image
Bak3y

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.

Thread Thread
 
stereobooster profile image
stereobooster

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

Thread Thread
 
bak3y profile image
Bak3y • Edited

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

Thread Thread
 
stereobooster profile image
stereobooster • Edited

Yes it won't be ideal in general, but the question of package managers solved in many languages quite well (bundler, cargo, elm)

Thread Thread
 
bak3y profile image
Bak3y

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.

Thread Thread
 
stereobooster profile image
stereobooster

(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

Thread Thread
 
bak3y profile image
Bak3y

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?

Thread Thread
 
stereobooster profile image
stereobooster

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.

Thread Thread
 
bak3y profile image
Bak3y

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.

Thread Thread
 
byrro profile image
Renato Byrro

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.

Collapse
 
squigglybob profile image
squigglybob

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

Collapse
 
stereobooster profile image
stereobooster

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)

Collapse
 
delta456 profile image
Swastik Baranwal

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.

Collapse
 
stereobooster profile image
stereobooster

Depends on how you define "core concepts"

Collapse
 
delta456 profile image
Swastik Baranwal

Those concepts which are normally in any language and could be used to relate real life probelms.

Thread Thread
 
stereobooster profile image
stereobooster

Yes, but this is very wide surface. Some languages are ver far away from each other, for example, Prolog, Agda, C, TLA+

Thread Thread
 
delta456 profile image
Swastik Baranwal

Yes things may differ because of different purposes but terminology from which it derives is same (sort of).

Thread Thread
 
stereobooster profile image
stereobooster

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.

Thread Thread
 
delta456 profile image
Swastik Baranwal

Agreed

Collapse
 
mateiadrielrafael profile image
Matei Adriel • Edited

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.

Collapse
 
ahferroin7 profile image
Austin S. Hemmelgarn

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.
Collapse
 
codemouse92 profile image
Jason C. McDonald • Edited

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

Collapse
 
metalmikester profile image
Michel Renaud

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.

Collapse
 
natec425 profile image
Nate Clark

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.

Collapse
 
stereobooster profile image
stereobooster

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

Collapse
 
natec425 profile image
Nate Clark

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.

Collapse
 
mandaputtra profile image
Manda Putra

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

Collapse
 
stereobooster profile image
stereobooster

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

Collapse
 
mskog profile image
Magnus Skog

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.