Hacker News new | ask | show | jobs
by nimmer 1507 days ago
This is the opposite of a footgun. Imagine if DNS was case sensitive and GMAIL.COM belonged to a domain squatter.

Nim prevents that. It's that simple.

1 comments

This is an interesting take, I do see the value. If I was trying to prevent this type of aliasing, I'd have the compiler throw an error if there were two aliased variables names (xyz and XYZ for example), rather than merging them automatically.
Since Nim is statically typed you can't simply create a new variable with the same name as an existing one without errors. You can shadow variables in a deeper scope, but then only the latest version is available. Defining a function xyz and then trying to define another function xyZ is indeed an error.
That's what --styleCheck:error is for.
No. Nim always throws an error if you try to define multiple variables/procs that are conflicting.

--styleCheck:error strictly enforces camel case.