View Full Version : coding your text

03-31-2003, 02:55 PM
I know we should always code our script. I am worried about over coding....Tell me what you think of this small script:

<script language="javascript">
** Get Rid of Box Around Links! **
** This Script will remove ** Cycles through all the **
** the box that appears ** links in the page and **
** around links whenever ** adds this line to it: **
** you click them. ** onFocus="this.blur();" **
onload = function() {
for (i=0;i<a_tags.length;i++) {

function blur_links() {
** END - Get Rid of Box Around Links! **

Does that look "over coded"?

03-31-2003, 02:57 PM
try this:

03-31-2003, 03:33 PM
I think the comments are a little over loaded.
Try getting rid of some of those asterisks.

I personally like to have block comments.

/* Like you have your
explanation of the script
in here */

03-31-2003, 03:57 PM
That's true, for a real small script such as yours, the commenting is excessive, try to keep the commenting less than the code.

Also, you might want to look at the indenting, for later on when you have to nest a lot of stuff.

Otherwise your code itself is not excessive, as long as it gets the job done, and you keep it on the minimum duration of big Oh.


03-31-2003, 04:11 PM
For web scripting languages comments right now should be kept to a minimum and only as necessary. Necessary meaning explain in optional or confiruation portions of the script that they user needs to modify in order to use it. Every extra character you put in is another character that has to be downloaded.

In standalone software programming using a high level language it is just the opposite....plenty of comments are good to explain each piece of coding.

03-31-2003, 04:39 PM
right now

03-31-2003, 05:53 PM
Originally posted by Mhtml

oh yeah I forgot to expand on that thought. lol I meant right now as in since not everybody is using broadband connections. If everybody is using broadband connections then having a script that has 50k of comments for example won't really be a big deal.

03-31-2003, 10:09 PM
I am worried about filesize. So, I just plan to keep a very commented version on my C:// and remove comments as I put ti up for webpage