• Kogasa@programming.dev
    link
    fedilink
    arrow-up
    8
    ·
    11 months ago

    People ITT hating on null coalescing operators need to touch grass. Null coalescing and null conditional (string?.Trim()) are immensely useful and quite readable. One only has to be remotely conscious of edge cases where they can impair readability, which is true of every syntax feature

    • ferralcat@monyet.cc
      link
      fedilink
      arrow-up
      0
      arrow-down
      3
      ·
      11 months ago

      Languages with null in them at all anymore just irk me. It’s 2023. Why are we still giving ourselves footguns.

      • Kogasa@programming.dev
        link
        fedilink
        arrow-up
        1
        ·
        11 months ago

        Because you can turn null into an Option monad with a small amount of syntax sugar and static analysis

          • Feathercrown@lemmy.world
            link
            fedilink
            English
            arrow-up
            1
            ·
            9 months ago

            Oh yeah I forgot, first you have to make a blog post, then a devlog, then review the top 10 best features of JS es6 (9 years after it was released…). Then shitpost on social media network for the other half of the week, and boom! You’re officially a Master Programmer!