News for hackers. Stuff that matters.
Re:Do I really want to be using a language where memoize is ... by fogus on Tuesday July 20, 2010 @07:30AM (#1531742)
There is (has always been?) an interesting formula for writing academic C.S. papers: define the most constrained environment imaginable and then do mundane things in it. Haskell is a very beautiful language in a very pure sense and it is the perfect garden for C.S. papers. Likewise, it's an incredibly fertile garden for language features and programming techniques. Is it hard? In some ways perhaps, but to me Javascript's notion of logical truthiness is extremely difficult to hold in my head. It's all relative I suppose.
Re:Do I really want to be using a language where memoize is ... by WilliamLP on Tuesday July 20, 2010 @08:21AM (#1531815)
> Javascript's notion of logical truthiness is extremely difficult to hold in my head.

So it isn't intuitive to you that an empty object and array should both evaluate to true, but neither are equal to true, the empty array is equal to false, and the empty object is neither equal to true _or_ false?

Re:Do I really want to be using a language where memoize is ... by donw on Tuesday July 20, 2010 @08:27AM (#1531821)
I've heard of duck-typing, and static-typing, but this is the first time I've heard of Schrödinger-typing...
Re:Do I really want to be using a language where memoize is ... by gtani on Tuesday July 20, 2010 @10:39AM (#1532183)
Yeah, Appendix A Crockford's "Good Parts" (could be Appendix B, I can't remember. The book's so small I can't find it.
Re:Do I really want to be using a language where memoize is ... by sesqu on Tuesday July 20, 2010 @02:33PM (#1533003)

  > Boolean([])
  true
  > []==false
  true
  > [] == ![]
  true
How the hell does that work? Aren't all non-booleans implicitly cast?

edit: rephrased

Re:Do I really want to be using a language where memoize is ... by chc on Tuesday July 20, 2010 @03:42PM (#1533224)
It's because the == operator converts its arguments to be of the same type, and it does so in a rather unintuitive way. This makes it both inefficient and frequently baffling. You pretty much always want === instead, which does not allow comparisons between different types.