Newsletter "Behind the Scenes" Newsletter

March 2014The monthly newsletter by Felgall Pty Ltd

My Word

Teaching History

One of the subjects in a course that my son is taking teaches HTML. Now this subject is a part of a nationally recognised course being taught by one of the Government associated colleges so you'd expect that what they teach would comply closely with the requirements of the course. What I was surprised to find out was that he was taught to add a name attribute on an <a> tag when an anchor point was needed in the page to be able to create links within the page. I was surprised because that particular approach was made obsolete when HTML 4 was introduced in 1997 and was only ever required for the Netscape browsers (the use of which died out about ten years ago). As nationally recognised courses in Australia are regularly updated there have been at least four or five opportunities for that particular part of the course to have been updated to get rid of such nonsense. So either those responsible for the course curriculum have not kept up to date with HTML or the course curriculum doesn't go into enough detail and the those teaching the course are failing to keep up to date. They are teaching history with the mistaken idea that it is still relevant. Students in such classes will need to forget these parts of what they learnt in their course and learn the correct modern way (in this case adding an id to any tag in the body of the page) in order to properly create web pages if they use it in their work. When it was pointed out after the class that this code was obsolete the teacher then claimed to be letting the students know how it used to be done.

For those who go to work for any company where there are a significant number of other people who have that particular knowledge it will be a relatively quick process for the others to tell them what really antiquated code they are using and how to do it properly. Unfortunately in many cases there will only be one or two others (or even none) already working at the company who may themselves have been taught the historical approach rather than how it should be done now - leading to the company continuing to use really antiquated but freshly written code on their site.

A large number of amateurs also create web pages and many of these do not undertake courses but instead learn by copying what they see on other sites. The large number of web pages that were either created many years ago, created by those who were taught history and have never found out that it is history, or who have created pages by copying what has been used on other pages means that a high percentage of web pages are still written as if Netscape were the target browser.

Those developing HTML 5 have recognised that most web pages are still being developed using HTML 2 or HTML 3.2 and as well as the new tags and attributes it has introduced, it has also lowered the status of all the tags and attributes deprecated in HTML 4 back to calling them obsolete (rather than removing them completely as their being deprecated in HTML 4 implied would happen). HTML 5 has also adopted a doctype that is equally valid for HTML 2 to ensure that browsers will continue to support the tags and attributes that a properly written web page would never need.

The course my son is taking isn't the only one where historical code is being taught and HTML isn't the only web language where Netscape is the browser being targetted (whether the teacher knows it or not). If anything the situation with regard to teaching history is far worse when it comes to JavaScript than could ever be possible with HTML.

I regularly visit a number of forums where people ask for help with their web or programming problems. Seeing what sorts of questions people ask gives me ideas as to what sorts of articles I should write. Many of the JavaScript questions being asked are homework that the person has been asked to do as a part of a course that they are doing. In most cases either the question itself or the code that they have written so far for their answer but which they can't get to work clearly shows that what their class is teaching is history rather than programming.They too are being taught as if Netscape were the target browser.

With respect to both HTML and JavaScript the death of Netscape 4 was the end of an era with a completely different approach being available in all more modern browsers. The big difference with JavaScript is that all browsers since Netscape 4 have supported the standard document object model and so can fully interact with the web page. Commands such as document.write(), prompt() and alert() were no longer required. Jumbling the JavaScript and HTML together also ceased to be necessary as DOM commands could be used to attach event handlers and to update any part of the web page without needing to be hard coded in the HTML. It has taken some time for some of the bigger companies to update their JavaScript for these changes but even Google AdSense ads can now be attached into the web page with the JavaScript portion of the code being kept completely separate from the HTML and simply linked in at the bottom of the page.

Despite such JavaScript commands only being needed to support long dead browsers, many JavaScript courses are still teaching these commands and not teaching what should be used instead. Many students are taking these history classes with the mistaken idea that they are taking a programming class. In many cases the correct answer to the homework question they have been given would be to throw away the two dozen lines of antiquated code that they have written which would almost work in Netscape and to replace it with a couple of lines of JavaScript that isn't even going to be taught in their class. In some cases the couple of lines of JavaScript to answer the homework question will also need a couple of dozen more lines of JavaScript to actually link it into a modern web page but that supporting code with minor changes will be used in just about every web page that you write where you need to attach JavaScript (and so would be supplied to the student were the question an appropriate one for a modern JavaScript beginner's class).

Even before learning about the historical HTML that my son is being taught, I started writing a new series of JavaScript articles to look at the sorts of homework questions being handed out in what are obviously history of JavaScript classes. With each I present a minor variant of the original homework question (perhaps with some commentary on what makes it obvious that the class is on history). I then follow the question with a sample of the way that the question would have been answered back in the late 1990s when Netscape was the only browser to run JavaScript. This is then followed by some commentary as to why such a solution is inappropriate for modern browsers. I then provide a second solution to the same question but using code that would be appropriate for modern browsers. In each one I disregard anything that might have been in the original question about how to code it (eg. where the question asks to write a loop to answer the question, the modern solution would only use a loop if a loop were actually needed to answer the question). In each case this second modern solution is significantly different and has very little in common with the historical code. These articles highlight both how much JavaScript has changed over the years and also how many JavaScript history classes there are out there pretending to teach programming.

The question is, what can we do about all of these history classes? How can we ensure that those who have not yet started learning HTML, or JavaScript (or whatever) can tell whether the class they are taking is actually teaching them the right way to code things now or is still teaching historical code more suited to Netscape? In some cases the historical web subject is simply a part of a bigger course where the student's interest is primarily in another part of the course and they just need to pass the web subject with no expectation of ever using it again. For them the fact that it is a history class doesn't matter. It does matter though for anyone who is taking the class because they want to learn how to write code. With this latter group if they are really lucky they will find out that they are in the wrong class fairly quickly and be able to switch to a class that actually teaches how to write modern code. If they are not so fortunate they will not find out that they have wasted time and money until after they finish the course.

Have you ever taken such a course that turned out to be a history class?

On Site

I started writing two new series of articles this month. The first mentioned in the above article is a series of articles about JavaScript homework questions that looks at the answer that would have been expected say fifteen years ago when such questions were legitimately being given as JavaScript programming homework and at the correct way to answer the question now - which likely as not doesn't teach what the homework is supposed to be teaching. The second series looks at the half of programming that is rarely taught at all - problem solving. You can expect to see a lot more articles added to both these series in coming months. Note that this doesn't mean that I am going to ignore everything else. If you have something you'd like me to write about please let me know.

What's New

The following links will take you to all of the various pages that have been added to the site or undergone major changes in the last month.

Main Links

Ask Felgall
Past Newsletters
Sign Up/Unsubscribe
Question Forum


Interactive Web
PC Software
Comms Software
Word Processing
Book Reviews

Other Links

My Javascript Site
My Blog