Skip to content

Comment on Ask HN: What language to learn after Python?

Comments

I can't really give you advice without learning more about what you want to know.

To me, there are far more jobs out there than I need. You only need one job at a time. So I like to keep my mainstream programming skills reasonably sharp, but focus most of my time on expanding my mind.

That "job market" skill doesn't really matter that much. Python or JavaScript is fine. I have done a lot more JavaScript than Python over the years, and prefer JS but its not that huge of a distinction.

Early in my career, one of the things that really mystified me was how easy it was fro complexity to get out of control. I've worked on several code bases where nobody really understood how they worked. The abstractions were all very fuzzy, and almost any explanation for how something worked needed to be verified by myself before I could trust it. This seems to be the default state, and even the projects that start with the best of intentions, people with enough skill, refactoring discipline, etc, still seem to end up that way. So, I've been on a quest for figuring out how why this is, and how to mitigate it.

What totally surprised me was that Haskell was the answer I was looking for. Pure functional programming keeps you honest. People don't generally realize how problematic side effects are; of course, they are necessary, but having side effects strewn throughout your code base makes it very hard to reason about. The problem is that these are so complex that its very hard to accurately categorize them, say placing them behind a function name.

Many languages have kinda sorta maybe started to understand this and try to restrict memory mutability, which is certainly important, but for me working in web apps I have seen far more "stateful" problems resultant from rampant database access. Save a record here, query a table there, etc etc. Side effects add a ton of complexity.

So, if you want to become a better programmer, and perhaps figure out why stuff gets to be so hard for no good reason, learn Haskell. Send me an email if you wanna chat more/hear some advice on getting started.

I don't know if Haskell will long term be the thing that brings controlled side effects to the larger ecosystem; there are numerous other attempts in the works. Monads for side effects are a goofy hack, however they work fine and are totally acceptable for use etc.

But I can say that I am 100% convinced that once this truth is more widely appreciated, it will cause a massive change. We're going to see an impact on order of the impact automatic memory management had on the programming world.

The notion of using pure functions as much as possible and keeping your side efects restricted to as small a surface area as possible is certainly applicable in Python. The thing is, as a programmer you don't get to trust that things are the way they seem without chekcing yourself, so you gotta read the code. But still, learning Haskell will make you a far better programmer in your day job.

Oh, and another note: lots of haskell programmers go crazy with abstract stuff. Just don't do that. KISS applies to the haskell world as much as it does everywhere else. If you do, your programs will become SO MUCH EASIER TO WRITE AND MAINTAIN.

But this all depends upon the goal of being a better programmer. Haskell will also expand your brain in a delightful way, but so will Racket, Prolog, etc. So YMMV.

What kind of projects do You recommend to start learning Haskell? Do you have any go to resources for learning it?

Learn You a Haskell for Great Good! is aimed at people who have experience in imperative programming languages but haven't programmed in a functional language before.

http://learnyouahaskell.com/

You may find The Haskell Road to Logic, Maths and Programming interesting.

Haskell is unreasonably effective at writing CLI applications. I haven't worked on it in a while, and the code is not the best, but this is what I built when I was starting out:

github.com/joelmccracken/reddup

https://haskellbook.com/ is how I got good at Haskell. If you can't get a copy, there are other ways to get good at it though! Just not necessarily any all-in-one resources.

I'm always willing to help folks learn Haskell tho, so if you have any q's get my email from my bio.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.