News for hackers. Stuff that matters.
Re:Nim: Scripting Ease in a Compiled Language by bobbylarrybobby on Tuesday October 29, 2019 @11:06PM (#21394338)
Nothing unusual in doing e.g. `array = Array()` (although you should probably give your variables better names than that), which would break in Nim.
Re:Nim: Scripting Ease in a Compiled Language by narimiran on Wednesday October 30, 2019 @02:43AM (#21395161)
> `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.

Re:Nim: Scripting Ease in a Compiled Language by ac29 on Wednesday October 30, 2019 @12:26AM (#21394697)
Right, 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.

Re:Nim: Scripting Ease in a Compiled Language by alpaca128 on Wednesday October 30, 2019 @02:03AM (#21395033)
But 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.

Re:Nim: Scripting Ease in a Compiled Language by nimmer on Wednesday October 30, 2019 @03:51PM (#21401796)
> 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.

Re:Nim: Scripting Ease in a Compiled Language by CodeMage on Tuesday October 29, 2019 @11:21PM (#21394414)
Another perfectly fine example:

  auto * logger = Logger::getLogger("main");
Re:Nim: Scripting Ease in a Compiled Language by narimiran on Wednesday October 30, 2019 @02:43AM (#21395162)
...which also works perfectly fine in Nim.