• purpleprophy@feddit.uk
      link
      fedilink
      English
      arrow-up
      8
      ·
      11 months ago

      Yesssssss. I just got done splitting up a 3000-line mess of React code into a handful of simple, reusable components. Better than sex.

      • fraydabson@beehaw.org
        link
        fedilink
        arrow-up
        3
        ·
        11 months ago

        I’m a total noob but I learned how and refactored my python project I’m doing at work. It takes time but it is very rewarding to have clean code lol

    • Solemarc@lemmy.world
      link
      fedilink
      arrow-up
      6
      ·
      edit-2
      11 months ago

      My brain goblin is a big fan of performance. Recently I reviewed a teammate’s code. It was a small 100ish line PR and he calls the same function twice in a row with a tiny variation. My brain goblin went “you could consolidate these into one call”, “since it’s only one call you could inline it”.

      A couple hours later when he came to ask me what I’m smoking I realised my proposed solution had more LoC and was more complex to read. If we needed better performance, step 1 should’ve been to offload this task to an API that wasn’t made with python. Not to mention the next thing this API does is string manipulation and then write to file.