3 ms·
> Significant indentation and optional braces And this is why it's annoying to use Scala. They just decided to rewrite the syntax of the language
by philipwhiuk 4y ago
> Significant indentation and optional braces
And this is why it's annoying to use Scala. They just decided to rewrite the syntax of the language
- tasuki 4y agoIn Scala, eg 2.13 is a major version. Scala 3 is like a super-major version and still it's backwards compatible with 2.13: the new syntax is fully optional. Which languages don't make any changes to syntax over major versions?
- spiderice 4y agoI'm not against syntax changes, but significant indentation seems like an insane choice to make. That's been a thorn in the side of Python for decades. Even if some people do like the look of it, it doesn't seem worth the tradeoffs.
- civopsec 4y agoIt’s not a problem for Haskell and Scala is closer to Haskell.
- tasuki 4y agoI like significant indentation. If you lose indentation, I want your code to break. It's a feature not a bug! I'm not a big fan of Python, but significant indentation certainly doesn't seem to have hurt its adoption much...
- Myrmornis 4y agoI believe that significant indentation is only a problem for people whose text editor Tab binding doesn't handle it for them? At least, I've used Python for 15 years and can't think of a problem it's caused me -- what problems are you aware of? It's similar to the people who complain about lisp but are pairing up parens manually. I think the solution in both cases is "don't do that" -- there are perfectly good text editors that do these things for you.
- lern_too_spel 4y agoCopying and pasting code after a conditional block.
- antifa 4y agoI like significant indentation, it stops your coworkers from making up "new innovations" in how many spaces belong in a tab.
- spiderice 4y agoI've always just added a git hook that runs the auto-formatter before they commit when I've coded on teams. Much more "strict" than even python is when it comes to coding standards.
- hocuspocus 4y agoLike many seasoned Scala developers I was skeptical at first but it's actually pretty enjoyable despite a few inconsistencies. Jumping between Scala 2 and 3 codebases isn't much of a problem. Granted, it makes the life of people working on tooling significantly more complicated but I'm not one of them. The decision was directly motivated by Odersky's experience teaching Scala to students for 15+ years, it wasn't made for the sake of fueling drama in the community.