Friday, August 29, 2025

Cut / Slash /Burn – The Ruthless Art of Perfecting Your Code...

I'm .NET developer with a long history of team leadership and mentoring. My fundamental belief about software development is best expressed by a quote from Antoine de Saint-Exupery (1900 - 1944)

"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." 

Basically, get rid of everything that is unnecessary. This is a good design maxim for code. Every line of code is a potential bug. Get rid of unnecessary lines of code and reduce potential bugs in your application. The best way to do this is aggressive refactoring using the combined paradigms of SOLID and DRY.

Fortunately, Visual Studio makes this pretty easy. Even before Copilot came along, you could get VS to refactor large chunks of code. I will refactor in small steps, with lots of total solution re-builds after each step. If some refactors seem very complicated or risky, I'll due an interim local commit of my branch before I begin. 

Of course, automated testing makes this less risky. You should have them...