← Back to context

Comment by vbezhenar

5 years ago

It might make sense to divide your function with boolean flag into two functions and extract common code into third private function. Or may be it'll make things ugly.

I treat those books as something to show me how other people do things. I learn from it and I add it to my skill book. Then I'll apply it and see if I like it. If I don't like it in this particular case, I'll not apply it. IMO it's all about having insight into every possible solution. If you can implement something 10 different ways, you can choose the best one among them, but you have to learn those 10 different ways first.