3 ms·
A friend once told me that any time he takes on a big refactoring project at work he works with the assumption that the project could get cancelled at any momen
by simonw 3y ago
A friend once told me that any time he takes on a big refactoring project at work he works with the assumption that the project could get cancelled at any moment, so his goal is to ensure that if it DOES get cancelled he'll still be leaving the code in a better place than it was when he started.
I think this is a really smart strategy.
- Fire-Dragon-DoL 3y agoYour friend is doing an actual refactoring (kudos), according to the definition. Otherwise it's more like restructuring
- bigkm 3y agohow does that assumption work? I would have thought that assumption would lead one to care less.
- Jtsummers 3y agoIt works if simonw means the refactoring/rearchitecting/redesign project and not the broader encompassing project. In the former case, it means making sure your changes are mergeable (ideally merged) all along the way so that if that effort is canceled the broader project can still benefit from it. In the latter case, then you're correct it doesn't matter. If the encompassing project is canceled who cares what state the change effort is in since everything is getting tossed.
- seadan83 3y agoThat strategy is something the heart of "agile development." Ensure you can do a little bit and then walk away and work on something else while still having delivered some value. A crux though for "big refactoring project" - first, that is kinda misnomer. It's not refactoring, it's re-architecture. Second, a number of refactorings can make things worse before they are better. For example, fixing bad abstractions, sometimes the first step is to inline stuff and copy/paste the abstractions to first "flatten the code" before restructuring it. That re-flattening step can lead to worse code, but it's in a place where it can be then made better (one step back to enable three steps forward)
- AtlasBarfed 3y agoAnd agile can absolutely suck for refactors, because it only rewards superficial steps.
- seadan83 3y agoI generally agree, but with the caveat that you are more speaking to "Agile" and agile project management (eg: Scrum). To that extent, I find it really useful to draw a distinction between agile development and agile project management. The former I think has some good ideas, namely : - don't go off into a cave for days, weeks or even many months before merging or showing any work; show & release your work often. - ask users frequently: "here this is, what do you think?" - assume you are probably on the wrong track, a good way to get back on track is to talk to the users. The more often you talk to users, the less likely you are to spend time on the wrong track - deliver in small increments. Gall's law - don't do big-bang deliver-the-world style projects, they often fail. On the other hand, agile project management (IMO) is almost trivial when agile development is done well and should not be prescriptive. If someone is building a tool for someone sitting next to them, does it make sense to do a demo every two weeks? I find what's more that Scrum is not even coherent, it's not internally consistent with itself. It's ironic as Scrum says nothing about going "fast", yet it's all about "fast" development - and second a framework that says "we will be changing our mind every two weeks" is somehow supposed to be more predictable and a better fit for long-range project timelines?? ON THE OTHER HAND... in the defense of Scrum, having a framework to prioritize work and emphasize delivery can still be valuable. Dev's can have a tendency to only want to work on cleaning up code. It can be a bit like Starcraft, where a player spends too long building economy and workers and never actually builds the army that wins the game. Though, frameworks have a bit too often become shorthand for actual thought, too much cargo-culting. [edits: cut out some ranting]
- AtlasBarfed 3y agoAgile is fundamentally a "UI convergence" technique. It is perfect for interacting visually and conceptualizing requirements (and the realization of those requirements) with end users and other stakeholders. I'm not saying waterfall is the only alternative. But one week sprints is a dumb idea for any serious software development. The other thing Agile does is give too much priority to outside concerns. Like pulling people off to do some thing the support team should fundamentally own, or meetings, support tickets that get too high prioritization because agile gives them too much prioritization. Sometimes you have to sit in an office undisturbed. To Agile people, that's the worst thing ever, but fundamentally everything truly significant in software stemmed from that.
- dheera 3y ago> works with the assumption that the project could get cancelled at any moment If I have that feeling, I have very, very little incentive to contribute to the project until I get better clarity on whether leadership wants to continue supporting the project and see it to launch. I like working on tech because I want to see it launched or at LEAST open-sourced if not launched, not die in a NDA graveyard.
- latenightcoding 3y agoWhich makes cancelling the project an easier decision. In the beginning of my career I was only accepting short term projects, so I learned to always leave the code in a state where anybody can pick it up. I still code in that way, but I know it makes me more replaceable.
- JackMorgan 3y agoI would immediately dismiss an engineer who codes with the goal of "being unreplaceable". That's a nightmare scenario. Our job is to leave the code as ready to hand off as possible. Engineers who do it well are given bigger and better things.
- jrajav 3y agoIf anyone at any company judges an engineer who crafts code that is easy for other engineers on their team to immediately pick up and start work on as more replaceable, that person is hopelessly incompetent. That would normally be a basic skill every engineer is expected to pick up before getting too far in their career. If anything, an engineer with a clear tendency to try to write themselves job security is the one that should be replaced ASAP.
- 0xferruccio 3y agoI love this thanks for sharing this