• @[email protected]
    link
    fedilink
    222 years ago

    TDD is overrated. Code coverage is extremely overrated. Both of these tend to lead to a morass of tests that prove the compiler works at its most basic level while simultaneously generating a surplus of smugness about the whole situation.

    Tests have their place. Tests can be, and often are, valuable. But the easier the test is to write, the easier it would’ve been to just encode it into the type system to begin with.

    • @[email protected]
      link
      fedilink
      32 years ago

      I also think a lot about how I might extend whatever I’m implementing. It’s helped me to make classes more generic and keep things laser-focused so that blocks/methods/classes are reusable.

      Nothing grinds my gears like seeing the same block all over a codebase especially if each are just slightly different (time to subclass).

    • fusio
      link
      fedilink
      52 years ago

      and how you could test it easily! it’s incredible how much it helps for cleaner architectures

    • @[email protected]
      link
      fedilink
      62 years ago

      Except if your adhd includes the perfectionist trait, because then you will never get to write the next line of code.

  • ennemi [he/him]
    link
    fedilink
    English
    152 years ago

    DRY means Do Repeat Yourself, when the alternative is cooking up some awful OOP abstraction

  • Rikudou_Sage
    link
    fedilink
    122 years ago

    Modern PHP is great and people judging it by PHP 5 (version that’s almost 20 years old) are idiots.

  • Xylight (Photon dev)
    link
    fedilink
    English
    342 years ago

    Make your app use native components instead of making your own crappy theme for the 782th time

  • @[email protected]
    cake
    link
    fedilink
    142 years ago

    If your function is longer than 10 statements, parts can almost always be extracted into smaller parts. If named correctly, this improves readability significantly

  • TerrorBite :veripawed3:
    link
    fedilink
    82 years ago

    If your code files don’t contain more lines of comments than lines of actual code, then you’re doing it wrong. (For Python, docstrings count as comments)

    And your comments shouldn’t say what each line of code is doing. If you can code, then you can already tell what each line is doing by just reading the code. The comments should explain WHY it’s being done this way, or HOW it’s being done, or highlight some pitfalls that might snare a future developer, and generally just give some higher level context to a line or block of code.

    @257m @programming

  • @[email protected]
    link
    fedilink
    13 months ago

    Don’t be afraid to drop a tool although you’ve spent years mastering it if there is something new that is much more efficient. Some day you have to switch anyway.

  • Throwaway
    link
    fedilink
    102 years ago

    Front end and back end are different enough that you can really specialize in one or the other. They take very different mindsets. I know how to make css obey, I don’t know how to make sql performant. Its possible to have both, but not as well.

    For every front-end dev, you need 3 back-end guys and a designer.

    Programmers are not bad at our jobs, its just not a mature disclipline yet.

    • @[email protected]
      link
      fedilink
      32 years ago

      I don’t agree and I don’t disagree, but I thinkcontext matters a lot here. Some teams and codebases need deep knowledge, some don’t. Some nned sql performance, some don’t. Your conclusion is only true some of the time

    • AggressivelyPassive
      link
      fedilink
      72 years ago

      It’s not mature, because nobody let it mature.

      Programming is over 70 years old, that’s not a new discipline. Yet, the engineering in our industry is still abysmal. Countless reinvented wheels, nothing is ever finished, changes happen often enough for the sake of change, not progress.

      • @[email protected]
        link
        fedilink
        32 years ago

        That’s part of the nature of programming. Half-finished might be good enough. If you’ve made an awesome wheel but I need a kink in one of my spokes and yours doesn’t do that, making my own wheel might be cheaper than modding yours.

        OTOH, there’s nothing more frustrating than looking for a particular wheel, finding ten really great ones that collectively have the features you need, but individually aren’t good enough.

        • AggressivelyPassive
          link
          fedilink
          22 years ago

          To stay in the analogy: usually we just want to transport things from a to b. It doesn’t matter, how we get there. So usually we begin with a road and start to cobble together a vehicle from barely fitting and functioning junk we find on the roadside.

          There’s hardly any stable surface to work on. And that’s extremely costly.

  • @[email protected]
    link
    fedilink
    English
    22 years ago

    Pure text is probably not the best way to write code, even if it is the most interoperable format