3 ms·
Nothing unusual in doing e.g. `array = Array()` (although you should probably give your variables better names than that), which would break in Nim.
by bobbylarrybobby 7y ago
Nothing unusual in doing e.g. `array = Array()` (although you should probably give your variables better names than that), which would break in Nim.
- CodeMage 7y agoAnother perfectly fine example: auto * logger = Logger::getLogger("main");
- narimiran 7y ago...which also works perfectly fine in Nim.
- ac29 7y agoRight, and that's the point, aside from the fact those 2 are actually different in nim. I see what you are doing there, but that would have been very confusing when I started programming. Question is, should the language enforce you giving your variables a better name, or should convention? I think there are reasonable arguments for both.
- alpaca128 7y agoBut does a language with Python-like syntax really have to try to be so "beginner-friendly" that it enables inconsistent casing? The language itself can't enforce better variable names, at least not this way - Nim doesn't stop me from using "abcd" or "a0, a1, ... a100" as variable names even though it's usually a very bad idea. No, I think a language should help keeping the code consistent in the long term - and having this strange case insensitivity doesn't help there in my opinion.
- nimmer 7y ago> I think a language should help keeping the code consistent in the long term - and having this strange case insensitivity doesn't help there in my opinion. Not at all. Style insensitivity encourages good variable naming and there are both formatters and also the simple text completion in editors to guarantee consistency.
- narimiran 7y ago> `array = Array()` ...which would break in Nim. This is NOT true. The first character is case-sensitive in Nim, so examples like yours are not only possible, but frequently used even in Nim compiler and standard library.