• baines@lemmy.cafe
      link
      fedilink
      English
      arrow-up
      0
      ·
      11 hours ago

      maintainable code is most efficient

      sure there is a trade off but i’d rather runtime be slower than fancy brittle faster code

      • vrek@programming.dev
        link
        fedilink
        English
        arrow-up
        0
        ·
        10 hours ago

        Within reason this is true but you also have to agree that it often goes too far. Not everything needs to be an interface or factory. For example if your making a pdf viewer dont concern yourself with abstracting how to open a file, you know it will be a pdf. If someone opens a gif with a pdf reader it’s ok to give an error. Plus to me a lot of “maintainable” code is difficult to work with because there’s so many levels of abstraction and functions spread across multiple files I can’t keep all that in my head.

        Also if you only need one or two functions you don’t need to import a whole library. For example look up “handmade hero” and see how Casey works with the windows libraries.