Hacker Newsnew | past | comments | ask | show | jobs | submit | terodox's commentslogin

It's a really good clarification. Deprecated is probably too strong a word.


Oh, I didn't even notice that you, the OP, are also the author of the post :D


That's a hard argument to argue with. I have to agree with you.


Or fixing the same mistake in several locations, which is happens now in my case.


One of the first things I learned as a programmer was "Did you fix it everywhere?" Then, later, I realized how nice it was to have only one place that it needed to be fixed.


I completely agree with you. There's never a true "rule" of when to refactor. The 1, 2, n pattern or as I've learned tonight, "rule of three" is more of a basic guideline than it is a steadfast rule.

I think it's easy to say, "If you copied a piece of code three times, please put that in a common place" to a junior engineer as a basic lesson for getting started with refactoring.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: