I’m teaching a little web development to my freshmen this week. Not a lot – it’s not a web development course – just enough to give them some idea of what is behind the screen. I’ve had students create a very simple profile page. The pages look pretty good when viewed in a web browser. The images are there. There are lists where there are supposed to be lists. And the hyperlinks (most of them) work. Sounds great right?
Well a lot of the code is a mess. <head> and <body> tags are missing. There is no proper closure to some of the list tags. And yet the pages work – for a basic definition of “work.” If I were a beginner placing my first web page on the Internet I’d be pleased. But I’m not. In fact knowing what I know about how things change I know in my gut that at some point pages like these will break and probably break badly. Eventually.
My job is to teach students to do things the right way. This is actually easier when doing the wrong thing causes thing to not work. Loading images breaks very easily but that is almost always a function of an incorrect specification of the file name or location. Operating system file systems are notoriously fussy. That is not always a bad thing because ambiguity is almost always a bad thing in computing. But web browsers are great at making assumptions about ambiguous HTML and doing (mostly) the right thing. Students are happy.
Next class we with have a long talk about what codes are missing or incorrect according to the standards. Someone will likely say “but it works fine in the web browser.” because these are teenagers and that is what teenagers say. I’ll come back with discussion of how small errors and code that can be ambiguous can cause unexpected problems later on and code develops. Hopefully they’ll accept that.
I’m thinking I need some new tools for them to use next time I teach this though. I need to look at software that verifies HTML and at least warns about errors. I have looked at the W3 Validator and it does some of what I need. I think I’ll keep looking as I don’t really want to write my own. Any suggestions? How do others check student web pages?