by pa7x1 · 3y ago · 0 comments
If you enforce a code style or, if you don't but you would convene that someFunction and some_function should mean the same thing in your codebase. Then nim's approach should be transparent to you.
I suspect, in practice, almost everyone follows the sane approach of enforcing a code style in your codebase. I think what usually gets lost when this is brought up is that the point of this code style insensitivity is not to encourage you go to crazy and mix and match it in your projects. It's so external dependencies don't have to infect your codebase. So you can actually apply a consistent code style within your project.
test.nim(2, 8) Hint: 'myvar' should be: 'myVar' [var declared in test.nim(1, 7)] [Name]
edit --styleCheck:error perhaps?
Such a mistakes is easy for a linter to pick up on so that the code would never be merged in the first place.
So don't bring up nimgrep like it's a necessity when it's more of a last resort tool nowadays. You will be just attracting flaming.
- hand tvättas (wash your hands) != handtvättas (wash by hand)
- sjuk gymnast (sick gymnast) != sjukgymnast (physical therapist)
- sjuk sköterska (sick nurse) != sjuksköterska (hospital nurse)
- lång hårig (tall and hairy) != långhårig (long-haired)
- sjö nära tomt (lake near a house) != sjönära tomt (house near a lake)
Here's one illustration: https://github.com/nim-lang/RFCs/issues/456#issuecomment-111...
We have partial case-insensitivity in PHP. Can't say I'm very fond of it, but I'm ambivalent as long as it's not abused.
And "C names are usually very cryptic" is plain false, unless you talk about APIs coming from the ages and compilers where all identifiers had to be 8 characters or fewer in length.
This is literally idiomatic Python style! Classes are TitleCase and everything else is snake_case.
I have also used a mix of camelCase and snake_case for different purposes, eg in Haskell where conventions are mixed (and I am far from an expert), I've written names like "fooBar_prev"
And Nim does distinguish between those.
> I've written names like "fooBar_prev"
That's disgusting.