3 ms·
I also don't see the issue with it. You can have a uniform style in your project, regardless of dependencies you use. And what's the flipside? People want to us
by kungtotte 8y ago
I also don't see the issue with it. You can have a uniform style in your project, regardless of dependencies you use. And what's the flipside? People want to use more than one identifier named the same thing only with different case?
Is that really desirable? I posit that if you have a codebase that breaks if fooBar and foobar refer to the same variable, it's already broken!
- jjnoakes 8y agoThe flip side is one has to use a Nim-specific search tool to find occurrences of an identifier.
- dom96 8y agoIn practice you really don't. As kungtotte alluded to, no one is going to be mixing coding conventions inside a single code base. As soon as you see the first identifier is camelCase you can safely assume that the rest of them are also camelCase, and therefore search using camelCase.
- beagle3 8y agoI'd say that's only mostly true - if you had a typo, and wrote "camelcase" instead of "camelCase" in just one place out of a hundred, you might not notice it, but it will compile, and not match a grep (though it will match nimgrep). This case could be solved by "grep -i" or equivalent, but not the camelcase vs. camel_case case. This is not criticism; I prefer Nim's mostly-case-and-underscore-insensitive approach, but I think this is a pitfall that should be acknowledged and taken into account (which is quite easy to do given the included nimgrep). Perhaps it makes sense to have an optional warning in case a name is inconsistently spelled inside the same compilation unit.
- nimmer 8y ago> if you had a typo, and wrote "camelcase" instead of "camelCase" in just one place out of a hundred There are already formatter tools that check for that. Also, any editor with completion will suggest the right form every time preventing the bug.