• Lil' Bobby Tables@programming.dev
    link
    fedilink
    arrow-up
    28
    arrow-down
    2
    ·
    1 year ago

    When you’re first writing a line of code, you should already be thinking about how you might refactor it in the future, and preparing for that.

    • gaael@lemmy.world
      link
      fedilink
      arrow-up
      6
      ·
      1 year ago

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

    • fusio@lemmy.world
      link
      fedilink
      arrow-up
      5
      ·
      1 year ago

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

      • nous@programming.dev
        link
        fedilink
        English
        arrow-up
        4
        ·
        1 year ago

        I don’t find this helps. More often your assumptions about how something might change are wrong and when the actual change comes in you can end up causing yourself more work undoing the abstractions you made. IMO keep things simple as you can for as long as you can and add in abstractions when they are needed and remove them when they are not. Write code that is easy to change when change is needed, not code that tries to account for all possible future changes as this is impossible to do.