r/nim • • Aug 10 '20

Complete Case sensitivity

Hello everyone in the Nim community. I do not want to talk a whole lot but get straight to the point. Why Nim is not a complete case-sensitive language. This is a major issue for which I hate Nim as well as the double underscore issue. I have been programming for a decade now and in my opinion, it is a good idea to have case-sensitivity. I know the Nim compiler does has partial case-sensativity but why don't just make it complete case-sensitive. I mean all popular languages like Python, C, C++, Rust, Go, Java, Javascript, all of them are case sensitive. Why is Nim not like so. I think programmers should be the one to do the hard work, not the compilers. Let the computers and compilers be dumb machines.

So all in all, I want to have Nim to be complete case-sensitive and the weird double underscore issue

0 Upvotes

13 comments sorted by

8

u/rahshingan Aug 10 '20

What is the difference between "howMany" and "howmany"?

If the answer of "howMany" returns "five", while "howmany" returns 5, I'll hate you the same as you hate case-insensitivity ;)

-1

u/arijit079 Aug 10 '20

Why do you follow the rules of English grammer. Since saying

nim is great

Is same as saying

Nim is great.

With just case difference and a full stop

8

u/SonOfMrSpock Aug 10 '20

Then again, why dont you follow Nim's grammar ? Why do you insist writing C/C++ in Nim ?

3

u/MegaIng Aug 10 '20

What benefit does it have?

-1

u/arijit079 Aug 10 '20 edited Aug 10 '20

The number of varaibles with (almost) the same name increases. I think it reduces the confusion when one is writing a library. I mean let's say I wrote myFunc and someome uses the library and writes myfunc. Now some other developer comes in and sees the implementation and I know what he will speak "What the hell! The original library says myFunc but here it says myfunc." In my thoughts it just increases confusion

10

u/PMunch Aug 10 '20

This is a moot point if the developers actually know Nim. I've been using Nim now for quite a while and while I wasn't initially super stoked about this feature either I'm now a huge fan. IMO the benefit of being able to keep your own code in the same casing style regardless of which style the library author preferred is just so nice. No more weird mish-mash of casing styles! And I don't have to remember things like if it is parseHTML or parseHtml as I can use whichever I prefer.

EDIT: And if you have identifiers that only differ by casing you should rethink your naming scheme..

2

u/SonOfMrSpock Aug 10 '20

AFAIR, Nim started as completely case insensitive and IMO, that was ideal but using it with your favorite languages were more difficult. Thats why now it is partially case sensitive .

If this "major issue" is enough for you to hate Nim, I think Nim is not for you.

Still, Nim has MIT license and it's compiler code is very comprehensible. You may make your own fully case-sensitive Nim version or you may just move on.

1

u/arijit079 Aug 10 '20

I can't say a major issue but a nitpick since as I have used so many languages, I think it does at least help me in not learning a new style where case dosen't matter

1

u/SonOfMrSpock Aug 10 '20

This is a major issue for which I hate Nim

The thing is, you dont need to learn a new style. You're rejecting Nim on a whim. Have you read PMunch's reply ?

7

u/reesmichael1 Aug 10 '20

Whenever this discussion comes up, I find myself wondering: why? More specifically, what are the problematic situations that case insensitivity allows that case sensitivity would prohibit?

The only thing I can think of is that, if you're working in a team, case insensitivity means you'll likely want to enforce a naming style. But you should probably be doing that in case sensitive languages too.

If you're working by yourself, then you don't have to worry about case insensitivity--just don't use it. Use a consistent naming scheme (which you should be doing in any language anyway) and you can forget that case insensitivity exists.

But then if you want to use someone else's library and its author is using a different naming scheme, you can keep using the author's style and have a mix of styles, or you can replace the author's style with your own. Case insensitivity gives you the option to avoid mixing styles, if that's what appeals to you.

3

u/dom96 Aug 10 '20

Now that Nim 1.0 is out this simply won't happen. Maybe you can convince Araq to do it for 2.0, but I doubt it.

What might work is if you use the language and show us an instance where case insensitivity causes you trouble. Until you do, you are just giving theoretical problems.

I think programmers should be the one to do the hard work, not the compilers.

hmm. Not sure I agree here. :)

2

u/holgerschurig Aug 11 '20

Why Nim is not a complete case-sensitive language

So that types and variables can be differentiated?

let foo = Foo

In completely type-insensitive languages with typed (e.g. good old Turbo-Pascal, Delphi and FreePascal) one would have to add letters to the type:

var foo : TFoo;

1

u/thothamon Aug 11 '20

I think programmers should be the one to do the hard work, not the compilers. Let the computers and compilers be dumb machines.

If that is really what you think, why aren't you coding in assembly language? That would give you a lot of hard work to do and it would totally let the computer and compiler be a dumb machine.