I have been writing a lot of Scala 3 recently and ...
# functional
k
I have been writing a lot of Scala 3 recently and it really has made me wish Kotlin had a bit less brackets! Kotlin feels so noisy now. Especially when writing in a functional style
😮 3
r
Ι wish there was a plugin to hide all these brackets when the code is aligned correctly with tabs.
k
Just put them all at the right-hand side and size your editor window so that you don't see them:
Copy code
fun foo(): Unit                                                {
    while (cond)                                               {
        bar().let                                              {
            baz(it)
            println(it)                                        }}
    println("there you are!")                                  }
😈
😂 1
k
Will make sure I do that in my next PR 😄
r
I know about it, @Klitos Kyriacou; the cursed formatting 😛 But I'd like something that won't affect other developers. It's been a dream of mine, a plugin that will make the brackets the same color as the background (if the indetation is correct) and display them only on mouse over. Perhaps one day I'll find the time to develop it. It has always perplexed me why Kotlin chose to make semicolons optional but not brackets, which are indeed also optional when using tabs correctly.
k
Python-style block scoping by indentation is not everyone's favourite (although I'm fine with it). In particular, the makers of Kotlin wanted to bring Java programmers to this language and using semantic indentation may have been a step too far for those who have got used to using curly braces for years. Scala is already different enough from Java that it attracts those who are open-minded enough to want to try something new.
m
Use Scala instead then?
k
Yeah because we can all just decide what we write at work 🤣
m
Btw support for that style just came to IntelliJ. Union type support is still just hafway there.
r
Which style? The cursed one?
m
Curly braces free mode. Cursed? 🙂
r
We were discussing two styles, one free the other one cursed 😝
@Marius Kotsbak could you link me what are you referring to?