The 7 Languages You Need
Right Tool for the Job
Been enjoying following the #100daysofcode Twitter hashtag. So refreshing seeing so many take their learning into their own hands and be responsible to do what others depend on organizations to do for them (which is a misleading myth).
I have noticed that many are picking a wide range of languages to learn without really much thought as to which languages they should learn. Their decisions are based on something other than what might be the best tool for the job. There are lots of jobs out there and knowing them first is required to know which language fits best. Here’s my take on these job categories and the best languages for them.
These languages are designed to make those learning them into true full stack engineers. Learning these languages will allow you to literally make anything:
- Shell (POSIX, Bash, & Perl)
- C++ (then Rust for fun if you want)
- Microchip PIC Assembly
Shell (POSIX, Bash, Perl): Utility, Automation, Ad Hoc
Power users and developers learn the shell. The shell is where the power is (not to be confused with PowerShell). What would take you 10 minutes to do with a graphical interface can be coded on the shell in 1 minute. Everyone needs to learn the shell, yes even graphics artists (think automating applying Adobe filters in batch mode).
The undisputed leader in shells to learn these days is
bash which comes on every Mac, Linux machine and is suggested immediately by VSCode when installed on a Windows machine.
bash is not POSIX compliant and when learned first can corrupt a beginners knowledge of shell that will confuse and potentially harm their development later for enterprise systems.
In fact, modern Linux has moved from
dash for systems shell scripts, which are 100% POSIX compliant and based on Bourne because they finally realized using
bash for such things was significantly slowing down startup.
That said, you have to install
bash to get any shell on Windows.
There was a time when saying
bash runs on anything would have been pushing it, but with
git-scm.org and now Windows
bash integration we actually have a clear winner.
bash is king. Your friends might be using
zsh (just don’t, you’ll look like a clueless hipster) but these ultimately are variations on bash.
The main reason to really learn
bash is the speed with which you can add highly performant commands and utilities to your workflow simply by modifying your
.bashrc file. Functions here become the equivalent of commands and run with no delay because they are loaded into your currently running shell. This is a must for anyone using a computer for development or operations.
By the way, stick with a simpler command prompt. Prompts that span the terminal width and have all kinds of information and color actually have been shown to distract from productivity. All you really need is the current user, machine, and the current folder.
Keep in mind that you do not have to write a script for most little things. You can use an
alias in your
.bashrc or add a
function at most. There is nothing faster if it works out that way. But sometimes it doesn’t.
Perl Replaces Sed/Awk
Almost all text manipulation can quickly be done in
bash but sometimes you need more. For example, when filtering the output of the
find command. What do you reach for when dealing with text and configuration files or when you need more power than just the shell can give?
perl which comes on any system created in the last 25 years.
perl a part of the shell as much as anyone considers
awk to be, which is pretty much everyone.
Before you roll your eyes, turn away, and write job descriptions that includes “a healthy disdain for Perl” (which I have actually read before) understand this: nothing is better than Perl for ad hoc regular expressions scripts on the command line, nothing!
People often do not realize that Perl’s primary raison-d’etre is to replace
awk which are both interpreters that slow scripts down and are inconsistent across even the same UNIX/Linux systems. Perl defined the standard for regular expressions, so much so, in fact, that the
perlre.so library is included in most other interpreters including Python and Ruby.
I once had an Anakin Skywalker student challenge me on
perl because he had seen it on stack exchange and “educated” me on in-place find-and-replace (which is
perl -p -i -e 's/some/other/g' * in Perl). He could not get it through his head that
sed had been updated to do what Perl already did, nor that for other operations that meant invoking
awk as well when you get all that and more in one
perl sub shell. Besides, the regular expressions in
awk are different and hard to remember. Trust me. Learn Perl. It is the standard in regular expressions.
Perl was the first and remains the best quick-script interpreted language. It was never meant to do 100-line object-oriented programming (which you should use Go for instead now, not Python). If you remember that you will own the nay-sayers who mock you for learning it. This is why Perl remains a primary language pick for those involved in system security and operations.
By the way, I’m talking Perl 5, or even 4. In this case you want to learn the Perl that is most likely to automatically run on any Linux/UNIX system installed in the last 20 years—even REPL.it.
Go: Commands, MicroServices, DevOps
Anything that requires a command (instead of a
bash alias or
function) should be written in the clear leading language for such things: Go or Golang (as you should search for on Google). There is simply no better utility language. This is why Docker and Kubernetes are written in it. It is why
hub was written in it. It is why Duke Energy is hiring heavily for it. It is why DropBox ported their entire code base to it. I could go on.
The top reasons to use Go for this sort of thing are these:
- It compiles to C-compatible machine code
- It can be cross-compiled from any OS to any other OS
- It has built in garbage collection
- It has true concurrency through parallelism
- It compiles faster than any other language on Earth currently
This was the very reason Go was invented at Google, so you are in very good company picking this as your language for such things. It doesn’t hurt that Forbes calls Go one of the two “highest paid languages you have never heard of”.
Go is also a primary “serverless” being supported by both Amazon and Google cloud platforms creating microservices that are orders of magnitude faster than the same implemented in Node.
Python: Interviews and Automation
Python is an old, generic language that is relatively good at most things and very popular of late (2018):
- includes essential core computer science data structures and algorithms,
- includes a GUI with TK for quick rendering,
- includes a database, SQLite,
- has an approachable C-stubbing making it good to wrap C libs,
- currently has the best data science and machine learning library bindings (but there is a substantial conflict between TensorFlow and Python 3.7 that has not been resolved making TF unusable on 3.7),
- has libraries like Fabric and Celery for remote asynchronous task execution,
- minimal syntax makes it fast to write for competitive programming and interviews.
But Python also isn’t the best at many things.
- It is far more verbose than needed for most
- It is not nearly at fast or useful as Go for systems programming.
- It is absolutely bad for any front-end development.
- It has serious problems with
async/awaitthat make 3.7 incompatible with the #1 data science C library, TensorFlow.
Whatever you do, do not learn Python as your first language. It will mess up your brain — especially if you learn the fully deprecated Python 2.
Python is ridiculously slow both for deployment and execution of “serverless” microservices and complicates them by requiring inclusion of multiple libraries. Use Go for such things.
Python is also horrible for truly functional programming lacking multi-line anonymous functions, built-in concurrency, and requiring white-space in its syntax with the annoying
pass for empty blocks (which is the main reason extensions to the
lambda keyword were rejected).
Python package management is an absolute catastrophe and has been for more than a decade. Guido himself joked about how bad it was in a tweet. For example, try sharing a complicated Python application with your friend on another system. You can’t. People have to resort to the same broken bundling of the Python environment with their app just to get consistency across different machines and platforms. Go destroys Python for these use cases (and has at Google proving my point).
Guido’s holier-than-thou “significant white space is fine” and “we don’t need no functional programming” attitude have always been just dead wrong. I just did not have the courage (and experience with it) to say it. Well I do now.
C: Low-level Programming and Devices
Sometimes you need full control. You need your own memory management and you don’t have a lot of room for a full-sized, statically linked binary such that Go or Julia would produce. In these cases C is by far the industry standard.
C++ and Rust: Unreal Engine and other High-Performant Applications
Most high performance libraries are written in C++ including Unreal Engine, arguably the best 3D game and simulation engine on the planet if not the most ubiquitous. (Unity can’t touch it.) C++ provides object-oriented programming approaches to manage millions (even billions) of lines of code with the same efficiency and low-level focus as C (no garbage collection, for example).
Rust is becoming wildly popular with game developers because it replaces C++ while being much safer. One could objectively argue it is the safest low-level language in the world. But game developers reach for it because it lacks any garbage collection memory management that would unpredictably mess with performance. Rust was created by the Mozilla Foundation to replace C++ for developing the Firefox web browser.
Warning: people often compare Rust to Go. The languages might both compile to low-level machine code but that is about the only similarity. They solve completely different problems. If you are making a browser-ish thing use Rust. If you are making a command-line utility, micro-service, or web crawler, use Go.
Microchip PIC Assembly: PIC Devices, IoT
At a certain point you don’t even have room for C compiled code. This is when you need Assembly. Since Microchip is—by far—the most dominant producers of microcontrollers in the world it stands to reason this is the Assembly you should first learn.
After some negativity about some languages in this post (as you will feel yourself realizing there is always something more to learn) it is important to remember to be happy. The lesson I learned with Python is that coding in it brought be joy for a while, but when I realized how completely superior—and just plain fun—the other languages it became impossible to code another line in what was now a painfully decrepit language by comparison.
The great thing is that no one has to code in any specific language. Pick the ones that make you happy! Not just the ones you think will get you a job. I promise you this will make all the difference in the long term. All your coding will be better for it.
The best thing about learning to code is the incredible joy it brings to do it, to make things that help you get stuff done or apps that you can share. These languages cover just about anything you could ever want to make or code. Sure there are very domain-specific languages out there but ultimately you have everything you need with these.
By the way, the next language you should pick up should definitely be C (or even Microchip PIC Assembly) because you better understand how a traditional digital computer works as the lowest level (as opposed to a quantum computer, for example).