Dec 29 2008
Maintain a good coding habit
Nowdays creating a html has become quite easy and this can be created and edited in any text editor which is capable of exporting it as text file. As these codes are no different than a text files. If you are going to write a webpage before you move further, consider these tips that will help you maintain a good coding habits. I sure these tips will help to write your pages better.
1.) Use liberal white space: Insert liberal line breaks to seperate code sections and use spaces to indent subsequent elements so that it give you better readability and uderstanding of codes.
2.)Â Use a well formatted html document: Well formatted html code is nothing but are the characterized way of your document as mention below
a. Contains a <doctype> tag
b. All elements must be nested not overlapping means the tags should be closed in the way are created.
c. Always name your document in lowercase as html is case sensitive. For the variables and attributes described in lowercase will help you minimize your typing errors.
d. Avoid using empty elements they are not valid
For ex.
This is one element <p> this is another</p>
In the example above the first segment is not valid
e. All attributes values must be quoted with in the brackets.
ex. <table brder = 0>
<table border=”0″>
f. Any empty tag must have a closing tab or the opening tag must end with a slash(/).
3. Make your habit to enter comments whenever there is need to do so as this will help you when you revised your code or when you need to change it.
4. Creating the basic structure: The basic structure for all html document is the same and should include the minimum elements and tags.
a. <doctype>
b. <HTML>
c. <head>
d. <body>
5. Providing information to search engine: Always include at least a minimum amount of imformation in your document to aid search engines in correcting categorized your documents. SEarch engines like Google list the provied description and keywords which are related to your document.
6. Setting the defalt path: Always make a habit of defining links and references in your HTML document as exact as possible. You should include the full protocol of links or image when defining them.





