47,424 reputation
8126210
bio website tech.turbu-rpg.com
location Seattle, WA
age 32
visits member for 4 years, 3 months
seen 1 hour ago
A lifelong programmer who's been coding in Delphi since its initial release and currently makes a living at it.

Apr
5
awarded  Nice Question
Apr
5
comment Is there any good reason for someone who knows Python to learn Perl?
Tolstoy was talking about human beings. In computer programming, beauty is goodness, period. With maintenance taking up far more of a program's lifecycle than creation/initial development, the ability to read code and decipher its intent is far more important than the ability to write code quickly, and Python (and just about anything else, with the possible exception of template-heavy C++) beats Perl hands-down in that regard.
Apr
5
comment Where does this concept of “favor composition over inheritance” come from?
But that's the whole point. They're not "otherwise equivalent." Inheritance enables Liskov substitution and polymorphism, which are the entire point of using OOP. Composition doesn't.
Apr
5
comment How can you explain “beautiful code” to a non-programmer?
@zdan: When it requires a lot of explanation like that, it's not "beautiful code," but "a clever hack."
Apr
5
comment Where does this concept of “favor composition over inheritance” come from?
@Janx: Maybe that's it. I don't build big systems in languages like Java; I build them in Delphi, and without Liskov substitution and polymorphism we'd never get anything done. Its object model is different in certain ways than Java's or C++'s, and a lot of the problems that this maxim seems to be meant to solve don't really exist, or are much less problematic, in Delphi. Different perspectives from different points of view, I guess.
Apr
4
comment Where does this concept of “favor composition over inheritance” come from?
All right, I guess that makes sense from a C++ perspective. That's something I never thought of, because it's not an issue in Delphi, which is what I use most of the time. (There's no multiple inheritance, and if you have a method in a base class and another method by the same name in a derived class that does not override the base method, the compiler will issue a warning, so you don't accidentally end up with this sort of problem.)
Apr
4
comment Where does this concept of “favor composition over inheritance” come from?
@pholosodad: I'm not disagreeing with something I haven't read. I'm disagreeing with what Dean wrote, that "By definition, you need to know the implementation details of the class you're inheriting from," which I have read.
Apr
4
comment Where does this concept of “favor composition over inheritance” come from?
@Renesis: First thing I think of when I hear that is, "some people have ten years of experience, and some people have one year of experience repeated ten times."
Apr
4
answered Why fork a library for your own application?
Apr
4
comment Where does this concept of “favor composition over inheritance” come from?
@Dean: Fair enough. But I've seen it so much lately, used in such a wide set of contexts, that you could almost mentally replace the phrase with "inheritance considered harmful." It's that attitude that I find a little bit ridiculous.
Apr
4
comment Where does this concept of “favor composition over inheritance” come from?
I don't agree with that. You don't need to know the implementation details of the class you're inheriting from; only the public and protected members exposed by the class. If you have to know the implementation details, then either you or whoever wrote the base class is doing something wrong, and if the flaw is in the base class, composition won't help you fix/work around it.
Apr
4
comment Where does this concept of “favor composition over inheritance” come from?
So basically, you can't say "you shouldn't be using OOP in the first place if you don't understand Liskov substitution," so you say "favor composition over inheritance" instead as an attempt to limit the damage done by incompetent coders?
Apr
4
asked Where does this concept of “favor composition over inheritance” come from?
Apr
4
comment Structured programming versus OO programming
@Janx: "How often do you actually build a superclass as opposed to an Interface?" Huh? You don't "build superclasses"; you take existing classes and build subclasss from them, and you do that all the time. If you're not using inheritance, you're not getting the benefits of Liskov substitution and polymorphism, so what are you doing in object-oriented programming in the first place? Composition is a different tool with a different use case, not a replacement for inheritance. You shouldn't "favor" one over the other; you should use both, each for what they're useful for.
Apr
4
comment Is there any good reason for someone who knows Python to learn Perl?
You cannot parse XML with regular expressions.
Apr
4
awarded  Nice Answer
Apr
4
comment How do you choose to use a specific programming language?
@John: My language of choice is actually Delphi, which is a distant cousin of Ada. The Pascal-derived syntax is nice, but Ada never really developed a strong community. As for Perl, I'll let Alan Kay answer that one. "Perl is another example of filling a tiny, short-term need, and then being a real problem in the longer term." When you consider how software is used in every aspect of life these days, it's not hard to make a case that the world would be a lot better place if Perl and C had never been taken seriously by the computing industry. But hindsight's 20/20, as they say...
Apr
4
answered How do you choose to use a specific programming language?
Apr
3
comment Be liberal in what you accept… or not?
@William: I think that's a false correlation. The Web would have been just as "flexible and evolvable" without the Robustness Principle around to pander to bad design. The "dead or dying" systems you mention are losing not because they're tightly controlled, but because they're too limited to do what people these days need. Enforcing strict grammar on HTML and JavaScript wouldn't have made it unable to meet any of the needs it now meets; it would have only increased demand for high-quality tools in the early years.
Apr
3
reviewed Reject Do most companies not know how to write software?