46,316 reputation
8122206
bio website tech.turbu-rpg.com
location Seattle, WA
age 32
visits member for 4 years, 1 month
seen 8 hours ago
A lifelong programmer who's been coding in Delphi since its initial release and currently makes a living at it.

Apr
11
revised How do you learn to program?
added 302 characters in body
Apr
11
answered How do you learn to program?
Apr
8
reviewed Approve suggested edit on Programming style: Reoccuring error checks
Apr
6
comment SOLID vs. Avoiding Premature Abstraction
@jprete: Why? Trying to apply absolute definitions is part of the cause of conceptual messes like this. There's a lot of craftsmanship involved in building good software. What's really needed IMO is experience and good judgment.
Apr
6
comment SOLID vs. Avoiding Premature Abstraction
"Does more than one thing" can be difficult to define, depending on what level of abstraction you're working at. It could be argued that any method with two or more lines of code is doing more than one thing. At the opposite end of the spectrum, something complex like a scripting engine is going to need a whole lot of methods that all do individual "things" that are not directly related to each other, but each comprise an important part of the "meta-thing" which is getting your scripts to run properly, and there's only so much breaking apart that can be done without breaking the script engine.
Apr
6
comment SOLID vs. Avoiding Premature Abstraction
@S.Lott: That should be obvious from the context. As I read it, at least, "more than currently exists in the code in question."
Apr
6
answered SOLID vs. Avoiding Premature Abstraction
Apr
6
comment SOLID vs. Avoiding Premature Abstraction
@S.Lott: The key word there is "more". This is precisely the sort of thing YAGNI was invented for. Increasing modularity or decreasing coupling simply for its own sake is just cargo-cult programming.
Apr
5
comment Where does this concept of “favor composition over inheritance” come from?
@Steve: You can do abstractions and encapsulation in any paradigm that supports the creation of data structures and procedures/functions. But polymorphism (specifically referring to virtual method dispatching in this context) and Liskov substitution are unique to object-oriented programming. That's what I meant by that.
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.