A Really Bad Example of YAGNI
In his recent blog post, A Quick Example of YAGNI, Jeremy Miller presents what is quite possibly the worst example of YAGNI I've ever read.
First, let me say that I really admire Jeremy and value his opinions. I read his blog fairly regularly and have learned a lot from it, especially in regards to Agile software development. But, with all due respect, I think he blew it on this one. Hey, even Superman has a bad day once in a while.
In, Jeremy writes in part the following:
If you've ever worked on an Agile/XP team you've surely heard something in the lines of "Let's YAGNI that. (YAGNI == You aren't gonna need it)" You've probably also heard the phrase "do the simplest thing that could possibly work." Both of these sayings are an exhortion to developers to avoid overdesign and analysis/paralysis by focusing on the here and now instead of getting caught up in designing for a conjectural need.
So far, I'm on board. I'm actually big believer in YAGNI. I've seen far too many developers waste far too much time writing far too much code to accommodate far too many nonexistent requirements. The YAGNI principle is especially important to independent developers and consultants, where failure to reign in feature creep can make the difference between making a living and losing your shirt on a project.
But then, Jeremy goes on to offer this example:
I called YAGNI on something today. We're enhancing (redoing) the dashboard page on our product. The new design calls for a 2 x 2 arrangement of mini-panels. I said just use a table driven layout (5 minutes of typing) and get going. A colleague threw a fit and screamed that we needed to use something more sophisticated because we're eventually going to allow customization of that page (and oh yeah, the world will end if we don't use CSS layout instead).
Sorry, but this where I get off the bus. In my opinion, to offer this as an example of "You Ain't Gonna Need It" is to exhibit a less-than-firm grasp on the meaning of the word "need," especially when it comes to web usability.
To all you web devs who feel perfectly okay with this, I'll tell you what. Go put yourself in the shoes of a blind person for a day. Install a screen reader, cover your eyes with duct tape, then spend several frustrating hours trying to fuddle through your quick-and-dirty table-based layouts. Then come back and tell me "you ain't gonna need it," okay?
Several have left comments supporting Jeremy's example, and I have to say, some of them made me shake my head.
Here are portions from a couple of typical ones:
...Better is better, but DONE is best, and if table-layout is what you know then do it...
...I use [sic] to be a zealot about crap like that - then I got over it because it really doesn't matter as long as the job gets done and the people paying your check are satisfied.
Well, I guess that all depends on what you consider "done." To many (far too many) developers, "done" means you got paid and the check cleared.
Let me make my feelings on this really clear:
As far as I (and in my opinion, any truly conscientious developer) is concerned, any public-facing web site where such disregard is given to accessibility is far from "done".
Let's take this out of the realm of web development for a minute, and look at this from the point of view of building development instead.
Developer: "Hey, the building is all done!"
Client: "But, where are the wheelchair ramps?"
Developer: "Ramps? Ramps? We don't need no steenkin' ramps! See, my legs work perfectly fine! And so do yours! What's the problem?"
And this, my friends, is what this post is really about. It's not about YAGNI per se, and it's certainly not meant to bash my friend Jeremy. It is only to decry the sad fact that, after all these years, so many web developers are still so cavalier about shoving the accessibility issue to the back of the bus.
If you read software development blogs with any regularity, you know there have been a lot of bits spilled lately over SOLID and Agile and TDD and Design Patterns. But do you really think that the user who has the misfortune of having to deal with your lack of concern with accessibility -- you know, the one with impaired vision, or deafness, or limited motor skills -- gives a rat's patootie whether you used the Respository Pattern or the Active Record Pattern in your data access layer?
Look, like I said, I'm not against applying YAGNI where it fits. But to toss aside the struggles of those who have to deal with barriers like this every day is not YAGNI.
Here are a couple more head-shakers from the comments:
... use CSS as much as you can EXCEPT to control the positioning of items on the page, this is where Tables are best.
... If you just want some output in columns and rows for a diagnostic panel, then why bother with CSS? They probably spent more time arguing about it than it would take to implement using tables... a waste of time.
I cannot even begin to speculate whether these are simply displays of profound ignorance, laziness, lack of compassion, or all three. Good Lord, people. Is this where we still are as a profession? Haven't we learned anything about accessibility and usability? What will it take to make the people who build the web care about this stuff?
Anybody who posts a web page on a public server would be well served to keep the following in mind:
The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.
The author of that quote is none other than Tim Berners-Lee, Director of the W3C and Inventor of the World Wide Web.
I was glad to see the following from commenter Ryan Riley:
Tables are for tabular data. If your data is tabular, sure you can use CSS markup to make it snazzy, but an HTML table element is the right tool for the job. If, however, your content is just laid out a certain way, you don't have tabular data and a table element should not be used. Think "accessibility."
Hey... maybe there's hope after all.
(P.S. If you're interested in learning how to write a good accessibility statement for your site, check out this blog post.)
Subscribe to this blog for more cool content like this!
You've been kicked (a good thing) - Trackback from DotNetKicks.com