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

Yes, the whole truthiness thing is bug-prone.

I think the history of Lisp is instructive. In traditional Lisp all the way through Common Lisp, the empty list, also known as NIL, is false, and everything else is true. This is a relatively benign form of truthiness, but even so, the type-punning it invites tends to make programs less clear (even though they're a little shorter).

Since Scheme was a clean sheet design, Steele and Sussman had the opportunity to change this, and they did: Scheme has explicit '#t' and '#f' literals, and no implicit conversions from other types to boolean. I think their reasoning was sound.



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

Search: