I keep tripping over "true, false, true"
allthingssmitty.com
I keep tripping over "true, false, true"
1–10 of 62 posts
Re: I keep tripping over "true, false, true"
#2I don't mind the object approach used here but its quite verbose in comparison even in Javascript. Having to name the variable and set whether its true or false is a lot more than needs to be done. Booleans in general have quite poor readibility and maintenance especially if a third possibility arrives.
Re: I keep tripping over "true, false, true"
#3Re: I keep tripping over "true, false, true"
#4Re: I keep tripping over "true, false, true"
#5Re: I keep tripping over "true, false, true"
#6I feel like a goal with good code is localizing understanding even if it occasionally duplicates something like a parameter name.
Re: I keep tripping over "true, false, true"
#7named arguments are hacking object literals to provide additional readability. it's ok, but not for all code paths, they have a true overhead. problem is that these things start to become idee fixes in teams (all funcs should have named args!). ideally, this could be fixed in the language.
Ultimately I think I’d bias towards readability vs the marginal perf increase though.
Re: I keep tripping over "true, false, true"
#8Re: I keep tripping over "true, false, true"
#9Re: I keep tripping over "true, false, true"
#10Also known as ‘boolean blindness‘: e.g. https://cs-syd.eu/posts/2016-07-24-overcoming-boolean-blindn...