On Wed, 2005-10-26 at 19:22 -0600, Luke Palmer wrote: > But we find that many programmers make decisions that trade > readability and extensibility for an extra 1% of speed, even when they > are writing a command-line frontend to MPlayer. If those people > are module writers, then we have a bunch of modules on CPAN that are > not friendly to the user who wants to use the module in the one way > the writer didn't expect.
Worse, that's a *theoretical* 1% of speed based on non-profiled code. > And if you're going to use roles for everything because they're closed > and they will gain you 2% of speed on one particular backend, then > we'll have to make the same rule for them too. I know it sounds like > we're "babying" our programmers. We are, because it's such a > widespread superstition. I prefer to think of it as "Helping to prevent them from writing unreusable code." > And just to reinforce that it's a superstition: a theory defines a > vtable. If you extend the class in an incompatible way, you have to > make a new instance of its theory, defining new vtable slots. Once > the new vtable is created, it is just as fast as the old one. There > is no speed loss whatsoever for keeping your class open. Even further, don't forget that someone, somewhere will really need to do something you didn't think of. Either he extends your class somehow or works around it in an ugly, funky way. Which one is faster to write? Which one is faster to execute? Which one is more likely to be correct? Which one is more maintainable? -- c