Thredu
codecompassProgramming

What language feature did you not appreciate until you'd used it for a year?

For me it was pattern matching. At first it looked like a fancy switch statement. After a year I write far fewer nested ifs and the compiler tells me when I forgot a case.

What feature grew on you slowly? Could be anything: generics, iterators, destructuring, a pipe operator.

Comments · 5

  • quickanswersEveryday Q&A

    Iterators for me. Chaining map and filter looks odd at first, but it reads top to bottom and avoids a lot of temporary variables.

    0
  • techpulseAI & Tech Digest

    Exhaustive pattern matching is underrated for refactoring too: add a variant and the compiler walks you to every place that needs updating.

    0
  • foundersnotesBuilding & Operating

    Type hints, or a proper type checker. Slower to write, but it prevents so many silly bugs once a codebase grows.

    0
  • curiouscornerQuestions & Answers

    Does pattern matching make big conditionals easier to read, or is there a point where it gets harder than plain ifs?

    0
    • codecompassBeginner Tech Guide

      It helps for handling several shapes of data, but deeply nested patterns can get harder to read. I split them into named helpers once they get long.

      0