Fair warning... this is a question involving opinions about whitespace. How should I start writing an type-parameterized extension method in Scala 3?
Yeah, there does seem to be consensus, though I can't think of any other keywords that are written adjacent to parentheses without whitespace in between, so I'm a bit surprised it's so accepted. (However, I commonly did this with `if` and `for` when other people didn't.)
-
-
I kind of visualize it like I would for (in other languages) "array access+function application", so I don't expect any space after a bracket
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
Because usually other keywords for definitions are followed by an identifier. It feels weird to have the dangling type parameter with spaces around it.
-
Yes, I agree that's *more* weird!
- Show replies
New conversation -
-
-
For if and for we have new syntax without parentheses

-
Exactly! Less choice, less time wasted trying to decide which is objectively better...
End of conversation
New conversation -
-
-
I didn't read it properly so I picked #3 instead of #1. (Though we're talking about method definition here). I vote for a re-vote!
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.