Wednesday, April 9, 2008

Whatever You Prefer

Have you ever worked on someone else's Web page? Wasn't it… interesting?

Several times over the last couple of years, I have had to open up pages that were last worked on in nineteen ninety-something. There is always a cringe involved, somewhere. Sort of like opening up an ancient crypt, you don't really know what you might find in there. Maybe a collection of strange and wonderful artifacts of a bygone era, maybe just another mummy's curse.

We all operate differently. The great thing about a program like Dreamweaver is that it is so customizable. You can show your files on the left- or right-side of the workspace. It's your preference. You can place the Design View above or below your markup in Code View. It's your preference. You can save files and move them immediately to the server, or you can elect to wait until you have several files done and then synchronize the entire site all at once. It's your preference.

I teach my people not to fear blank lines and spaces in their markup, in my HTML classes. Maybe that is a throwback to the summer that we were all given Microsoft's FrontPage, and yet we all went out and purchased Dreamweaver, back in the early days of The Microsoft Network, msn.

Most versions of FrontPage took your carefully-crafted markup, all indented and aligned and beautifully annotated, and mashed it up into three or five arbitrary paragraphs of markup, to make it more confusing. The idea was that if you ever looked at your Page Source, you would see such an unholy mess that you would throw your hands up in theatrical despair and vow to give up learning HTML, thanking whatever god you worship and Bill Gates that you had a copy of FrontPage to get you out of the wilderness.

The decision to have FrontPage work this way is what kept it from becoming the darling of professional Web designers and developers, though. And that's ultimately what killed it. Microsoft makes a new Web editing environment, now. I don't know anybody who uses it.

But yeah, I have always been a fan of lining things up, when I could. I like a blank line between my <head> and my <body>. It helps me to get the idea that everything from "here" up is all about servers and search engines, and everything from "here" down is all about what's on the page. The same goes for <table> tags. I like my <table> and <tr> table rows to line-up, with each rows' <td> indented one tab's worth (and you can select how far a tab indents in Dreamweaver's preferences, too!). Some people don't like this, and I can respect that. But for me it really increases the readability and understanding of what the markup may look like in a browser. I prefer to work with word-wrap turned on, scrolling to the right side of my listings if I need to look at markup or code over there. That way, the whole scheme of tabs and blank lines is maintained. Paragraphs and <div>s get new lines, aligned with their container, as far to the left as we can get. Lists work like tables, with the list item tags, <li>, each tabbed-in from the <ul> or <ol>, and again, no wrapping of the lines.

But what really helps is a comment or two. How do you get to the mall from here? The first answer may be "go to this corner and turn left." But there may be good reasons to tell someone to make three right-hand turns. When you get into a strange Web page's source, you may be wondering why the previous developer made the choices they have made. Was it for good reasons, or was it because they didn't understand the options they had? In a time before tables, we used to corral text on the browser page using non-breaking spaces. But doing that today would just be… wrong. Still, if they are doing something later on in their page that depends on spaces for some reason, it would be nice to leave a note. <!-- Like This! -->.

Last summer, I happened upon an old page that had been working for years, it just needed a little tweaking. When I got in there I didn't have a clue why the original developer had done what they had done. Imagine my horror when, after twenty or thirty minutes, I finally recognized the work as my own, from the year 1999.

No comments: