rage driven development
Rage Driven Development (RDD) can be a valuable technique when tackling larger legacy code refactors or making new trending tech work as promised by their documentation.
Let's face it - sooner or later you introduce some legacy in your codebase and there comes a day when you finally get that management allowance that will enable you to start refactoring and tackling this tech debt. Or maybe you will use it to switch to that new praised library that supposedly solves all the problems you've been having in the last 5 years. Both legit actions. There are many methodologies on how to tackle legacy refactors and changes, but I'm here to talk about RDD.
So you did your analysis, sketched it out, know the bad parts of it and you are now down to the last step - start refactoring the codebase.
In order for RDD to really work, git blame is a must to use - you really have to see those people's names written on each line you're gonna be touching, so you can blame it on their family tree. A playlist of random songs that you would normally be playing at 3am under certain weird substances is another tool in your box. If you are not a smoker, you should become one - helps with the boring part while waiting for tests to pass. Let's dive into it.
So it's monday and you have the next 14 days free of meetings - you should focus. To start we first need to move a few util functions to a proper lib - no problem it's just I/O - this should be easy. Ah, there is one that also has dependency on that service method, hmm, not good - who did this? Yeah, fuck that guy, freelancers suck anyway, glad he doesn't work for us anymore. Ok split it out, move to utils lib, refactor calls, refactor imports, fix any missing params, yeah just make it work. Done! 30 files changed, no biggie, commit. Fuck yeah, this is smooth! Uh, forgot tests - let's run affected - nah just run everything to be sure nothing broke. 3027 test suites running in jsdom gonna take some time - let's go for a cig.
Fuuuu, 16 test suites failed, 46 tests failing. Piece of crap of tests, why do we write this crap anyway, it's not that it affects the amount of bugs those juniors generate. Also dafuq is up with Jest mocks. Ok let's fix this tests one by one, it's probably just mocks playing dirty anyway. 6 hours and many more curse words and outdated mock patterns and a lunch with a beer later: rerun failed tests - ok finally works. We moved and decoupled a few util functions. I still have it. Ah let's call it a day. Also fuck Jest again, what a piece of crap, should have just deleted those tests anyway.
Monday morning - no reviews - I have to be nice - rage driven development is only in my mind, when talking to people you have to be sweet to get stuff done. Can anyone pretty pleaseee check my MR - it solves and brings you all the best warez. Yes! Got 2 approvals, QA did a smoke test, nothing is broken - my refactor skills are still godlike - smack that into RC.
"Your branch is 174 commits behind release-candidate."
git checkout release-candidate git pull git checkout - git merge release-candidate ...
54 conflicts can’t be automerged.
Fuck you lazy fucks ,I said on friday check and approve, why... now I hate you. Ok no worries I'm pro.
git add . git commit ctrl-x git push
Need re-approvals pretty please. The fuck everybody is in meetings. Am I the only one working here? Screw this I'm off to lunch and a beer.
"Your branch is 22 commits behind release-candidate."
Who the fuck did this? Who dared to get his MR in before my refactor during lunch - I have 678 touched files - this is no joke. You want this code in FIRST! Anyway - re-approve, I merged again.
"Your branch is 31 commits behind release-candidate."
...raging in apathy now. Solved again. Merged. Pushed. Reapprove please.
Email: "Pipeline for branch best-refactor failed."
Pipeline passing! Reapprove! Yes! Merged to RC!
Oh god yes, tears, let's have a shot of schnapps, it's after 3PM anyway!
This was the best sprint, code is now good, we learned so much, kudos to everyone for reviews and approvals, I'm best, I'm sane again. This team delivers! That guy FUCKS! Wait, who's that guy anyway? Is that the new guy? Oh, we have 3 new guys now? Didn't notice... Anyway, thank god we have Typescript or else this refactor would have never happened in 1 sprint worth of man-days, if it hadn't been for those types and interfaces... An Jest, you lovely Jest - so much functionality would have been broken if it wasn't tested. Was anybody doubting JS? Not me! Ah yes, we are good. I bet I could pass some nice knowledge to those freelancers if they were still around. Miss those guys.
Life is good and when you leave for the weekend after the sprint ends, you have peace of mind and get home in a pure zen mood. After all, you already threw all the rage out at work.
Rage Driven Development delivers.
Note: Above article is satire and you should tackle big refactors with caution and care and always care for a good mood in your team. Also don't swear at work. Any resemblance to real world situations is purely casual.