News for hackers. Stuff that matters.
Re:Coding Skill and the Decline of Stagnation by jiggy2011 on Friday January 13, 2012 @07:45PM (#3463095)
Philosophically, I agree. I view premature abstraction in the same light as premature optimization.

It's usually easier to optimize later since optimisations are often just taking sections of code independantly and making them quicker. There is the whole 90/10 rule (or whatever it's called) that says it's better to highly optimise a few sections of bottleneck code rather than the whole thing.

Trying to retrofit an abstraction to a piece of code is almost always a horrible experience frought with mess and compromise.

Re:Coding Skill and the Decline of Stagnation by Dove on Friday January 13, 2012 @08:57PM (#3463236)
Trying to retrofit an abstraction to a piece of code is almost always a horrible experience frought with mess and compromise.

Yes, and unless the problem is trivial or your experience in the domain is such that your foresight borders on the clairvoyant, this is guaranteed to happen. No matter how much (or little) design you do up front.

The key is to recognize the right time to stop and refactor, so as to keep the pain that comes with learning the problem space to a minimum.

Re:Coding Skill and the Decline of Stagnation by sbov on Friday January 13, 2012 @08:26PM (#3463180)
Premature abstractions can have similar issues: unless you have more than 2 cases you don't necessarily know what your abstraction should look like. As the cases pile up you find yourself increasingly shoehorning implementations into abstractions that don't quite abstract correctly.
Re:Coding Skill and the Decline of Stagnation by humbledrone on Saturday January 14, 2012 @04:11AM (#3463862)
> Trying to retrofit an abstraction to a piece of code is almost always a horrible experience frought with mess and compromise.

It is amazing to me that our experiences are so different: I have found the exact opposite of this statement to be true. The only way that I've ever come up with a good abstraction is by starting with something concrete (preferably two or more instances) and factoring out the commonality. Retrofitting a piece of code to an abstraction that was designed in a vacuum tends to be an exercise in frustration, due to the abstraction being shortsighted and insufficiently suited to the problem space.