• SavvyWolf@pawb.social
    link
    fedilink
    English
    arrow-up
    3
    ·
    3 days ago

    Hot take: Clean up your darn imports. Otherwise you just make the links between modules confusing and messy.

  • masterspace@lemmy.ca
    link
    fedilink
    English
    arrow-up
    2
    ·
    3 days ago

    We have linting set up in our codebase, I had to switch and focus on one half of our project, and I nearly lost my mind when I came back to the other side and realized that every time someone said they were ‘addressing linting issues’, that actually meant they were putting eslint-disable everywhere until the pipeline stopped complaining.

  • Quetzalcutlass@lemmy.world
    link
    fedilink
    English
    arrow-up
    0
    ·
    3 days ago

    Except those imports were used by a huge section of code you temporarily commented out, and now you’ll need to manually select a dozen imports to get it working again when you come back to it.

    (Sure you could have just commented out the unused imports, but the linter auto-sorted them and you’re feeling too lazy to copy-paste a dozen scattered lines)

        • naeap@sopuli.xyz
          link
          fedilink
          arrow-up
          1
          ·
          3 days ago

          In general, I’m with you
          But sometimes I need to revert/comment out a code block, because another code part isn’t finished/working as it should.
          Sure, it clutters code, but if I just comment out a function call and temporarily replace it with the workaround, it should imho stay in code.

          Else the workaround will stay forever and the commented out code will act as a reminder, that this part isn’t clean yet.

          But maybe it really is a case by case thing, where sometimes it’s better to branch it out for later merge - although that can get really messy, while having the future implementation commented out, others will also see, how it is supposed to work and don’t try to further extend the workaround, which makes future merging hell

          Out of interest, how would your best practice look in such cases?