3 ms·
A total nit pick, but why do people have such a hard time consistently naming something as simple as a boolean variable? If we remember that naming is one of th
by latchkey 9y ago
A total nit pick, but why do people have such a hard time consistently naming something as simple as a boolean variable? If we remember that naming is one of the hardest things in software engineering, why don't we put more thought into it?
From the documentation in the README: https://github.com/18F/identity-idp https://github.com/18F/identity-idp
disable_email_sending: ‘true’
enable_load_testing_mode: ‘true’
telephony_disabled: ‘true’
Multiple directions, multiple naming conventions, strings?!?!?. Just seems like a recipe for failure. I feel like this would be more clear:
load_testing_mode: true
send_email: false
telephony: false
When you write your conditionals, it makes it so much easier to read:
if !disable_email_sending
do_send_email
vs.
if send_email
do_send_email
Here is the line in actual use...
https://github.com/18F/identity-idp/blob/df549cf9a1fc2c21e3e322fa10e762ccb07da2a9/config/environments/production.rb#L23 https://github.com/18F/identity-idp/blob/df549cf9a1fc2c21e3e...
I'd personally rather have the positive condition first as it is easier for me to follow logically in my head.
- mdpopescu 9y agoI agree with having positive names in booleans (email_enabled vs disable_email_sending), but not with having verbs as booleans. send_email is an action; the corresponding flag should be email_enabled or is_email_enabled.