News for hackers. Stuff that matters.
Re:The Rule of Three by babuskov on Friday July 19, 2013 @03:25AM (#6068766)
This is similar to Jeff's rule "b". The only difference is cause and effect ordering. Jeff suggests you build it, reuse it, and when you reused it thrice in different applications, than call it a general purpose library.

It seems to me that Jeff misunderstood what rule of three means, or he's just trying to re-tell the Wikipedia article in his own words.

The "Rule of three" you quoted is how it should be done. Create, copy/paste, refactor to be reusable. And there's nothing wrong with that.

Re:The Rule of Three by brazzy on Friday July 19, 2013 @05:29AM (#6069097)
> It seems to me that Jeff misunderstood what rule of three means, or he's just trying to re-tell the Wikipedia article in his own words.

Not at all - he's actually making a much deeper point: that something cannot really claim to be reusable until it has actually been used in three different places.

Because if you writer a reusable component for just one product, chances are very high that even if it's technically reusable, it will end up conceptually coupled to that one product too much to actually be useful elsewhere.

Re:The Rule of Three by Cogito on Friday July 19, 2013 @03:36AM (#6068784)
To be fair to Jeff, he was quoting from "Facts and Fallacies of Software Engineering" by Robert Glass [0].

The two rules are very similar, and that's why I think they have the same 'theme'. In one we are talking about when to refactor and in the other when to create a library, but both are essentially the same idea. Don't spend time generalising something that might never be used again. Three existing uses is (apparently) a good heuristic for answering "When is something going to be reused lots?"

[0] http://www.amazon.com/exec/obidos/ASIN/0321117425/