Hacker News new | past | comments | ask | show | jobs | submit login

`logging: no` clearly says “I do not want logging”. `logging: false` is less explicit – what exactly is false?



Then it should be on/off, not yes/no.


on/off also doesn’t make sense in many contexts, for example `isRegistered: on`.


I 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"


Logging: 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".


`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.


Options are either

1. Specify in the key

  loggingEnabled: false
2. Specify in the value:

  logging: disabled


Logging: ignore/print/file

Don’t use bool at all.


This, along with number formats, could be a good argument for strings being the only primitive type in config languages.


I recently learned about NestedText: https://nestedtext.org/

While it has the YAML-like significant whitespace, it looks nice because it doesn't try to be clever.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: