3 ms·
Why do you need an alternative spelling of false?
by heavenlyblue 2y ago
Why do you need an alternative spelling of false?
- xigoi 2y ago`logging: no` clearly says “I do not want logging”. `logging: false` is less explicit – what exactly is false?
- jeltz 2y agoThen it should be on/off, not yes/no.
- xigoi 2y agoon/off also doesn’t make sense in many contexts, for example `isRegistered: on`.
- qw 2y agoI often prefer enums over booleans for this. It seems more readable for most cases, and can be extended with new values. This: isRegistered: true could be replaced with accountStatus: "UNREGISTRED"
- deleted 2y ago[deleted]
- qznc 2y agoLogging: ignore/print/file Don’t use bool at all.
- xigoi 2y agoThis, along with number formats, could be a good argument for strings being the only primitive type in config languages.
- qznc 2y agoI recently learned about NestedText: https://nestedtext.org/ https://nestedtext.org/ While it has the YAML-like significant whitespace, it looks nice because it doesn't try to be clever.
- alkonaut 2y agoLogging: no could also be log in norwegian. Or log only for the norwegian region. That's the thing with too many keywords and optional quoting, you can't know. And for this reason, "logging: false" would be clearer than "logging: no" to represent "I do not want logging".
- xigoi 2y ago`false` could be a code for something else just as well as `no`. For example, it could mean that I only want to see logs of false information appearing in the system. The only proper solution is to require quotes around strings.
- paulddraper 2y agoOptions are either 1. Specify in the key loggingEnabled: false 2. Specify in the value: logging: disabled