4 ms·
Couldn't you just add a new SendMethod optional parameter defaulted to the method that was used prior to the refactoring? No breaking API changes, no extensive
by mistermann 11y ago
Couldn't you just add a new SendMethod optional parameter defaulted to the method that was used prior to the refactoring? No breaking API changes, no extensive manual refactoring of the entire codebase, as far as I can tell. This is how I always did refactoring for years, it's immediately obvious to support developers wtf is going on, and there's no requirement to have any "complicated" architecture on every single object in your entire application. Instead, the code largely resembles the simplicity of the real world being modeled.
Is this approach is so dangerous (as we're constantly told) why has it never caused me any problems? Maybe I'm missing something but I've never read an article that explains what it is I'm missing in a way that clicks.
- anton_gogolev 11y ago> Couldn't you just add a new SendMethod optional parameter Adding an optional parameter to an already existing method is not always a backwards-compatible change. For example, in C# this will effectively change method signature and break API.
- mistermann 11y agoHoly cow it seems it seems you're right: http://haacked.com/archive/2010/08/10/versioning-issues-with-optional-arguments.aspx/ http://haacked.com/archive/2010/08/10/versioning-issues-with... http://haacked.com/archive/2010/08/12/more-optional-versioning-fun.aspx/ http://haacked.com/archive/2010/08/12/more-optional-versioni... ...yet I've used this technique for years in VB.Net without issue....weird.