Saturday, September 11, 2010

2.3 My foray into grasping code

In my last posting I mentioned that the World Wide Web Consortium (W3C) has outlined and continues to update all kinds of standards related to the web; here is a perfect example:

DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

This line of code (a document type definition [DTD] or doctype) at the beginning of a webpage tells the browser what standard was used to write the page. In the absence of this code the browser will just assume the whole page is written in the older HTML language, which can pose problems when it comes to proper rendering of the page. The particular line of code above conveys the message that XHTML 1.0 standards have been used, with the "strict" meaning that 1.0 has been followed to a T and no HTML elements are present. This is essentially the gold standard in web design because HTML is being phased out. XHTML 1.0 "transitional" allows some HTML elements to be used in the coding, and inclusion of "transitional" in the code clues in the browser. According to Matthew MacDonald in Creating a Web Site: The Missing Manual, the strict version of XHTML is now the most commonly used; I checked out the code on a few different websites using the page source view, and sure enough, while I found examples of the other types, strict was by far the most common version in use.

Interestingly, however, I did notice that all the pages I've created in Dreamweaver were automatically coded using XHTML 1.0 transitional (although there may be a setting somewhere that I haven't found that changes this automatically). This default suggests we aren't quite at the tipping point where HTML elements are so uncommon and cumbersome as to disappear. In fact, MacDonald points out that there is already an XHTML 2 standard that, when finished, will completely break ties with HTML. But while W3C is ready to take the next step, finally cutting ties with an old and enduring language is a little more daunting to browser software companies. In response, a competing standard is being developed (X/HTML 5) that preserves compatibility with HTML. So, we'll see who wins out because this is a pretty big step; the battle between competing technologies and standards is timeless though. Think Beta and VHS or Blu-ray and HD DVD—epic battles. For a techno war that is even a little more current, Gene Steinberg of TechNightOwl suggests that, "Apple wants to purge Flash from the online world," and is taking steps to exclude support from popular devices like iPhones and iPads. He adds that, "as the installed base of people who can’t view Flash content grows, it’s only a matter of time before more and more sites decide to drop it and use other methods that are compatible with all or most browsers." The forward march of technology standards and supports never ends… So, we'll see if the W3C wins out sooner rather than later on the XHTML standards front.

Check out the rest of Steinberg's Apple-Flash article here:
http://www.technightowl.com/2010/02/apples-not-so-secret-plot-to-change-technology-standards/

Moving on to the nuts and bolts of code, here is my first webpage created the old school way using TextEdit (with no Dreamweaver automatic code in sight!). Delving into tags and elements is actually extremely useful since eventually you have to look at the code—even in a WYSIWYG program. Besides, learning why you can't just type along and add line breaks without coding them is priceless (like a reality check that the spacing on your computer will not look the same on all others, and that you are not the center of the web universe).

This is the result of my use of italic, bold, and image tags in a basic page (without ANY extras, like meta tags). Still, it is pretty cool to see how this looks as code and in the display:













In the past I have enjoyed checking out the coding behind various web pages, although a lot of it reads like a foreign language. This little exercise has been surprisingly enlightening in terms of how various tags work. Perhaps more importantly, however, this activity and the MacDonald text have driven home the notion that code is dynamic and pliable, and while it might take a little time and work, any error can be found and eliminated with a little deleting and typing. Kind of a liberating idea.

No comments:

Post a Comment