yujiri.xyz

Software

Learn programming for good instead of profit

Choose a language

last updated 2023-08-28

So you've decided to learn to code. It's time to choose a language to learn. The language you choose matters a lot because - especially as your first language - it will heavily influence the way you think, just like a human language. But it doesn't matter *too* much because you'll end up learning many languages eventually which will enable you to see past the biases learned from your first.

I'm not going to tell you exactly which to pick; I want this to be a moment of agency for you. Below I rate several programming languages I've used according to a few metrics, along with an explanation of what each metric means. The scale is 0-5. After this I'll describe each language.

Performance

How efficient will your code be with the machine's resources (CPU and memory)?

Zig: 5

C: 5

Rust: 4

Go: 3

Crystal: 3

Python: 0

Safety

How many mistakes can the language help you avoid?

Rust: 5

Crystal: 4

Zig: 3

Go: 2

Python: 1

C: 1

Ergonomics

When you know what you want to do, how easy is it to just write code that does it?

Python: 5

Crystal: 5

Rust: 4

Zig: 3

Go: 2

C: 0

Learnability

How easy is it to learn?

Go: 5

Python: 5

Crystal: 4

C: 3

Zig: 2

Rust: 1

Do note that there are important metrics other than these. For example, the quality of the toolchain (compiler/interpreter), how long compiling takes, how helpful the error messages are, how good the ecosystem of third-party libraries is.

C

C is the old standard. It was made in 1972, and the Linux kernel, and the vast majority of infrastructural software (most package managers, widget toolkits, and widely-used libraries*), are all written in C. Because of that, you should learn C eventually, but not necessarily first.

Zig

Zig is a low-level language that first appeared in 2016, aiming to replace C. It has a lot of cool ideas and I like it a lot. However, Zig is still in an early stage of development. There are often bugs in the compiler and backward-incompatible changes with each new release.

Go

Go is a language made by Google in 2009. It's often used for programming network servers, since it has good features for working with concurrency. It isn't exactly a low-level language, but it does compile to machine code.

Rust

Rust is a language made by Mozilla in 2010. It has a lot of fancy features that are typical of high-level languages, including automatic memory management, but its automatic memory management is unique and doesn't come with the overhead that it does in most high-level languages, so Rust can also be used for low-level programming. As of 2022/10, the Linux kernel even includes a little bit of Rust code.

However, Rust has some ideological issues: it has its own centralized package repository that its compiler downloads dependencies from. And there's a licensing problem: it's trademarked in a way that prohibits forking it without changing its name (Mozilla has done this with other projects: see how Debian, a Linux distribution, had to change the name and logo of Firefox to Ice Weasel to be allowed to distribute their modified version). If you're like me, these facts are distasteful to you.

Crystal

Crystal is a language that first appeared in 2014. Its goal is to be like Ruby (an interpreted language, which would rank the same as Python in the above metrics) in every way except that it's statically typed and compiles to machine code. It (and Ruby) doesn't suit my tastes, but I've written one project in it, and must admit it's a good, pragmatic language.

Python

Python is an interpreted language made in 1991 by a single person. It's very popular and often used for web development (on the server side). This is where I myself started. I discourage using interpreted languages for serious programming because they exacerbate the problems I discussed in the manifesto of this guide, but they tend to be easier to learn and good for throwaway code, and Python is no exception.

---

Now, I encourage you to make your choice without any canonical recommendation from me.

Proxied content from gemini://yujiri.xyz/software/guide/language.gmi

Gemini request details:

Original URL
gemini://yujiri.xyz/software/guide/language.gmi
Status code
Success
Meta
text/gemini; lang=en
Proxied by
kineto

Be advised that no attempt was made to verify the remote SSL certificate.

What is Gemini?