3 ms·
I really like Scala’s `val` vs `var`.
by kaba0 4y ago
I really like Scala’s `val` vs `var`.
- andix 4y agoOkay, that would confuse me. Looks very similar and easy to overlook.
- jlokier 4y agoSyntax highlighting can help with distinctions like that. You might prefer Nim's visually distinct "let" for immutable, "var" for mutable. "const" is also available and means resolved to constant at compile time, similar to Zig's "comptime".
- culi 4y agoit hurts that `let`, `var`, and `const` are all used in JS and mean completely different things. `let` even means the exact opposite
- still_grokking 4y agoActually not, as firstly you almost never use `var`s, and secondly if you do, most syntax highlighting rules will make them shine in bright color as something very exceptional.
- sureglymop 4y agoSame in Kotlin
- still_grokking 4y agoNo surprise though as Kotlin is a cheap Scala rip off.