54

Kotlin: I don't have ternary operator, it's bad for readability
Swift: I removed ++ and --, cause they are old fashioned
Dart: *screams*

Comments
  • 5
    Accidentally posted as rant, not as joke, can't change it now, sorry (=
  • 1
    What even-
  • 4
    What the FUCK is that
  • 2
    @PrivateGER Dart ¯\_(ツ)_/¯
  • 10
    That doesn't look terribly awful
  • 3
    I kinda want to learn dart now
  • 3
    Sets index (slash + i incremented) of Routes to (an anonymous function taking in an unused parameter and returning a LevelPage of i) if it is not null
  • 2
    Kotlin has normal if else in place of ternary operator, which is actually more readable.
  • 2
    @kescherRant * just as readable and it certainly doesn't have a normal if/else since a normal if/else wouldn't be expressions lmao
  • 1
    @inaba I meant normal if else as in normal words, but yes that was unclear.
  • 1
    WOOP WOOP WOOP WOOP WOOP WOOP WOOP WOOP WOOP!! *crab walk intensifies*
  • 0
  • 2
    @kescherRant you are saying that

    If(someVal)
    othervar = 12;
    Else
    othervar = 294637;

    Is more readable then
    othervar = someVal ? 12 : 294637;

    ???
  • 1
    @Codex404 Please, for the love of readibility, enclose your ternaries in parenthesies.

    @kescherRant Yes, but much more verbose. I loathe needing to write multiple keywords and/or use semicolons for something that should really be a single line.
  • 1
    I’m a sucker for single liners
  • 2
    If you think this is bad, check out Haskell lol
    Eg.
    @highlight
    instance (Applicative f, Applicative g) => Applicative (Compose f g) where
    pure x = Compose $ (pure . pure) x
    (<*>) (Compose f) <*> (Compose a) = Compose $ ((<*>) <$> f) <*> a

    Edit: ignore mistyped (<*>) behind (Compose f)
  • 0
  • 1
    @inaba @Codex404

    Kotlin if-else can be both statements and expressions.

    You wouldn't write two assignments in both the branches, that's a style violation in Kotlin. IntelliJ even warns you about this and suggests the expression instead. Two examples of if-expressions:

    @highlight

    // Oneliner
    val x = if (condition) y else z

    // Multiline
    val x = if (condition) {
    sideEffectA()
    y
    } else {
    sideEffectB()
    z
    }
  • 0
  • 0
    @eeee single line if statements are the new worst. I always change it to a multi-line one the moment I see one.
  • 0
    @Codex404 you mean expressions? 🧐
  • 0
    @eeee single line id's in general. I love ternaries though
  • 3
    @rostopira if you ever post something in the wrong category, just give @dfox a mention. He'll usually fix it up for you
Add Comment