Chris Okasaki has a blog and booleans

Chris Okasaki (he of the heroic efforts to analyze performance of partly-lazy data structures) has a blog now. It's pretty good, and readable.

I like the post on confusion over boolean expressions. (But comparisons are distinct from booleans in most machine languages...) I know I have been guilty of excessively explicit logic, usually in the misguided service of clarity. The other day I found an example in some code I had written a few months ago: if (match && !desired || !match && desired). I didn't understand it until I verified that it was equivalent to if (match != desired), which I had avoided on the grounds that it was confusing. I guess I was wrong.

No comments:

Post a Comment

It's OK to comment on old posts.