7 ms·
The killer feature of Nim is its amazing syntax. If you know Python, Nim will instantly feel very, very familiar. Rust looks incredibly useful to do systems l
by Fede_V 12y ago
The killer feature of Nim is its amazing syntax. If you know Python, Nim will instantly feel very, very familiar.
Rust looks incredibly useful to do systems level programming, and guaranteed pointer safety without GC costs is amazing, but it takes me much longer to figure out exactly what's happening in the code.
- guelo 12y agoRight. Before I even read the article my thought was "Nim better be easier or what's the point of the GC".
- Tharkun 12y agoSurely what is or isn't amazing syntax depends entirely on your preferences and personal experiences. I can't stand the Python syntax. Significant whitespace is an instant turnoff for me. For me, figuring out Rust is a lot easier than figuring out Nim, because that's what I'm used to.
- Ygg2 12y agoI second this notion. Thing I hate about Python is that it relies on invisible characters so two identically looking pieces of code aren't.
- Demiurge 12y agoThis is something I thought before I actually used python. In practice, two identically looking pieces of code ARE. Yes, you can mix tabs and spaces, but not in the same block. The moment there is ambiguity the interpreter errors out. So, in practice this is never a problem, your text editor should not be switching on you randomly and the official style guide strongly asks you to use 4space tabs. Simply follow the official guidelines and be able to configure your text editor, and you will never think about this again if you're actually using python.
- Ygg2 12y ago> Yes, you can mix tabs and spaces, but not in the same block. Assuming of course all code contributors memorized the official style guidelines. And that they are responsive to such changes. I've had one similar change, reverted three times during my uni project, within span of days.
- andybak 12y agoI have never found significant whitespace to be a significant problem in practice. Very few people use tabs. 4 spaces is the norm. I just don't get the fuss surrounding this issue. It just works and the benefits far outweigh any cost - real or imagined.
- oldmanjay 12y agoThe so-called benefits always boil down to "this suits my preferences" which is frankly not a compelling argument in any way. Edit: autocorrect ran rampant
- andybak 12y ago> The so-called benefits always boil down to "this suits my preferences" The of significant white-space are: 1. Reduction of visual noise and improved readability. I find this uncontroversial. Your eye parses code by indentation, not by curly-braces. I could remove the curlies from javasscript and if the indentation was correct, you'd be able to follow it. 2. Reduction of cognitive load. Instead of giving me two jobs to do: indent correctly and match braces - Python only gives me one of those jobs. These are real benefits that I experience whenever I work with Python. There are also genuine costs* but I find the balance to be very much in favour of significant whitespace . * restrictions on possible choices of syntax being the only one I think actually affects me in anything other than a theoretical sense.
- Ygg2 12y agoEh, most languages and tools nowadays reduce the risk of indenting incorrectly or not matching braces to near zero, so in practice there is little cognitive load either way. Only serious cognitive load for me writing code is whether to add new line at 80 or less chars. That's about it.