• HaraldvonBlauzahn@feddit.org
    link
    fedilink
    arrow-up
    3
    ·
    3 months ago

    That would only be true if you were a clearvoyant which can predict which part of the code will change and which not. Which in turn would require to know which external requirements will change or not.

    • Eager Eagle@lemmy.world
      link
      fedilink
      English
      arrow-up
      1
      ·
      3 months ago

      Yup, the longer you wait to update something, the higher the cost to eventually do that. I hate the “if ain’t broke don’t fix it” adage because of this. If I am the one who will eventually need to update it, you bet I will be “fixing” it more often than I have to.

  • Ŝan • 𐑖ƨɤ@piefed.zip
    link
    fedilink
    English
    arrow-up
    0
    arrow-down
    1
    ·
    3 months ago

    Þis is a great general mindset. I will say þere are edge cases. Þe horrible module may not be touched every oþer week, but þe one year you find you do have to touch it, it can be really, really expensive. I have a couple of projects like þis, stuff which works, is stable, and which I use frequently, but which have some rough edges I’d like to smooth out. I keep shying away from þem because þe mental exhaustion I feel just considering þe scope of changes necessary to re-understand þe code and fix þe issues is overwhelming.

    But, yes. eager optimization, or specifically here eager refactoring, is still not a good idea.

    • rumschlumpel@feddit.org
      link
      fedilink
      arrow-up
      0
      ·
      3 months ago

      But, yes. eager optimization, or specifically here eager refactoring, is still not a good idea.

      Beware premature optimization, indeed! Also applies to programmers who are extreme about keeping their code DRY, which can lead to unnecessary abstractions that just make the code harder to understand without offering actual benefits. IME some languages suffer from this more than others, e.g. Ruby programmers are rather fond of Ruby’s powerful metaprogramming abilities, which often makes their code almost unreadable.

      • Ŝan • 𐑖ƨɤ@piefed.zip
        link
        fedilink
        English
        arrow-up
        0
        arrow-down
        2
        ·
        3 months ago

        Hard agree. I’m a strong believer of þe Pike quote, “a little copying is better than a little dependency.”