Forum Moderators: mack

Message Too Old, No Replies

What does "bad code" mean?

         

johnneumann

9:33 am on Jan 31, 2004 (gmt 0)

10+ Year Member



I just read a review of Yahoo SiteBuilder, which gives new people like me the ability to drag and drop together a website without having to learn code. The reviewer said that he made a basic cookie cutter website using templates then added, "the code, of course, was terrible".

For someone who doesn't know anything about html or who hasn't yet designed his first site...how exactly does that present a problem? Does it make the site load slower? Does it alter the page on different browsers?

What does it mean that SiteBuilder creates "bad code" and what will I have to watch out for?

John Neumann

PCInk

10:31 am on Jan 31, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Bad code means errors. Code is made up of tags, many of which must be opened and closed or started and finished (i.e. start bold, stop bold etc...).

Some tags are complicated, like making tables. There are tags that start and finish a table and some that start and finish table rows. If this software produces code that starts a table, starts a row and then finishes a table, this is 'bad code' because the table row was not finished.

Order is also relevant. You should not start bold and italics and then finish bold and then finish italics. You should close the one you opened last:
* Start Bold, Start Italics, TEXT, Stop Bold, Stop Italics is incorrect
* Start Bold, Start Italics, TEXT, Stop Italics, Stop Bold is correct

Usually it makes little difference to some browsers, however bad code can cause some browsers to display things incorrectly, not at all or in some cases it has even been known to crash browsers (though this is very rare with the latest).

Netscape 4 had a bug which causes a table and anything following the table to not appear on the page if the closing table tag was not present. And if the end of HTML tag was missing, then the user would have the hourglass present all the time as Netscape only used to stop the hourglass when the page specifically stated that it was the end of the page. To the user, it looked as though there was more to your page but the internet connection had 'died'.

There are lots of browsers out there that people use for various reasons and the best way to ensure that most can display your page correctly is to write valid code (against bad code).

johnneumann

10:58 am on Jan 31, 2004 (gmt 0)

10+ Year Member



Thank you. Very thorough answer.

ram_mac

7:03 pm on Jan 31, 2004 (gmt 0)

10+ Year Member



You can also ensure that your code is valid by using:

[validator.w3.org...]

You can check live sites or upload code from your machine. Some of the answers it gives you can be a little cryptic but with a good book on HTML you should be able to work it out.