4 ms·
> Both are out of the scope of the abstraction; inside the scope of the abstraction, TCP ensures that packets arrive in the correct order, and C ensures that y
by arohner 17y ago
> Both are out of the scope of the abstraction; inside the scope of the abstraction, TCP ensures that packets arrive in the correct order, and C ensures that your program can work on a variety of CPUs.
But that's exactly Joel's point. inside the scope of the abstraction, the following properties are true. The whole point is that outside the abstraction stuff breaks, and the kicker is that in many cases, the only practical way to know what is inside the abstraction and what is outside the abstraction is to know the details about the underlying abstraction, exactly what it was supposed to help with!
Yes, cutting the network cable is a poor example, but there are many good ones. With C, you can do stupid bit manipulation in ways that will be non-portable across architectures. With ORMs, an easy example is the N+1 select problem.
ORMs are typically very leaky, in the sense that to write good quality code, you have to know the details about how your ORM works, and they usually aren't a 100% replacement for knowing SQL. The more you have to know about how the level below you works, the more leaky the abstraction.
I think Joel's could have made the point clearer if he had distinguished between how much typing the abstraction saves you, and how much knowledge it absolves you from knowing.
- jrockway 17y agoMy experience is different. (I mostly use DBIx::Class.) I am not good at remembering SQL's syntactic quirks, which means I can't sit down and write a query for exactly what I want. But with DBIx::Class, I can walk my objects to get the data I want, and it "compiles down" to one database query. So that's not leaky -- I don't know SQL, I do know OO, and DBIx::Class lets me use my knowledge of one to extract data with the other.