Sometimes I get asked “What is your favorite programming language?”, “What programming language would you use when starting to learn programming?”, “What do you think of programming language $X?”, “What programming languages do you use?”.
Let me elaborate.
Back in school we got taught Delphi. Don’t remember much about it. The programming was done through some kind of interface builder. In university I got to do Prolog and Java.
Back then one was able to use Java a lot because Android was quite new. Android apps were - and still can be - written in Java.
By following the Ethereum ecosystem for a while I got to do some programming with Solidity. The default smart contract programming language back then.
After spending way too much time on hackernews, and seeing again and again how every programmer should know Assembly and C I went through a PDF for Assembly and the beginning of Learn C the Hard Way. Back then the book was free and not yet finished.
After functional programming started to become all the rage I got my feet wet in Clojure by spending some time with the book Clojure for the Brave and True. Later Haskell by working through half of the haskell book.
By following the TDD and Clean Code community I was able to see a lot of Ruby in presentations and code snippets. Ruby was later revisted by working through Programming Languages Part A, Part B and Part C by Dan Grossman on coursera. The course also made you wirte code in ML and Racket.
In 2018 I had the fortune to introduce Kotlin into a, until then, pure Java codebase. Instead of resistance the change was welcomed with open arms by fellow developers. Both the possibility to learn something new, and to be paid for it, plus the ability to write, or to be honest generate, less boilerplate.
Kotlin is what I use to this day in most backend related work.
As Rust became popular, it was supposed to be the new C, I did spend some time with the book The Rust Programming Language.
While getting into iOS development I was able to quickly pick up Swift and SwiftUI.
How do you learn a programming language then? You don’t need to know generics to write a simple Java command line application. You don’t need to know the difference between
struct before writing an iOS app in Swift. It will become apparent at one point in your journey. Right when you need it.
Neither do you need to read a book on the programming language. Is reading the book helpful? Sure, you might pick up a few tricks while reading it and remember parts of the codebase you can apply it to. Is it required? No.
In my day to day work I sometimes get the question during pairing “Would this syntax work here?”. Even when you know the answer (Yes/No) the better answer is “Let’s write a test and see”. The moment you have a test we can play around with the implementation details, learn what works and iteratively improve it if necessary.
So what is my favorite programming language?
I don’t have one. Saves me quite some time when discussing what to use for a new project. What I care more about is the tooling around the language. I enjoy working more with Kotlin than with Swift because I consider IntelliJ to be superior to Xcode. But then, Xcode might be a lot easier than setting up your Haskell tooling. (To be fair it has been a while I have looked into Haskell tooling). Do I thus like Kotlin more than Swift because I enjoy working with it more? Fair enough. I guess the answer is a Yes. For now.
What program language would you use when starting out to learn programming?
In the end it is all if, else, loops and pattern matching for the functionally inclined.
I reject the notion of “Do $X to become a better programmer”. To become a better programmer you program. You program to solve problems. Even if the problem is not having anything better to do on a lazy sunday afternoon.