What Is Really the Best Programming Language to Start With?
Python. We think Python. Now, several of you probably just had a hernia. Everyone and their mother have strong opinions on which language is the best “first” language.
One of you:
Another one of you:
“No no — the TIOBE index has shown that Java is the most used language in 2017 and 2018. It’s everywhere in enterprise!”
“But Java is beginning to lose popularity! Learn something like Golang, which is beginning to explode and is now becoming the popular choice for REST microservices!”
“You can’t go wrong with classic C or C++. Fastest-performing languages. The Unreal Engine is built on [a bastardized version of] C++! Game design! Whoo!”
That one guy:
“Wordpress is a huge market. Learn PHP.”
If a person is so new to programming that they had to ask this question, they probably don’t have the ability to consider all the points you’re tossing out.
They likely may not even know what it is they want to do. After all, “software” could describe anything. IoT? Games? Mobile apps? Web apps? Embedded? Cloud? Graphics? Operating systems? Crypto? From the viewpoint of a newb, all of it sounds awesome (maybe). And overwhelming.
As an educator, you have to realize what the end goal is and choose a path accordingly for people not currently equipped to choose.
According to freeCodeCamp’s 2017 New Coder Survey, the vast majority of people want to learn how to code for professional reasons.
This means most want to actually become software engineers, not just dink around on side projects.
On top of killer benefits and pay (see above), there are various job perks like remote work and contract positions not possible with most professions. Better yet, if you come up with a great idea for an app, you could just dive straight into prototyping it.
In order to best equip someone to become a good software engineer, they have to become good problem solvers. This means algorithms and data structures. This means good frameworks and approaches to breaking down complex problems. It means strong foundations and fundamentals.
Doesn’t matter what you’re doing. Web design, embedded design, etc. — top-notch code requires top-notch foundations.
Yeah, yeah. Great. You could teach all that with Java or C. Why Python?
If the goal is to teach methodologies and frameworks for problem-solving, you want to eliminate the concepts that aren’t as important at the start. What use is there in mentioning namespaces or generics when they don’t even know basic flow control yet?
You remember how to write a Hello World Java program?
Does any of this mean anything to a novice?
“Uh. Public? Class? Um. Static? Void? What is String?”
Freakin’ 104 keystrokes to type a program that prints “Hello World!”. Also, you’re literally thrust into several different concepts right at the bat:
- Class access levels (e.g. public, protected, private?)
- Method access levels (e.g. public, protected, private?)
- Static keyword
- Return values (and void)
- Arrays (String)
- Method arguments and signatures
It’s overwhelming. And verbose.
And the worst part about most Java 101 courses is that, by necessity, you have to tell your learners, “Don’t worry about all this stuff for now. You’ll learn it later.”
I guess on the bright side, it’s simple enough to compile and run a Java program. Except when you have to explain why Java requires its filenames to match the class it contains. Also, wait ’til you have to explain library linking.
“Wait, this is even more confusing. What is ‘namespace std’? int? Return 0? Do the two arrows << literally suck that quote into the cout? Wait, what is cout?”
Again, fluff. Yes, namespaces and return values are important, but holy moly not for someone who’s literally just learning how to print a message.
I remember learning Objective-C for the first time as a middle schooler and I just could not understand the concept of “returning 0.” It means the program worked? Why? WTF?
And in hindsight, it was unimportant information. It was distracting.
Now, how do you run this program?
“./a.out?” What is G++?
Yay, now we have to talk about compilers and executables and default output files. Again, more crap you have to either explain that isn’t important yet, or gloss over.
Oh. Huh. And to run it?
Well gee, whiz. That wasn’t hard. You probably wouldn’t even need to explain anything, and someone could deduce what’s happening.
Okay, and how do you run this?
Uh… open in a browser? How do I run this in the browser? What is node?
You ever read Java code that looks like this?
This code is valid Java. It will compile and run.
It will also induce diarrhea.
With Python, bad indentation gets errors out the wazoo. Python essentially enforces a huge aspect of code style — indentation. It is never bad to force new coders to adopt good code style.
Now if only we could get people to put spaces between their operators.
Technically speaking, if you learn Golang and use the
fmt package, then you could auto-format your code. But Golang isn’t exactly a newbie’s language. Most Go tutorials online assume you already know how to code (like this one and this one).
Also, newbies don’t know what linting is.
We personally think it’s not as effective to thrust people into everything at once. You could take a bottom-up approach, where you start with teaching about the computer’s low levels and how everything runs. But people quickly become disinterested.
A lot of people get into programming because they want to make cool apps, build games, etc. Learning about the kernel and doing low-level programming isn’t a great way to start and maintain interest.
That being said, they still need to learn low-level programming to a small extent to be a well-rounded software engineer. So the solution? Start with the things they are interested in, and then slowly fold in the stuff that they may not care about but do need to know.
This approach is why we prefer Python — you can immediately get to learning the important core concepts of programming that apply everywhere without cramming the “boring” stuff down their throats from the start.
Compilers and parallel programming and threading and blah blah blah… that stuff can be folded in.
There are some people who are, quite literally, only interested in designing UIs. In that case, we’d argue that it doesn’t make sense to cram any kind of information into them about, for example, assembly language.
To us, a well-rounded software engineer is a person who knows a lot of things about software in general, but may specialize in a certain thing. For example, you could be a senior Java developer who specializes in back-end microservices. But if asked questions about low-level multi-threading or MVVM or MVC architectures, they would still be able to answer.
Just to reiterate, this article reflects our opinions. You’re welcome to disagree, but there’s no need to be offended or upset because someone else thinks differently than you.
Good luck, and happy coding.