News for hackers. Stuff that matters.
Re:Kill hashtables, get shorter code. by jfager on Monday July 19, 2010 @05:00PM (#1530148)
One of my favorite features of Coffeescript (and other languages) is destructuring assignment, which lets you use pattern matching over an object to pull out values from nested structures. It's way more useful than this proposal: brief when you want brevity, but you still get the full object returned from the method when you need to debug, and apis don't have to be adapted or rewritten with the usage pattern in mind.
Re:Kill hashtables, get shorter code. by swannodette on Monday July 19, 2010 @05:19PM (#1530198)
Coffeescript is certainly cool, but Clojure has sophisticated destructuring assignment as well.
Re:Kill hashtables, get shorter code. by jfager on Monday July 19, 2010 @05:44PM (#1530277)
The point was not "Coffeescript is better than Clojure", it was "destructuring assignment (like in Coffeescript, for instance) is a better solution than the one proposed in the post". If Clojure has sophisticated destructuring assignment, awesome. Use that instead.
Re:Kill hashtables, get shorter code. by swannodette on Monday July 19, 2010 @08:55PM (#1530779)
I suppose I failed to see how destructuring assignment on hash-maps accomplishes anything interesting at all related to the post. The post eliminates hash-maps altogether.
Re:Kill hashtables, get shorter code. by jfager on Tuesday July 20, 2010 @07:44AM (#1531759)
It eliminates them from the api, but how does memoize work? There are still hashtables, you just never get a hook on them.

I'm just saying that I prefer having that hook, and that destructuring assignment lets me do so with brevity and clarity.

Re:Kill hashtables, get shorter code. by billmcneale on Tuesday July 20, 2010 @01:17AM (#1531219)
Destructuring is a pretty dangerous practice because it completely destroys encapsulation.