News for hackers. Stuff that matters.
Re:Effective Programs: 10 Years of Clojure by tome on Tuesday October 31, 2017 @02:00PM (#15595170)
That doesn't seem to describe any hoops I've ever had to jump through when using Haskell. Can you give concrete examples?
Re:Effective Programs: 10 Years of Clojure by wellpast on Tuesday October 31, 2017 @03:04PM (#15595691)
I just did. Having a Person vs. Cat taxonomy. The claim is about ADTs, not Haskell. When a "name" property will do, why do we need to introduce an ADT? Why do we need to taxonomize?
Re:Effective Programs: 10 Years of Clojure by tome on Wednesday November 01, 2017 @04:05AM (#15599518)
Then you can use a "HasName" typeclass. Admittedly that adds a bit of boilerplate (in one single place).
Re:Effective Programs: 10 Years of Clojure by carljv on Wednesday November 01, 2017 @01:05PM (#15603286)
I think the constant replies of "Oh there's a way to deal with that." Miss the point. You should keep asking yourself, "Am I fixing a problem that didn't need to be there?" Sometimes, the answer is: No, I do want this structure, and it's worth it overall to write interfaces, etc. to add some polymorphism or dynamism to it where needed. In lots of cases, though, you're just writing stuff to accommodate the language. In lots of languages I feel like I'm fighting an internal battle between static-ness and dynamism. Start with static types or classes, then add interfaces or typeclasses, oh and overload these functions. Now make sure these other things things implement this new interface so they can participate, etc.

Sometimes it feels like a real burden for not much gain over just passing around the basic data (a name, an age) I wanted to deal with to start with. Clojure's proposition is that in many many cases, not getting fancy with the data or over-engineering your problem representation will lead to simpler programs that are easier to maintain, giving you an alternative route to safety and maintenance instead of type-checking.