News for hackers. Stuff that matters.
Re:Nim Programming Language 0.11.0 released by aikah on Thursday April 30, 2015 @12:20PM (#9466023)
This feature makes very little sense to me. What's the justification for this?
Re:Nim Programming Language 0.11.0 released by progman on Thursday April 30, 2015 @12:33PM (#9466104)
Developer convenience. Some people like Hungarian notation, some like underscores. I consider it quite convenient as well. Probably there is a need for a tool for source code normalization so that everyone can choose his favorite notation in the whole Nim ecosystem.
Re:Nim Programming Language 0.11.0 released by duaneb on Thursday April 30, 2015 @12:56PM (#9466230)
I wouldn't consider the loss of identifier recognition a "convenience". This would be a major concern for my adopting the language.

You also have to read others' code, as well...

Re:Nim Programming Language 0.11.0 released by rbehrends on Thursday April 30, 2015 @04:16PM (#9467386)
Re:Nim Programming Language 0.11.0 released by iopq on Thursday April 30, 2015 @05:17PM (#9467713)
This doesn't make any sense. When I make a mistake in case, Rust just doesn't let me compile.
Re:Nim Programming Language 0.11.0 released by rbehrends on Thursday April 30, 2015 @05:36PM (#9467817)
You get this problem when you have two identifiers (variables, functions, constants, etc.) that differ only in case and have the same type signature. Depending on whether you use one or the other form, you may get completely different behavior.
Re:Nim Programming Language 0.11.0 released by iopq on Thursday April 30, 2015 @05:42PM (#9467846)
The convention is that upper case is types, lower case is variables. So you'd have to try hard to make that mistake.
Re:Nim Programming Language 0.11.0 released by rbehrends on Thursday April 30, 2015 @06:10PM (#9467972)
That has nothing to do with types vs. variables.

Try having a variable signon and a variable signOn. Or two functions with the same type signature, one called signon() and one signOn() (for example, imported from two different modules).

Re:Nim Programming Language 0.11.0 released by kibwen on Thursday April 30, 2015 @08:14PM (#9468498)
By default, the Rust compiler warns you when you use uppercase characters in variable and function identifiers. The community overwhelmingly adheres to this style. Rust is also extremely strongly-typed, so not only would you have to be willfully disabling the style warnings, you would have to have to manage to give them the same types, and furthermore given the nature of Rust code it's rather possible that you'll still get a compilation error due to using a variable in a way that it didn't expect. You also can't "accidentally" introduce new variables in Rust, as you can in Python via typos.
Re:Nim Programming Language 0.11.0 released by rbehrends on Thursday April 30, 2015 @09:48PM (#9468899)
Yes, enforcing case strictly via style guidelines that prevent mixing of upper- and lowercase is another way of avoiding that problem (underscores can still trip you up in a similar fashion, of course, e.g. signon vs. sign_on). I'm still not sure how the discussion got sidetracked into discussing Rust, though.
Re:Nim Programming Language 0.11.0 released by Dewie3 on Friday May 01, 2015 @04:16AM (#9470104)
> I'm still not sure how the discussion got sidetracked into discussing Rust, though.

Yes, let's generalize - reading the blog and the comments, this "case sensitivity ruins productivity"-problem seems to only be a problem in scripting languages.

Re:Nim Programming Language 0.11.0 released by iopq on Thursday April 30, 2015 @08:25PM (#9468563)
You'd have to declare both of them in the current module. That's why I don't do glob imports.

I would see

    use foo::signon;
    use bar::signOn;
clearly, if I have to import this in my own file I should be VERY careful about those two functions

or rather, I'd import from foo, but I'd use the namespaced version from bar

so `signon` would be `foo::signon`, but `bar::signOn` would be written out fully to avoid this kind of clash

Re:Nim Programming Language 0.11.0 released by rbehrends on Thursday April 30, 2015 @09:44PM (#9468886)
I'm really not sure what the point of referencing Rust is. This was about programming languages in general, and the post I was referring to was about C#. Also, importing is an example, another example would be accidentally declaring a second variable in the same module (should not happen, but people make errors), or a number of other situations where two identifiers that are identical except for case end up in the same scope.
Re:Nim Programming Language 0.11.0 released by iopq on Saturday May 02, 2015 @09:32PM (#9479393)
I'm referencing Rust because I'm working on a Rust project right now. I don't even know C#.

Here's how you declare a binding:

    let signOn;
    let signon;
I seriously hope you don't declare both of these in the same scope
Re:Nim Programming Language 0.11.0 released by federico3 on Thursday April 30, 2015 @02:22PM (#9466736)
Safety! Having "my_cat" and "myCat" as different variables in the same space sometimes ends up with using the wrong variable, especially when using tab completion.

The feature is not meant to encourage developers to use "my_cat" and "myCat" randomly within the same file.

Re:Nim Programming Language 0.11.0 released by dragonwriter on Thursday April 30, 2015 @06:21PM (#9468020)
Safety might prohibit different identifiers with a certain degree of similarity, but it wouldn't treat different-but-similar identifiers as if they were the same.

Treating them as the same creates more danger -- the danger that the programmer intended them to be different, but the language treated them the same -- rather than mitigating danger.

Re:Nim Programming Language 0.11.0 released by krupan on Thursday April 30, 2015 @02:56PM (#9466931)
"The feature is not meant to encourage developers to use 'my_cat' and 'myCat' randomly within the same file."

I'm sure it's not, but it isn't doing a thing to discourage that. We stopped using case insensitive file systems a long time ago, didn't we?

Re:Nim Programming Language 0.11.0 released by federico3 on Thursday April 30, 2015 @03:49PM (#9467234)
...actually we didn't.
Re:Nim Programming Language 0.11.0 released by dragonwriter on Thursday April 30, 2015 @06:19PM (#9468012)
> We stopped using case insensitive file systems a long time ago, didn't we?

Windows didn't.

But even Windows doesn't use an underscore-insensitive file system.

Re:Nim Programming Language 0.11.0 released by msie on Thursday April 30, 2015 @02:39PM (#9466844)
I don't like the idea of a language encouraging sloppy coding.
Re:Nim Programming Language 0.11.0 released by federico3 on Thursday April 30, 2015 @03:42PM (#9467191)
This is not different than having foo_bar and foo_Bar as two different variables.
Re:Nim Programming Language 0.11.0 released by dragonwriter on Thursday April 30, 2015 @06:23PM (#9468027)
Well, yes, it is.

And its worse, especially when the variables aren't "foo_bar" and "foo_Bar", but, say, "cycle_often" and "cycle_of_ten".

Re:Nim Programming Language 0.11.0 released by progman on Friday May 01, 2015 @02:47AM (#9469881)
> "cycle_often" and "cycle_of_ten".

Such an error is caught by the compiler.

  const cycle_often = 10
  var cycle_of_ten : float

  ambig.nim:2:5: Error: redefinition of 'cycle_of_ten'
Re:Nim Programming Language 0.11.0 released by dkersten on Thursday April 30, 2015 @03:06PM (#9466991)
I'd rather have them be different identifiers but with a compiler warning if they're found in the same file.
Re:Nim Programming Language 0.11.0 released by rat87 on Friday May 01, 2015 @01:40AM (#9469701)
Sometimes the best name for a variable is a variation of the associated class/function name.