> Isolation. If you only need to change a part of an element, extract that part so the whole subelement changes.
I don't get what the author means by this. Anyone wants to elaborate?
I don't get what the author means by this. Anyone wants to elaborate?
You do not further increase the complexity of this function by having one or two variables in the front, several if-elses in the middle not to mention a couple gotos.
You take these special cases and the most relevant logic away into yet another function, document it and hence ensure the changes to that 'special logic' do not mess up with the rest of that feature.