3 ms·
Are you serious?
by gemstones 3y ago
Are you serious?
- dsrw 3y agoYes. It’s so you can maintain a consistent style in your code base even if your dependencies use different styles. Nim has excellent C/C++ interop and it’s relatively common to interact with C or C++ symbols directly, and being able to do this without needing to adopt the dependency’s style or wrap everything is nice. In python, for historical reasons the logging module uses camelCase while most other modules use snake_case, so it isn’t really possible to use the logging module and maintain a consistent style. This is a non-issue in Nim.
- j-james 3y agoThe downsides of this approach are unfortunately that it makes wrapping certain low-level libraries an absolute pain in the ass (especially anything to do with keyboards). But overall it's a non-issue, tooling recognizes both styles and you don't notice it.
- elcritch 3y agoNim 2.0 changed the default to treating style mismatches as warnings. E.g. it's something to check but not an error. You can easily set a config to make them an error or ignore them.
- yeck 3y agoCool, that definitely sounds like a welcome improvement.