by giancarlostoro · 6y ago · 0 comments
There's a few things that concern me, like looking at the tutorial the echo statement is not a function, reminds me of Python before Python 3. Also the pascalCase function for readLine. I think I see why Python mainly uses single word functions for things, to avoid the debate about variable naming conventions as much as possible. Though now the community agrees on underscores mainly. Though this doesn't concern me as much so long as it remains consistent.
echo "Can you hear me?"
is the same as echo("Can you hear me?")
Nim also has somewhat unique rules about casing and underscores for variables and names. `readLine` is the same as `read_line` is the same as `rEadLInE`. However, the first letter must be the same (there are reasons for this), so `Readline` is not the same as all of those. The idea is that you can choose your preference and not have to think about what anyone else chooses. If a library uses pascalCase and your prefer snake_case then you can use snake_case.This is a big point of contention for many people, but in practice, in my experience, it is never an issue.
What might be confusing to you is that in Nim all three following variations are the same
echo("foo")
echo "foo"
"foo".echo
If you're curious about nim, I can highly recommend "Nim in Action".