19

Got a simple task

Decided to refactor some related shit so I don't have duplicated code

Get loads of problems with the shit I'm trying to refactor, now I'm late with the simple task

Comments
  • 2
    Lol I know THAT situation
  • 5
    no good deed goes unpunished
  • 4
    Let me guess: no tests either
  • 4
    Here's a pro bono tip: either have a separate task for refactoring or NEVER refactor the whole thing [service/module/...] as bonus work on the same task -- take small bites, mate and plan them ahead [i.E. Which tasks you're going to overestimate for which refactored parts].

    Learn from our mistakes
  • 5
    "Got a simple task" will be an option for my autobiography's title.
  • 3
    Fuck around find out
  • 0
    @devRancid i completely forgot code tasting is still a thing ever since i switched to nextjs
  • 2
    @c3r38r170 yeah, the task requested was actually really simple
  • 3
    Yeah, like updating the table of products shifts the layout and sometimes the order of the products is changed, often when there is more than 20 products (b2b e-commerce app,so not unusual to have 50+ product in cart), can you fix that?

    Yeah no prob, it's a simple task (fix CSS and simple sort, maybe some redux fix needed but ok).

    Actual task... Oh fuck, that shit's not working because someone crammed jQuery and is deleting and rebuilding the whole fucking table on any data change, lemme refactor this in React, because we use fucking react for this app.

    Five days later... Resolved the issue with the table, found 6 or 7 new bugs that were solved along the way... Now I have the issues on other screens because shit actually depending on that jQuery code...

    3 days later...

    Resolved everything... Right?

    Wrong! App loading screen broke!

    Reverted the whole shit, asked for 2 weeks for kicking out jQuery, got it and resolved / closed a lot of "mystical" issues!
  • 2
    Yes but without that simple task, u would have never wanted to refractor. So make that being late to the deadline worth it.
    U will feel satisfied with the refactored code.
  • 3
    @devJs i hate legacy code being mixed with modern code. I globally hate using libraries that are not maintained anymore.

    Btw. Back in the days jquery was the only dependency of the whole project. I cant even imagine my angular project in 5 years where most of the stuff in package.json are abandoned
  • 1
    Doesn't sound like a refactor
  • 3
    I have a team mate who constantly does this. The embodiment of premature optimisation. Super hard to read PR/MR's because by far the largest part of the changes does not have anything to do with the ticket.

    Sometimes you do need to refactor because the current architecture does not support the required change. That's fine also boy scouting is good find and fix them lost boys. But it should be super small cleanup + separate commit or it needs to become it's own MR/PR.
Add Comment