“The Art of Readable Code”

For about as long as computer programming has been going on, so has the quest for better-quality code. Among the early additions to my bookshelf were “Programming Proverbs for FORTRAN Programmers” (1975) and “COBOL with Style” (1976).  Both books’ covers promise “Principles of good programming with numerous examples to improve programming style and proficiency” — Continue reading

Posted in ITD 210 (Spring 2011) | Leave a comment

Bloodhound Needed?

As you’ve been discovering all semester, it can be challenging to get your CSS code to do exactly what you want it to! Recently, I was looking over an interesting book, The CSS Detective Guide: Tricks for solving tough CSS mysteries by Denise R. Jacobs. A lot of good ideas here, much along the lines of what we’ve discussed in class, but with much greater detail.

And I learned something new. The book referred me to a page at W3C, validator.w3.org/docs/errors.html. This document explains, with a bit more verbosity than the default, the meaning of the various error messages put out by the HTML validator. Feeling stuck? Check it out!

Posted in ITD 110 (Fall 2011) | Leave a comment

Don’t Touch that Aspect Ratio!

In class, we were discussing the displaying of images with the <img> tag, and I talked about not changing the aspect ratio.  I want to make sure the concept is clear.

The aspect ratio is simply the ratio between the width and height of an image. Here is an image with a 1:1 aspect ratio — that means that the width and height are the same. Continue reading

Posted in ITD 110 (Fall 2011) | Leave a comment

Who needs resolutions?

As we were discussing what can fit on the screen, a question came up about the meaning of screen resolution.  Let me attempt a quick overview here.

The basic graphic unit for computers is the pixel (short for picture element).  What we see displayed on a monitor is composed of a grid of pixels.  The screen resolution is the dimensions of this grid.  For early computer monitors, a typical resolution was 640 x 480 — in other words, the grid was 640 pixels wide by 480 pixels high.   Continue reading

Posted in ITD 110 (Fall 2011) | Leave a comment

Making the Server Serve!

As we discussed in our last class, we now have WAMP Server installed on all the systems in our classroom and in the open lab.  WAMP Server runs under Microsoft Windows, and includes Apache web server, PHP, and MySQL.  You can easily install the same software on your own system if you’re so inclined.  (You can download it free from http://www.wampserver.com/en/.) Continue reading

Posted in ITD 210 (Spring 2008) | Leave a comment

Specificity: huh?

One of our students was having a problem with review question 3.29 (page 131):  “If there are two conflicting specifications in a document-level style sheet, which of the two has precedence?” This was covered in section 3.13, Conflict Resolution, but a good example or two might have made things clearer. Continue reading

Posted in ITD 210 (Spring 2008), ITD 210 (Spring 2011) | Leave a comment

In Search of eXtensibility

The standard for code in our class this semester will be XHTML 1.1, which is similar to the XHTML 1.0-Strict we used in ITD 110 — all the deprecated stuff is gone.  In case you’re new to XHTML, here are the main differences compared to HTML:

  •  The page must start with an appropriate prolog.  (Check the textbook, section 2.3, for details.)
  • All tags and attribute names must be in lower case.
  • All attribute values must be enclosed in quotation marks.
  • Every attribute must have a value.  (For example, <input type=”radio” selected=”selected”> instead of <input type=radio selected>.)
  • Every tag must be closed.  (For example, <p>Some text…</p>, or <hr />, or <img src=…  />.)
  • Tags may be nested, but should never overlap.  (For example:  <p><b><i>Some text</i></b></p> is correct;  putting the  close tags in any other order is incorrect.)

All code submitted, either for homework or projects, should be successfully validated.  Three ways to validate your code (listed from easiest to hardest):

  1. In Opera, right-click on the page (but not on an image or a link) and then click on Validate.   Or press Ctrl+Alt+V.
  2. In Firefox, install the Web Developer extension (which is a good idea for this class, for many reasons).  Then, while viewing the page, click on Tools | Validate HTML or press Ctrl+Shift+H (if you’re viewing a page on a web server) or Tools | Validate Local HTML or Ctrl+Shift+A (if you’re directly viewing a page on your own system).
  3. Visit the W3C Validator page and follow the instructions there.

Happy coding.

Posted in ITD 210 (Spring 2008) | Leave a comment

I Got the Winter Whites Instead of the Blues

In all the years I’ve been teaching at Nova, this is only the second time I’ve had a class cancelled due to weather — I guess it depends on your perspective whether that’s good or bad.  I am disappointed though, as I was looking forward to meeting new people and seeing old students again.  (I won’t normally phone everybody in case of a cancellation, but I made an exception for the first night.)

As noted in the e-mail I just sent everybody, the college has no provisions for make-up classes, so we’ll just have to do a bit of double-timing to compensate.  This week’s homework assignment will be due as originally planned. The good news is that the first two weeks are largely reviewing what you should already know (XHTML
and CSS), so it shouldn’t be too much of a scramble. If you’re not sure of your LAN ID (that’s the one you use to log in to any of the computers on campus), there are workstations where you can look it up in the Loudoun library and the open computer lab. If you have problems getting your assignment published to your college web space, contact me and we’ll try to get it sorted out.

Have a great week, and be sure to contact me if any questions: e-mail or instant messaging (see Syllabus for details) works best, but you’re always welcome to try my cell phone.

In lieu of me trying to entertain you tonight, enjoy this extract from David Pogue’s New York Times “Circuits” column today:

Imagine (sung to the tune of John Lennon’s “Imagine”)

Imagine there’s no Apple,
No products that begin with “i,”
No monthly iPod models,
No Apple stores to get you high.
Imagine all the people
Finding other things to do!

Imagine there’s no bloggers…
It isn’t hard to do!
No viruses or spyware,
No weekly Windows patches, too
Imagine all the people
Learning to get a life…
(You-hoo-hoo!)

You may say it’d be a nightmare
Without Google, Mac or Dell
We might have real conversations–
But the world would be dull as hell!

Imagine no new cellphones;
Kiss console games goodbye.
No David Pogue or Mossberg
To tell us what to buy.
Imagine all the people
Getting some exercise!
(You-hoo-hoo!)

You may say that I’m a loony
But rest assured I’m almost done.
I’m pretty sure it’ll never happen
So we nerds can live as one!

Posted in ITD 210 (Spring 2008) | Leave a comment

More Textbook Blues

After 8-1/2 chapters of starting web pages with
  <?xml version=”1.0″ encoding=”UTF-8″?>,
the author suddenly springs a new version on us on page 359:
  <?xml version=”1.0″ encoding=”iso-8859-1″?>!

I don’t know why she did that — presumably it’s a mistake.  But the good news is that it doesn’t
matter:  you can expect to get similar results with either character set specified.

Posted in ITD 110 (Fall 2007) | Leave a comment

Over the Waterfall?

Hmmm, another language, different syntax, more attributes to remember.  The good news is that in the long run, Cascading Style Sheets make it easier to create and maintain attractive, consistent-looking web pages.  As I’ve mentioned in class, the W3C has a CSS Validator, which works similarly to the XHTML Validator.  (One warning:  your code must successfully pass XHTML validation before the CSS validator will run.)

There are likely to be times  when the styles are not being applied as you expected, and you’ll feel like banging your head against the wall.  In general, head-banging doesn’t solve coding problems, but there are some tools which might help you.  If you prefer working in Firefox, you’ll want to install the Web Developer and Firebug extensions;  for Opera, install the Web Developer Tools.  You find links to all three on the class Tools page.  The download pages include documentation for using the tools.  Questions?  Bring them to class and we’ll try to answer them together.

Happy coding!

Posted in ITD 110 (Fall 2007) | Leave a comment