Jump to content
xisto Community
vujsa

Good Comments Make Good Html. Commenting makes HTML easier to write.

Recommended Posts

Comments make the code. HTML comments aren't very widely used, but they do help, especially if you plan on modifying your layout in the future. It's also a good practice to comment the end of your functions (php, c++, java, etc) and the beginning to display what they actually do. While loops, foreach loops, if statements all pose a threat of error. All it takes is overlooking that one little '}' and there you have it. ERROR. Good advice on the comments, although I personally think you can have too many comments. Keep it informative and direct. Don't make half your document comments. =/For a nice free text editor, I recommend HTMLKit from Chami. When you put in your javascript it automatically puts in the comment to keep older browsers from reading your script. It's a very nice editor, and very customizable. Lots of plugins for php as well. I recently used notepad++ and it's pretty good for all kinds of languages, and you can minimize your blocks effectively.

Share this post


Link to post
Share on other sites

Comments make the code. HTML comments aren't very widely used, but they do help, especially if you plan on modifying your layout in the future. It's also a good practice to comment the end of your functions (php, c++, java, etc) and the beginning to display what they actually do. While loops, foreach loops, if statements all pose a threat of error. All it takes is overlooking that one little '}' and there you have it. ERROR. Good advice on the comments, although I personally think you can have too many comments. Keep it informative and direct. Don't make half your document comments. =/
For a nice free text editor, I recommend HTMLKit from Chami. When you put in your javascript it automatically puts in the comment to keep older browsers from reading your script. It's a very nice editor, and very customizable. Lots of plugins for php as well. I recently used notepad++ and it's pretty good for all kinds of languages, and you can minimize your blocks effectively.


When it comes to java code and stuff like that, I never comment the end of a loop because most IDE's are capable of highlighting the end of a block and code indendation makes these things even more clear.
For HTML code on the other hand I sometime do mark the end of large div's and large tables, but only when those elements are used for layout purposes.


I almost never use comments in html unless i want to make a comment for myself.. the output php shows me as html is usually different and stuff, i never watch it, only to make valid and clean in the making period, and later when everything runs smooth i never watch the source.. maybe it is due to my html is never being very complicated, i just see it with my eyes as a web browser :D but comments due help, even if it is said: "a real programmer does not need comments, the code is obvious to him" but sometimes the codes i wrote say a year back is not so understandable, that is why I started to write comments and another reason is because i might work with other people who will edit/write it too.


Hehe, same idea :) . I still hardly use any HTML comments, even when multiple developers are working on the same project. Html comment doesn't stand out of the rest of you're code (since it's just another tag) so added a lot of comment doesn't make thing better.
We also hardly change the layout of our pages so there's no need to know what does what and why certain things are there. In case we need to change something we just start our reverse engineering using FireBug, this works much faster than understanding comments you wrote a year ago :P .

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.