I was just on vacation for four weeks and I spent the entire time writing code.
Well okay, I did also spend some time playing games because Steam summer sale and all that (I finished Bayonetta).. but that’s beside the point :)
My job is to write code.
Most people stop doing what they do at work when they go on vacation.
During some days I probably spent more time writing code or thinking about it than I would do at work.
And not only that, I was using Haskell. A friend wanted to help me in the project we were working on and I told him I was using Haskell… Behind his plain “Why?” I’m sure he thought I was crazy :)
But the thing is… I usually don’t have much interest to work on side projects these days. Most of my creativity seems to go into work – after you deal the whole week with all the issues and bugs and things at the office, it can be difficult to get up and do something that requires a lot of thinking.
So why do I jump to a random side project as soon as I’m on vacation… and in some crazy language like Haskell to boot? Why not use something more sensible and relevant to what I do anyway like Redux or TypeScript, neither of which I’ve never used?
Challenge.
JavaScript just isn’t very challenging to me as a language.
I hope that doesn’t sound too pretentious – but when you’ve used languages like JavaScript for over 10 years, it really does get a bit like that. Heck, I started with PHP like 15 years ago! While I still like working with JavaScript, it just isn’t very challenging on the language and library level.
Yes – I’ve never used Redux… but when you’ve seen a hundred JS libs, you’ve seen them all. Yes… I’ve never used TypeScript… but when you’ve seen a dozen Object-Oriented languages, you’ve seen them all.
I could probably have done the project faster with JavaScript. But that’s precisely why I chose Haskell. I want to learn more about it, and it’s one of the few languages which actively provide new challenges and new ideas to me that other languages like JavaScript no longer do.
When it comes to JavaScript… you can ask me any question and I’ll probably know the answer (try it, you can ask me anything)
With Haskell… well, let’s just say I went on the #haskell IRC channel on Freenode to ask questions a lot :)
If you’ve worked with programming for a while – or even just used computers – you can probably remember a time when things were new and exciting. Oh I just printed stuff on the screen! YES I’M THE BEST AT PRINTING TO THE SCREEN!… or if you play games, you might remember the early days fondly… I remember when the first 3D accelerated games were released. Boy did they look amazing! These days it’s just small incremental upgrades where you can see Shooter McFiresguns’ facial hair and angry expression in slightly more detail than last year.
Programming also has similar aspects to it: For example learning new ways to write code, or finally understanding something concept well. These are some of the most fun aspects about programming, but once you’ve been doing it for a while, it just stops happening because you kind of already know this stuff.
But then I learned Haskell, and it just keeps giving more cool stuff to learn. It’s like going back 5 years when there still was new and interesting things in programming. Yes, it might be a bit crazy… Yes, it’s full of weirdo math vocabulary (monads are just the tip of the iceberg) that I never learned… But it’s surprisingly practical, and much of it can help you write better software in other languages too.
With JavaScript, the challenge is more in solving complex problems and writing really good software. This is why when it comes to JavaScript I talk about more advanced topics like test automation and such.
So what’s the point of this somewhat rambley story?
To borrow some gaming lingo, you don’t git gud by just doing the same things over and over again. While repetition helps, there comes a point where it’s no longer effective.
There’s an interesting paragraph on Wikipedia regarding Wayne Gretzky, who is widely thought to be one of the best ice hockey players ever. Essentially it states that much of his skill came from studying every aspect of playing hockey, instead of some creative genius that many thought it was.
Similarly, while Albert Einstein is perhaps most famous for his theory of relativity, it’s nowhere near the only aspect of physics he studied.
We can easily draw a parallel to programming here. You don’t get really good at programming by just coasting along in your comfort zone, using your favorite toolset all the time, and doing what everyone else is doing.
As an example, personally I went and kept doing something new and different. I don’t mean this as in nobody had done it before, but as something that I personally hadn’t done before – sure, I could have written yet another todomvc example app with a different library, but where’s the challenge in that?
Over the years I tried all sorts of languages… The list is quite long: JavaScript, C, Perl, Python, Ruby, TCL, Visual Basic, Pascal, C#, F#, Prolog, PHP, Rebol, Java, Clojure, ActionScript… And then, I’ve tried all sorts of libraries, frameworks, tools, etc.
I admit I didn’t really plan on doing that. It just happened because I kept looking for new things that were interesting and different from what I did before.
But I think that’s exactly why I’m where I’m at today. I’ve learned about programming from many different languages, where most of them have their own way of doing things. Who’s to say JavaScript is the best? Or Haskell? But knowing all these different styles there are to writing code, all these different methods used, it allows me to make the best choice for the project at hand and for the task at hand.
Because I kept looking for new and exciting things to learn, I was exposed to much more information, and many more techniques, than, say, just remaining a PHP programmer would have done.
To give you a few examples:
- C taught me pointers and references. I’ve noticed many JS programmers have problems understanding things like how references work, and how values and references differ. You basically have to know how this stuff works if you use C
- C# taught me about debuggers. The built in debugging tools in the Visual C# IDE are basically why I’m good at using the debuggers in browsers. It also gave me a rudimentary understanding of how GPU rendering works after playing with DirectX
- PHP got me started with unit testing – the test tooling used to be non-existent for JavaScript
- JavaScript has helped me appreciate simplicity. While you can build all kinds of inheritance chains and use `new Foo` everywhere, why bother when a plain object literal works?
- Java made me realize I don’t really like dealing with the average Java project
- Haskell made me realize languages with strong typing aren’t all really annoying to use
As a result, I’m a better programmer in the languages which I do end up using daily. This kind of knowledge also allows me to pick and choose a tool that’s best suited for a job – for example, Python has some great web scraping libraries, and Haskell has some great tools for writing parsers.
If you want to be an excellent developer, don’t shy away from trying something new and different. You definitely don’t have to learn a dozen different languages like I did, but it’s worth at least trying something different from time to time :)