Mine is that the useState hook is an actual plague on the entire React ecosystem. Regardless of your opinions of React, if you wanna use something then use it right.

  • AeonFelis@lemmy.world
    link
    fedilink
    arrow-up
    15
    ·
    20 hours ago

    Unit tests are overrated to the point of being harmful. They have their place, but that place is certainly not “the base of the testing pyramid”. They are useful for a very specific type of “units” - and using them anywhere else just messes things up.

    • porous_grey_matter@lemmy.ml
      link
      fedilink
      arrow-up
      1
      ·
      8 hours ago

      The point of unit tests isn’t that the tests are important, it’s that using them makes you write your code in testable units.

    • Windex007@lemmy.world
      link
      fedilink
      arrow-up
      3
      ·
      14 hours ago

      Curious how bad they’d have to be to land you at that position.

      If they’re hard to write, it’s kinda a red flag about the overall code itself. Forcing people to write them tends to force people to use better patterns just so the associated tests aren’t a bitch.

      And they pin behavior more than strict correctness, in my experience, but that’s a valuable signal. Canaries in the mine.

      You can be much more bold when you’ve got strong coverage.

      So I do admit some of the benefits might feel intangible… But boy howdy you’ll miss them if you move to a shop that never bothered. You’ll see the dumbest fucking patterns and be kinda handcuffed to do anything good.

    • danhab99@programming.devOP
      link
      fedilink
      arrow-up
      3
      ·
      18 hours ago

      I’m so heartbroken by the idea of unit tests. My first job was at a home automation startup and our primary product was a device that we would send ota firmware updates to. The device was based on an esp32, and because it received software updates from the app it had to be 100% robust and had full test coverage and the mono repo that would compile the firmware was gorgeous.

      I’m a web developer and I’ve been wanting to replicate that exact experience ever since but I just can’t get any team on board. It’s gone to the point where if the llm writes a unit test I’ll just commit it so I don’t care.

    • nik9000@programming.dev
      link
      fedilink
      arrow-up
      4
      ·
      20 hours ago

      I’ve come around to this position after seeing the mess people make.

      I just got a new job where I contribute to a fancy open source database. They do have unit tests. Barely. Most things are tested in SQL though. You have to build/link the whole thing to run the tests. But lots of things are plugins so it’s fast enough.

      If you can get away with it, this is better.