Friday, February 13, 2009

New rules: no more rules

This escalator sign doesn't really make sense. But at least they have the excuse of English not being their native language. Presumably, the Chinese makes perfect sense.

On the subway I take, they have no such excuse.

The tunnel where I get out is very deep. A very long escalator takes you from the subway to the top, where the ticket booth and street exits are. The escalator only goes up; to go down, you have to take the stairs or the elevator. Once you arrive at the top of the escalator, an LED sign greets you with this message:

"Escalator is for subway patrons only."*

What? Only people coming from the subway are on the escalator. The only way to be in violation would be to buy a subway ticket at this station, walk down the stairs, and then take the escalator back up. Just for fun. Even then, you paid for a ticket, so shouldn't you be allowed a free escalator ride?

Why is this sign there? The only reason I can think of is that, in the design stage, someone put in this "feature" thinking abstractly that it could be of benefit. Later, when it came time to actually use the sign, the only thing anyone could think of was mindless manager-ese -- something they read somewhere else.

"Restrooms are for customers only" on a restroom at the back of the store is another example. Whoever posted that sign probably saw a similar sign somewhere else, but failed to note that they probably saw it at the front door.

In software development, we should be following principles and practices, not rules. Principles are almost philosophical; it's what you believe.

Practices are not rules. Practices derive from principles. This is where confusion creeps in. Is "Make your classes final, do not allow extensions" a rule or a practice? How about "All classes should have a unit test"?

The key is whether you're being motivated by principle. If you understand the principle, and that's why you're following the rule, you're really following a practice. If you don't understand the principle, or you're following the practice regardless of it, you're actually following a rule.

I see now that Robert Martin also has a related post yesterday, specifically about SOLID principles. Scott Bain also has an good write-up on this in Emergent Design.

* I would take a picture, but that is verboten in this high security era.

No comments:

Post a Comment