2 ms·
> 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. Any
by vaylian 3y ago
> 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?
- ganyu 3y agoSay some gigantic piece of function has 600 lines of code that does logic this, logic that and logic this and that. Suppose one day your PM goes into your office and request that a certain special case be added to this feature. 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.