Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
netikras34853265dHere'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 -
b2plane6392265d@devRancid i completely forgot code tasting is still a thing ever since i switched to nextjs
-
devJs1326263dYeah, 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! -
devapsarl428263dYes 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. -
devapsarl428263d@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 -
hjk1015696260dI 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.
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
rant