Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Javascript sucks.

I work with lots of really, really good developers who struggle a bit with JS. Most of it is because they come from a totally different background, and the other part is Javascript in general just makes things difficult.



This is just false: there are a bunch of sharp edges in JavaScript, but once you know them, the language itself is one of the more pleasant languages to use: this can be a bit of a problem, since the languages itself doesn’t force a particular structure on your code like Java or Haskell do, but on the other hand, JavaScript is an amazing language for experimenting with new programming paradigms and application architectures.


What structure do you believe Haskell forces on your code?

My experience with Haskell is that it's the most expressive and flexible environment for exploring different ways of structuring code that I've ever used. I've seen everything from extremely-imperative code carefully managing memory allocations and munging bits, to very abstract high-level libraries that declare abstract computations that can be interpreted or executed in a variety of ways.

I'm very confused and surprised to see someone assert that Haskell forces a particular structure on your code.


Haskell doesn't force anything, but it does make some pretty strong suggestions. Haskell suggests immutable data, pure functions, and algebraic thinking. You can make your data mutable, do everything in the `IO` or `State` monad, etc., because Haskell doesn't force structure on your code -- but the suggestion is still there, whispering in the back of your mind.

(This is what I love about Haskell, BTW, so please don't read this as a criticism.)


This is what I was thinking: if I just want to sit down and design myself an object system, Haskell’s type system gets in the way of the necessary parts. (Unless you want to limit the interaction between your object system and haskell’s types in annoying ways). I’ve implemented CLOS-style mutimethods as a handful of functions basically translated from the Common Lisp in the art of the meta-object protocol. And the multimethods work transparently with any ja type.

This isn’t a criticism of Haskell: there are plenty of benefits to forcing declarative IO and limiting the language (roughly) to features that don’t break type-inference, but those advantages of Haskell make it much less enjoyable to experiment with programming paradigms in.


Thanks for the clarification!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: