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.
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".
> "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'
The feature is not meant to encourage developers to use "my_cat" and "myCat" randomly within the same file.