HighDots Forums  

Re: RFD: How To Recognize Bad Javascript Code

Javascript JavaScript language (comp.lang.javascript)


Discuss Re: RFD: How To Recognize Bad Javascript Code in the Javascript forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
-Lost
 
Posts: n/a

Default Re: RFD: How To Recognize Bad Javascript Code - 01-02-2008 , 09:08 PM






Response to Jeremy J Starcher <r3jjs (AT) yahoo (DOT) spam.me.not.com>:

Quote:
"When I first started to learn Javascript, I turned to Google for
examples and code snippets." - that's an almost completely
reliable way of getting bad code.
<snip>

Quote:
Google for exactly "other critical date lists at Cinderella" to
see what I mean.
He is more right than you can possibly imagine.

Quote:
I will Google for that later. Do you have a licence template
that you recommend?
Has "Merlyn" grown so expansive that the doctor must now direct
people to Google rather than citing a precise URL?

http://www.merlyn.demon.co.uk/critdate.htm#CDs

OK, enough picking on him. I'm amazed that I knew exactly what he
was referring to.

Anyway... use something that claims ownership, does not allow
modification, but can be shared wherever or reproduced in its
entirety.

Concerning the Function constructor and the with operator -- you said
mention something if anyone feels it is wrong to ignore it...

....it is wrong to ignore it.

If you "care" enough to mention eval and its misuse, then you care
enough to illustrate the misuse and overhead of Function.

And aside from "JavaScript from Hell," you can find SEVERAL if not
tens of articles by leaders in the JavaScript community who can
relate some of their experiences, problems, and ideas about "with."

Ping: RobG, David Mark, Randy Webb, Richard Cornford, Douglas
Crockford, Ron Hall, Evertjan, Gérard Talbot, Garret Smith...

....and by ping, I mean look them up in this group and what they may
or may not have said about "with" or start an entirely new article
something to the effect of: "Why the with operator is evil?" It'll
fill up faster than you can copy and paste I'm sure.

Articles: Dustian Diaz, Patrick Hunlock, Nate Koechley, Justin
Palmer, Andrew Dupont, Jonathan Snook... the list goes on and on.

</inebriated rambling>

Good luck. I think an "avoid these mistakes" article is 100x better
than a "best practices" for a beginner anyway.

--
-Lost
Remove the extra words to reply by e-mail. Don't e-mail me. I am
kidding. No I am not.


Reply With Quote
  #2  
Old   
Jeremy J Starcher
 
Posts: n/a

Default Re: RFD: How To Recognize Bad Javascript Code - 01-02-2008 , 09:51 PM






On Wed, 02 Jan 2008 21:08:18 -0600, -Lost wrote:

[ In reference to distribution rights and Dr J R Stockton's warning ]

Quote:
He is more right than you can possibly imagine.
I've been doing a bit of Googling on that issue. I'm beginning to see.

Thank you for the reference.

Quote:
Anyway... use something that claims ownership, does not allow
modification, but can be shared wherever or reproduced in its entirety.
I've been looking into that.

Quote:
Concerning the Function constructor and the with operator -- you said
mention something if anyone feels it is wrong to ignore it...

...it is wrong to ignore it.
<snip>

Seems there have been a few very strong comments in regard to the "with"
operator. I'm beginning to see a pattern.

My biggest reason for not wanting to include it is that I haven't seen it
used very often, it seemed a rarer kind of bad code. I'm starting to
think it might be worth mentioning.

Quote:
Good luck. I think an "avoid these mistakes" article is 100x better
than a "best practices" for a beginner anyway.
Glad to hear someone agree with me in a "thus stated" kind of way.

My plans for updating the document tonight got pushed aside, thanks to
work related issues.


Reply With Quote
  #3  
Old   
Randy Webb
 
Posts: n/a

Default Re: RFD: How To Recognize Bad Javascript Code - 01-03-2008 , 07:12 AM



-Lost said the following on 1/2/2008 10:08 PM:
Quote:
Response to Jeremy J Starcher <r3jjs (AT) yahoo (DOT) spam.me.not.com>:

"When I first started to learn Javascript, I turned to Google for
examples and code snippets." - that's an almost completely
reliable way of getting bad code.

snip

Google for exactly "other critical date lists at Cinderella" to
see what I mean.

He is more right than you can possibly imagine.

I will Google for that later. Do you have a licence template
that you recommend?

Has "Merlyn" grown so expansive that the doctor must now direct
people to Google rather than citing a precise URL?

http://www.merlyn.demon.co.uk/critdate.htm#CDs

OK, enough picking on him. I'm amazed that I knew exactly what he
was referring to.
You did? What John was referring to is that if you google that exact
phrase, you get two hits. One is his, the other is an outdated old copy
of his. If the second site had used a link to the original, then readers
of the second site wouldn't be getting outdated information.

John isn't the best person at simply stating what he means.

<snip>

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/


Reply With Quote
  #4  
Old   
-Lost
 
Posts: n/a

Default Re: RFD: How To Recognize Bad Javascript Code - 01-03-2008 , 02:52 PM



Response to Randy Webb <HikksNotAtHome (AT) aol (DOT) com>:

Quote:
OK, enough picking on him. I'm amazed that I knew exactly what
he was referring to.

You did? What John was referring to is that if you google that
exact phrase, you get two hits. One is his, the other is an
outdated old copy of his. If the second site had used a link to
the original, then readers of the second site wouldn't be getting
outdated information.
Oops, then no, I was off a bit. I knew he meant to illustrate an
outdated copy, but thought the point was to have a particular
licensing scheme -- so I pointed straight to the URL (I thought was
in question) so Jeremy could see a license (if it exists).

I didn't even bother to look, just grabbed the critical date
(Cinderella) link that was recently in my History.

In usual fashion I saw the point, but missed the goal.

Quote:
John isn't the best person at simply stating what he means.
There's not too much more that can be said about that one. Heh.

--
-Lost
Remove the extra words to reply by e-mail. Don't e-mail me. I am
kidding. No I am not.


Reply With Quote
  #5  
Old   
Dr J R Stockton
 
Posts: n/a

Default Re: RFD: How To Recognize Bad Javascript Code - 01-03-2008 , 03:10 PM



In comp.lang.javascript message <Xns9A19E17C14CF3lostthreads (AT) 216 (DOT) 196.97.
136>, Wed, 2 Jan 2008 21:08:18, -Lost <maventheextrawords (AT) techie (DOT) com>
posted:


Quote:
Google for exactly "other critical date lists at Cinderella" to
see what I mean.

He is more right than you can possibly imagine.

I will Google for that later. Do you have a licence template
that you recommend?

Has "Merlyn" grown so expansive that the doctor must now direct
people to Google rather than citing a precise URL?
You seem to have missed the point : I was not intending to incite people
to read the content, merely to see where on the Web it can be found.


Quote:
Anyway... use something that claims ownership, does not allow
modification, but can be shared wherever or reproduced in its
entirety.
No; that authorises the keeping of stale copies, which is undesirable.



--
(c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 IE 6.
Web <URL:http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
I find MiniTrue useful for viewing/searching/altering files, at a DOS prompt;
free, DOS/Win/UNIX, <URL:http://www.idiotsdelight.net/minitrue/> unsupported.


Reply With Quote
  #6  
Old   
Dr J R Stockton
 
Posts: n/a

Default Re: RFD: How To Recognize Bad Javascript Code - 01-03-2008 , 03:24 PM



In comp.lang.javascript message <INydnV2_fbadQuHa4p2dnAA (AT) giganews (DOT) com>,
Thu, 3 Jan 2008 08:12:12, Randy Webb <HikksNotAtHome (AT) aol (DOT) com> posted:
Quote:
John isn't the best person at simply stating what he means.

Don't blame another for your inability to read my mother tongue in an
intelligent manner.

--
(c) John Stockton, Surrey, UK. ???@merlyn.demon.co.uk Turnpike v6.05 MIME.
Web <URL:http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
Check boilerplate spelling -- error is a public sign of incompetence.
Never fully trust an article from a poster who gives no full real name.


Reply With Quote
  #7  
Old   
Randy Webb
 
Posts: n/a

Default Re: RFD: How To Recognize Bad Javascript Code - 01-06-2008 , 10:06 PM



Dr J R Stockton said the following on 1/3/2008 4:24 PM:
Quote:
In comp.lang.javascript message <INydnV2_fbadQuHa4p2dnAA (AT) giganews (DOT) com>,
Thu, 3 Jan 2008 08:12:12, Randy Webb <HikksNotAtHome (AT) aol (DOT) com> posted:
John isn't the best person at simply stating what he means.


Don't blame another for your inability to read my mother tongue in an
intelligent manner.
Don't blame your ignorance on your mother tongue.

I think I can, I think I can, toooot toooot, I think I can.

Try harder.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.