News for hackers. Stuff that matters.
Re:Nim Programming Language 0.11.0 released by krupan on Thursday April 30, 2015 @12:13PM (#9465969)
Looks like it's still there in the manual:

http://nim-lang.org/0.11.0/manual.html#lexical-analysis-iden...

This just killed my excitement for this language. That's really surprising to me that they would choose to enforce indentation Python-style, but would then allow this kind ambiguity in naming.

grep and emacs isearch-forward are such great tools for quick code searching and this will break them. I guess text search (and replace) tools could grow nim-mode options, maybe. I don't know, can someone convince me this is a good idea?

Re:Nim Programming Language 0.11.0 released by bryanlarsen on Thursday April 30, 2015 @01:03PM (#9466255)
Suppose you have MyVariable and my_variable in your code. Which is worse: them being the same variable or different variables? It's a pretty bad code smell either way.

In my opinion it should be an error or at least a warning.

I'm not a big fan of nim's behaviour, but I don't think it's any worse than what other languages do.

Re:Nim Programming Language 0.11.0 released by krupan on Thursday April 30, 2015 @03:02PM (#9466973)
"Which is worse: them being the same variable or different variables?"

Them being the same is worse. I agree that both are pretty darn bad, but it's also pretty clear to me which is worse.

Re:Nim Programming Language 0.11.0 released by dragonwriter on Thursday April 30, 2015 @05:47PM (#9467871)
> Suppose you have MyVariable and my_variable in your code. Which is worse: them being the same variable or different variables?

Having them be the same, by far.

Having names with certain similarity be prohibited in the same scope is a bit excessively controlling but sensible. Allowing them but treating them as equivalent is just plain bad. If I named them differently then either: (1) I made a mistake, or (2) I intended them to be different.

Re:Nim Programming Language 0.11.0 released by wtetzner on Thursday April 30, 2015 @02:42PM (#9466862)
Yeah, I think it would make more sense to treat them as the same, but throw an error if they are spelled differently.
Re:Nim Programming Language 0.11.0 released by tomp on Thursday April 30, 2015 @05:34PM (#9467807)
> Suppose you have MyVariable and my_variable in your code. Which is worse: them being the same variable or different variables?

That's the same as saying "`a` and `A` should be the same variable", i.e. complete case insensitivity.

> It's a pretty bad code smell either way.

Very much so. We shouldn't encourage it.

Re:Nim Programming Language 0.11.0 released by reddit_clone on Thursday April 30, 2015 @09:53PM (#9468922)
Huh? This is terrible.

I use same names with different styles to denote scope. I will be hosed then.

Re:Nim Programming Language 0.11.0 released by jwecker on Thursday April 30, 2015 @01:43PM (#9466503)
This is my least favorite "feature" of Nim as well and almost killed my interest in it. But it hasn't come up in practice yet for me.
Re:Nim Programming Language 0.11.0 released by gtaylor on Thursday April 30, 2015 @12:44PM (#9466162)
> I don't know, can someone convince me this is a good idea?

That would be a pretty hard sell. Any convenience argument falls flat to me.

Re:Nim Programming Language 0.11.0 released by Dewie3 on Thursday April 30, 2015 @02:28PM (#9466778)
> grep and emacs isearch-forward are such great tools for quick code searching and this will break them.

If you're using Emacs to begin with... well there is little reason to complain about the default behaviour of functions and keybindings.

Re:Nim Programming Language 0.11.0 released by krupan on Thursday April 30, 2015 @02:53PM (#9466918)
Sure, but I don't use emacs exclusively (as often as that joke is leveled at emacs users, nobody really does that).
Re:Nim Programming Language 0.11.0 released by beeworker on Thursday April 30, 2015 @03:00PM (#9466959)
You must not use grep with regexes very often.
Re:Nim Programming Language 0.11.0 released by krupan on Thursday April 30, 2015 @03:12PM (#9467021)
Are you serious? Quick, write me a grep regexp that will catch all equivalently valid forms of a nim_Identifier (or nimidentifier or nImID_entif_iEr, but not NimIdentifier).
Re:Nim Programming Language 0.11.0 released by beeworker on Thursday April 30, 2015 @04:13PM (#9467362)
Not really, sorry. I had forgotten that the first letter is compared case sensitively as I remembered from Nimrod it was all insensitive. But I still think for nearly all cases in real world code you can instead of using nimgrep be equally served by a case insensitive search on (nimidentifier|nim_identifier) even if it's technically possible to have other variants or a mismatch, which you can grep out as a second step anyway, with the capital N.