https://kotlinlang.org logo
Title
k

Kristian Nedrevold

03/07/2023, 9:18 PM
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
r

rtsketo

03/08/2023, 5:56 AM
Ι wish there was a plugin to hide all these brackets when the code is aligned correctly with tabs.
k

Klitos Kyriacou

03/08/2023, 9:20 AM
Just put them all at the right-hand side and size your editor window so that you don't see them:
fun foo(): Unit                                                {
    while (cond)                                               {
        bar().let                                              {
            baz(it)
            println(it)                                        }}
    println("there you are!")                                  }
😈
k

Kristian Nedrevold

03/08/2023, 9:21 AM
Will make sure I do that in my next PR 😄
r

rtsketo

03/08/2023, 9:40 AM
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

Klitos Kyriacou

03/08/2023, 9:48 AM
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

Marius Kotsbak

04/26/2023, 2:36 PM
Use Scala instead then?
k

Kristian Nedrevold

05/08/2023, 8:27 AM
Yeah because we can all just decide what we write at work 🤣
m

Marius Kotsbak

05/08/2023, 9:11 AM
Btw support for that style just came to IntelliJ. Union type support is still just hafway there.
r

rtsketo

05/08/2023, 9:13 AM
Which style? The cursed one?
m

Marius Kotsbak

05/08/2023, 9:21 AM
Curly braces free mode. Cursed? 🙂
r

rtsketo

05/08/2023, 10:10 AM
We were discussing two styles, one free the other one cursed 😝
@Marius Kotsbak could you link me what are you referring to?