Hacker News new | ask | show | jobs
by ixmatus 4399 days ago
I'm undoubtedly a Haskell convert (from Erlang / Scheme / Python) with little experience in Go.

The investment is pretty big, yes, but I also believe it is great from a commercial perspective because it really improves the result for End-Goal-Programming (end goal is to serve business needs, not technology for technology's sake):

    1. Time to market for a product
    2. Easy / clean refactoring
    3. Massive scale code base management
    4. Program longevity and maintainability
1) Time to market is extremely important for businesses and products and schedule over-flow is a common problem in software engineering that Haskell really does help solve. Since building production software in Haskell I've become completely frustrated by Python because I spend far more time building in it due to debugging my own undisciplined habits out of the end product. I'm not a very disciplined dynamic type programmer.

It also produces cleaner and less buggy product for the end-user. Which is so important!!! Particularly as a startup.

2) If you need to cleanup some technical debt from taking short-cuts or not accurately pre-planning architecture, Haskell's type system makes it so friggin' easy your eyes will bleed when you try to do the same in a Python / Ruby / Erlang program.

Additionally, it really allows you to respond to the market better too! If you have to pivot your product it's not "Oh shit, now we're going to have to take that duct taped sewage monster and turn it into a duct taped ninja turtle." it's "Hmmm, well, let's think through the new types a little bit and re-shape some of this code, I know the compiler will tell me when I'm being a silly human."

3. Python and Ruby aren't really appropriate for large scale code bases because dynamic typing means you need an equally massive amount of tests to ensure no one else in the org fucks shit up. It makes team based programming on the same codebase far more manageable!!

4. Once I've built my Haskell programs and wrote a few minor property tests with QuickCheck, they usually run forever. I've rarely ever had a case where I would get unexpected crashes (usually from my not understanding Haskell's laziness earlier on in my Haskell career).

Long-term maintainability is massive factor here too; it's so much easier to figure out what the damn thing and all of its constituent pieces do with the type system!!! It's like having an index and a table of contents for a book. Since most programmers forget their own code anyway (comes back to that fallible human thing), having a neat and correct abstract description of your program and its parts is invaluable to a commercial enterprise.

So, in short, I actually think Haskell is the best language a commercial enterprise could choose. All you need too is one really good programmer that can mentor, then train them as you go; the good news with Haskell is even when you write shitty Haskell code (un-idiomatic, mostly in the IO monad, and barring space leaks), it's usually better than even the good Python and Ruby code those people would be writing.

3 comments

+1, (1) (2) and (3) are very real problems in industrial software development.

I've been reading a lot how Twitter transitioned from an RoR monolith ("monorail") to SOA when they got big enough, it's a rough journey but I suspect many companies have to take it once they evolve from iterative prototyping/experimentation to correctness at scale.

I've also realized writing good, maintainable code can be done in any language, it's just that some languages (e.g. Go) make it much harder to write unmaintainable code for many of the reasons you've cited above. "Debugging my own undisciplined habits" really hit it on the head.

Yeah, if you ever get a chance to build something for production in Haskell / Scala / OCaml you'll realize how little even Go (which is better than Python and Ruby!) does for you.

The funny thing is, I believe (from real-world startup building experience) that Haskell has allowed me to iterate / prototype my products faster than I ever would have with Python and Erlang (my old go-to tools).

Also, with Haskell, there's no late-night and weekend fires to put out :) Which makes me more productive and generally happier.

[EDIT] To whomever is downvoting these legitimate comments, speak up why you think they are inappropriate for this discussion instead of downvoting.

I have just started learning Erlang - picked it over Haskell, it seemed to "click" better with my brain. What made you make the switch? Am I wasting my time?
Not wasting but you'll think you're a functional programmer, hit Haskell, then realize you were barely a functional programmer.

I used to feel as you did, until I started thinking more mathematically; the idea behind composition and clarity. Erlang has amazing properties but Haskell can, honestly, do much of it better and faster and safer.

Erlang has Dialyzer and type annotations and quickcheck. Use it all religiously because your Erlang programs will get big and messy fast.

What made me switch? STM > message passing actors, Haskell's type system is incredible, and the libraries / tools available are also pretty amazing. Programming in a way that encourages me to think mathematically is just so much more natural, personally.

Composition + a strong type system is an incredible experience. If you want more personal war stories we can do it over email?

I've built very large and performant Erlang software in production and very large and performant Haskell software in production for two of my own startups.

> I've become completely frustrated by Python because I spend far more time building in it due to debugging my own undisciplined habits out of the end product. I'm not a very disciplined dynamic type programmer.

You heard it here first, folks: Haskell is the blub of 2020, made to force sloppy workers to produce slightly cleaner output when they couldn't be induced to do it voluntarily.

Making it more like Java than anyone tends to admit, and leaving intact the advantages Python had over Java.

If you're doing the computer's work "voluntarily" then you're doing it wrong.

Plus, I think his whole point went woosh over your head.