Just checked out Nim, lots of things and design decision that I like about the language.
But I noticed that there are some inconsistencies with how things are named, example: function names tolower vs toSeq or types string vs Natural - really weird. Why in some cases they start with capital letter and in another not and also sometimes they camel cased and sometimes flat?
It is written toLower, see https://nim-lang.org/docs/theindex.html#toLower
The type names all follow capitalization except for the really common one we found to annoying to type this way. They also predate our style guide, https://nim-lang.org/docs/nep1.html
Thanks, I saw tolower in some nim word count demo, maybe it was outdated.
Can you please also explain about the types, is there any convention to its naming string vs Natural - why one is lowercased and another is not?
@alexeypetrushin tolower would work too as Nim is case sensitive only with the starting letter. So using either toLower or tolower would work. But ToLower would be different.
Though, it's suggested to follow lower camelcase in general.
Human beings write code.
YMMV, but most devs I know read a lot more code than they write - their own and others' - optimizing for human reading seems like a reasonable priority then, if you're trying to save time.. it compounds too - if a dev is able to read somebody else's code, they might not have to write any code at all :)
Let me question Java/Go/Nim readability... What is more readable?
addConstraint(x.plus(y).lessThanOrEqual(x.times(newConst(5).plus(z))
or
addConstraint(x + t <= x * (5 + z))
I would say, if you want to write readable code nim gives you means to do so. If you want to write unreadable code, no language shall prevent you from doing that.