The rationale behind Falsy values
I'm wondering what the arguments for/against Falsy values are. On what principles would you decide to add or exclude them from a language? Are there any problems you could see them causing off-hand?
For users of languages that support Falsy values:
Where specifically have you used them to your advantage?
Where have you had unpleasant run-ins with them?
Are there any rules or finer points in your language/project/team about where it's appropriate or inappropriate to use them?
For users of other languages:
Have you ever seen a situation where you've thought "I wish I could use a Falsy value here"?
I'm tagging the question haskell and python because AFAIK those two represent opposite ends of the spectrum (Haskell demanding Bools when you use if, and Python treating None and some "empty" values as Falsy), but feel free to talk about your experience from other languages. Just mention where on the spectrum they stand.
I'm wondering what the arguments for/against Falsy values are. On what principles would you decide to add or exclude them from a language? Are there any problems you could see them causing off-hand?
For users of languages that support Falsy values:
Where specifically have you used them to your advantage?
Where have you had unpleasant run-ins with them?
Are there any rules or finer points in your language/project/team about where it's appropriate or inappropriate to use them?
For users of other languages:
Have you ever seen a situation where you've thought "I wish I could use a Falsy value here"?
I'm tagging the question haskell and python because AFAIK those two represent opposite ends of the spectrum (Haskell demanding Bools when you use if, and Python treating None and some "empty" values as Falsy), but feel free to talk about your experience from other languages. Just mention where on the spectrum they stand.
No comments:
Post a Comment