<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.3" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: Do you validate your JavaScript code?</title>
	<link>http://www.robertnyman.com/2008/04/17/do-you-validate-your-javascript-code/</link>
	<description>Web development and Internet trends</description>
	<pubDate>Sun, 27 Jul 2008 07:52:31 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3</generator>
		<item>
		<title>By: How to avoid automatic type conversion in JavaScript - Robert&#8217;s talk - Web development and Internet trends</title>
		<link>http://www.robertnyman.com/2008/04/17/do-you-validate-your-javascript-code/#comment-274588</link>
		<dc:creator>How to avoid automatic type conversion in JavaScript - Robert&#8217;s talk - Web development and Internet trends</dc:creator>
		<pubDate>Fri, 16 May 2008 07:02:40 +0000</pubDate>
		<guid>http://www.robertnyman.com/2008/04/17/do-you-validate-your-javascript-code/#comment-274588</guid>
		<description>[...] By using three equal signs or one exclamation sign and two equal signs, it also makes sure to compare if the values are of the same type or not, i.e. both being numbers, strings etc. This is also a practice recommended when working with JSLInt. [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] By using three equal signs or one exclamation sign and two equal signs, it also makes sure to compare if the values are of the same type or not, i.e. both being numbers, strings etc. This is also a practice recommended when working with JSLInt. [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Nyman</title>
		<link>http://www.robertnyman.com/2008/04/17/do-you-validate-your-javascript-code/#comment-256165</link>
		<dc:creator>Robert Nyman</dc:creator>
		<pubDate>Thu, 24 Apr 2008 08:29:25 +0000</pubDate>
		<guid>http://www.robertnyman.com/2008/04/17/do-you-validate-your-javascript-code/#comment-256165</guid>
		<description>Anders,

Great to know! I don't use Aptana myself, but it's always good to have options and know what tools are available within them.</description>
		<content:encoded><![CDATA[<p>Anders,</p>
<p>Great to know! I don&#8217;t use Aptana myself, but it&#8217;s always good to have options and know what tools are available within them.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anders Ytterström</title>
		<link>http://www.robertnyman.com/2008/04/17/do-you-validate-your-javascript-code/#comment-256106</link>
		<dc:creator>Anders Ytterström</dc:creator>
		<pubDate>Thu, 24 Apr 2008 06:52:57 +0000</pubDate>
		<guid>http://www.robertnyman.com/2008/04/17/do-you-validate-your-javascript-code/#comment-256106</guid>
		<description>FYI: Aptana users (the standalone version or Eclipse with Aptana plugin) have JSLint installed by default. It is not activated by default though.

It is activated by going into the preferences and via Aptana &#62; Editors &#62; JavaScript &#62; Validation &#62; JSLint JavaScript Validator.</description>
		<content:encoded><![CDATA[<p>FYI: Aptana users (the standalone version or Eclipse with Aptana plugin) have JSLint installed by default. It is not activated by default though.</p>
<p>It is activated by going into the preferences and via Aptana &gt; Editors &gt; JavaScript &gt; Validation &gt; JSLint JavaScript Validator.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Nyman</title>
		<link>http://www.robertnyman.com/2008/04/17/do-you-validate-your-javascript-code/#comment-252046</link>
		<dc:creator>Robert Nyman</dc:creator>
		<pubDate>Fri, 18 Apr 2008 08:33:27 +0000</pubDate>
		<guid>http://www.robertnyman.com/2008/04/17/do-you-validate-your-javascript-code/#comment-252046</guid>
		<description>It might be experienced as picky to begin with, but there's a reason for it: to ensure best performance and compatibility.

And yes, integrating it into your development enviroment is a nice thing to do. :-)

Morgan,

yeah, me too. I'm also using it in TextMate, but sometimes go to the site for more options.

Andrea,

It is mainly about best practices, and then what's correcct code is sometimes differing between different web browsers' views. But I would say that you enctounter the sampe problems with CSS:

You have good nice valid code, which you then need to tweak for certain web browsers (thinking hasLayout fixes of other features).

Tommy,

As far as I know, the web browser support for &lt;code&gt;===&lt;/code&gt; is "complete". Meaning, I haven't yet encountered a web browser which doesn't support it, and using it's a great way to avoid conversion errors.

Andreas,

&lt;blockquote&gt;The number of errors JSLint throws can be intimidating at first but, just like with HTML-validation, after a while you learn to avoid and understand the errors and write code that’s error-free.&lt;/blockquote&gt;

Exactly! :-)

And yes, YSlow offers the option of JSLint-validating the JavaScript of the web page you have navigated too (and CSS validation as well).</description>
		<content:encoded><![CDATA[<p>It might be experienced as picky to begin with, but there&#8217;s a reason for it: to ensure best performance and compatibility.</p>
<p>And yes, integrating it into your development enviroment is a nice thing to do. <img src='http://www.robertnyman.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Morgan,</p>
<p>yeah, me too. I&#8217;m also using it in TextMate, but sometimes go to the site for more options.</p>
<p>Andrea,</p>
<p>It is mainly about best practices, and then what&#8217;s correcct code is sometimes differing between different web browsers&#8217; views. But I would say that you enctounter the sampe problems with CSS:</p>
<p>You have good nice valid code, which you then need to tweak for certain web browsers (thinking hasLayout fixes of other features).</p>
<p>Tommy,</p>
<p>As far as I know, the web browser support for <code>===</code> is &#8220;complete&#8221;. Meaning, I haven&#8217;t yet encountered a web browser which doesn&#8217;t support it, and using it&#8217;s a great way to avoid conversion errors.</p>
<p>Andreas,</p>
<blockquote><p>The number of errors JSLint throws can be intimidating at first but, just like with <acronym title="HyperText Markup Language">HTML</acronym>-validation, after a while you learn to avoid and understand the errors and write code that’s error-free.</p></blockquote>
<p>Exactly! <img src='http://www.robertnyman.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>And yes, YSlow offers the option of JSLint-validating the JavaScript of the web page you have navigated too (and <acronym title="Cascading Style Sheets">CSS</acronym> validation as well).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andreas</title>
		<link>http://www.robertnyman.com/2008/04/17/do-you-validate-your-javascript-code/#comment-251995</link>
		<dc:creator>Andreas</dc:creator>
		<pubDate>Fri, 18 Apr 2008 06:48:09 +0000</pubDate>
		<guid>http://www.robertnyman.com/2008/04/17/do-you-validate-your-javascript-code/#comment-251995</guid>
		<description>I JSLint most code I write but not if it's a really simple, short piece that I'm "sure" is error-free.

&lt;a href="http://code.google.com/p/aframework/" rel="nofollow"&gt;My framework&lt;/a&gt; automagically compresses all my JS using Dean Edwards JS-packer and if it doesn't validate in JSLint it normally throws errors compressed so I guess that's a form of validation.

Regardless, I almost always validate larger chunks of code and jQ plug-ins.

The number of errors JSLint throws can be intimidating at first but, just like with HTML-validation, after a while you learn to avoid and understand the errors and write code that's error-free.

BTW, I think YSlow comes with a JSLint tool. Or is it built into Firebug perhaps? There's a JSLint-option under "Tools" that validates your JS in a new window at least.</description>
		<content:encoded><![CDATA[<p>I JSLint most code I write but not if it&#8217;s a really simple, short piece that I&#8217;m &#8220;sure&#8221; is error-free.</p>
<p><a href="http://code.google.com/p/aframework/" rel="nofollow">My framework</a> automagically compresses all my JS using Dean Edwards JS-packer and if it doesn&#8217;t validate in JSLint it normally throws errors compressed so I guess that&#8217;s a form of validation.</p>
<p>Regardless, I almost always validate larger chunks of code and jQ plug-ins.</p>
<p>The number of errors JSLint throws can be intimidating at first but, just like with <acronym title="HyperText Markup Language">HTML</acronym>-validation, after a while you learn to avoid and understand the errors and write code that&#8217;s error-free.</p>
<p><acronym title="By The Way">BTW</acronym>, I think YSlow comes with a JSLint tool. Or is it built into Firebug perhaps? There&#8217;s a JSLint-option under &#8220;Tools&#8221; that validates your JS in a new window at least.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tommy Olsson</title>
		<link>http://www.robertnyman.com/2008/04/17/do-you-validate-your-javascript-code/#comment-251972</link>
		<dc:creator>Tommy Olsson</dc:creator>
		<pubDate>Fri, 18 Apr 2008 05:54:11 +0000</pubDate>
		<guid>http://www.robertnyman.com/2008/04/17/do-you-validate-your-javascript-code/#comment-251972</guid>
		<description>Thanks for the tip about JSLint, Robert! I'd never come across it before. I tried it with a tiny JavaScript library I've made and there were few serious complaints. I did discover two minor errors and one serious issue I need to look into.

BTW, how is browser support for the &lt;code&gt;===&lt;/code&gt; and &lt;code&gt;!==&lt;/code&gt; operators?</description>
		<content:encoded><![CDATA[<p>Thanks for the tip about JSLint, Robert! I&#8217;d never come across it before. I tried it with a tiny JavaScript library I&#8217;ve made and there were few serious complaints. I did discover two minor errors and one serious issue I need to look into.</p>
<p><acronym title="By The Way">BTW</acronym>, how is browser support for the <code>===</code> and <code>!==</code> operators?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrea Giammarchi</title>
		<link>http://www.robertnyman.com/2008/04/17/do-you-validate-your-javascript-code/#comment-251520</link>
		<dc:creator>Andrea Giammarchi</dc:creator>
		<pubDate>Thu, 17 Apr 2008 17:01:46 +0000</pubDate>
		<guid>http://www.robertnyman.com/2008/04/17/do-you-validate-your-javascript-code/#comment-251520</guid>
		<description>@Olly, what I mean, that is "only" for promoting good coding practises, because syntax checking, true syntax checking, is executed in a different way for each engine (for example, in some case a \n instead of a ; could be better to make runtime compilation faster ... or not? Who knows ...)

Anyway, I agree with you about limitations, but what I meant id that if JSLint says "your code is rubbish", it doesn't mean it truly is (while W3 validator, for example, is much more accurate).

Finally, thanks to Doug for this tool, but I could not ever integrate them in my JS development environment, for reasons I said :)</description>
		<content:encoded><![CDATA[<p>@Olly, what I mean, that is &#8220;only&#8221; for promoting good coding practises, because syntax checking, true syntax checking, is executed in a different way for each engine (for example, in some case a \n instead of a ; could be better to make runtime compilation faster &#8230; or not? Who knows &#8230;)</p>
<p>Anyway, I agree with you about limitations, but what I meant id that if JSLint says &#8220;your code is rubbish&#8221;, it doesn&#8217;t mean it truly is (while W3 validator, for example, is much more accurate).</p>
<p>Finally, thanks to Doug for this tool, but I could not ever integrate them in my JS development environment, for reasons I said <img src='http://www.robertnyman.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Olly</title>
		<link>http://www.robertnyman.com/2008/04/17/do-you-validate-your-javascript-code/#comment-251348</link>
		<dc:creator>Olly</dc:creator>
		<pubDate>Thu, 17 Apr 2008 11:52:59 +0000</pubDate>
		<guid>http://www.robertnyman.com/2008/04/17/do-you-validate-your-javascript-code/#comment-251348</guid>
		<description>&lt;a href="#comment-251332" rel="nofollow"&gt;@Andrea&lt;/a&gt; -- I'm not sure I understand your point. Yes, every JS engine does things slightly differently (just like HTML, CSS and internal combustion engines), but I don't think that's really what JSLint is all about.

It's more for syntax checking and promoting good coding practises. Think of it as an automated code review; obviously it's got it's limitations (just like any other automated validator), but it's a good starting point.</description>
		<content:encoded><![CDATA[<p><a href="#comment-251332" rel="nofollow">@Andrea</a> &#8212; I&#8217;m not sure I understand your point. Yes, every JS engine does things slightly differently (just like <acronym title="HyperText Markup Language">HTML</acronym>, <acronym title="Cascading Style Sheets">CSS</acronym> and internal combustion engines), but I don&#8217;t think that&#8217;s really what JSLint is all about.</p>
<p>It&#8217;s more for syntax checking and promoting good coding practises. Think of it as an automated code review; obviously it&#8217;s got it&#8217;s limitations (just like any other automated validator), but it&#8217;s a good starting point.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrea Giammarchi</title>
		<link>http://www.robertnyman.com/2008/04/17/do-you-validate-your-javascript-code/#comment-251332</link>
		<dc:creator>Andrea Giammarchi</dc:creator>
		<pubDate>Thu, 17 Apr 2008 11:18:21 +0000</pubDate>
		<guid>http://www.robertnyman.com/2008/04/17/do-you-validate-your-javascript-code/#comment-251332</guid>
		<description>JSLint is a good tool, but it's not perfect.

var a = this.b = function(){}; // what's wrong? ... maybe nothing?

Anyway, applied rules are usually good practices, but we should consider how specific browser JS engine implements our code, because everyone does it in a different way.

What I mean is how can we have a perfect "JS ruler" if every JS engine parses our code modifying them in a different way?</description>
		<content:encoded><![CDATA[<p>JSLint is a good tool, but it&#8217;s not perfect.</p>
<p>var a = this.b = function(){}; // what&#8217;s wrong? &#8230; maybe nothing?</p>
<p>Anyway, applied rules are usually good practices, but we should consider how specific browser JS engine implements our code, because everyone does it in a different way.</p>
<p>What I mean is how can we have a perfect &#8220;JS ruler&#8221; if every JS engine parses our code modifying them in a different way?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pelle</title>
		<link>http://www.robertnyman.com/2008/04/17/do-you-validate-your-javascript-code/#comment-251320</link>
		<dc:creator>Pelle</dc:creator>
		<pubDate>Thu, 17 Apr 2008 10:48:26 +0000</pubDate>
		<guid>http://www.robertnyman.com/2008/04/17/do-you-validate-your-javascript-code/#comment-251320</guid>
		<description>Of course I use the online version of it for at least all of my external javascript files :) (sometimes I don't bother to validate the short codes I've written on pages).

I hadn't thought about using it with Eclipse yet though :)</description>
		<content:encoded><![CDATA[<p>Of course I use the online version of it for at least all of my external javascript files <img src='http://www.robertnyman.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> (sometimes I don&#8217;t bother to validate the short codes I&#8217;ve written on pages).</p>
<p>I hadn&#8217;t thought about using it with Eclipse yet though <img src='http://www.robertnyman.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Morgan Roderick</title>
		<link>http://www.robertnyman.com/2008/04/17/do-you-validate-your-javascript-code/#comment-251298</link>
		<dc:creator>Morgan Roderick</dc:creator>
		<pubDate>Thu, 17 Apr 2008 10:11:05 +0000</pubDate>
		<guid>http://www.robertnyman.com/2008/04/17/do-you-validate-your-javascript-code/#comment-251298</guid>
		<description>I use it from within Textmate ... it'll bitch at me whenever I save a file with errors or warnings :-)</description>
		<content:encoded><![CDATA[<p>I use it from within Textmate &#8230; it&#8217;ll bitch at me whenever I save a file with errors or warnings <img src='http://www.robertnyman.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kilian Valkhof</title>
		<link>http://www.robertnyman.com/2008/04/17/do-you-validate-your-javascript-code/#comment-251296</link>
		<dc:creator>Kilian Valkhof</dc:creator>
		<pubDate>Thu, 17 Apr 2008 10:05:32 +0000</pubDate>
		<guid>http://www.robertnyman.com/2008/04/17/do-you-validate-your-javascript-code/#comment-251296</guid>
		<description>I actually hadn't heard of jslint and relied on firebug for testing javascript (that and "if it doesn't work, I should probably fix it"). 

This is very helpful so I'm going to use it from now on. It gave a lot of errors on a script I'm working on now, but it didn't *really* hurt my feelings. I resolved all problems and learned some things to boot. :)</description>
		<content:encoded><![CDATA[<p>I actually hadn&#8217;t heard of jslint and relied on firebug for testing javascript (that and &#8220;if it doesn&#8217;t work, I should probably fix it&#8221;). </p>
<p>This is very helpful so I&#8217;m going to use it from now on. It gave a lot of errors on a script I&#8217;m working on now, but it didn&#8217;t *really* hurt my feelings. I resolved all problems and learned some things to boot. <img src='http://www.robertnyman.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mats Lindblad</title>
		<link>http://www.robertnyman.com/2008/04/17/do-you-validate-your-javascript-code/#comment-251290</link>
		<dc:creator>Mats Lindblad</dc:creator>
		<pubDate>Thu, 17 Apr 2008 09:51:10 +0000</pubDate>
		<guid>http://www.robertnyman.com/2008/04/17/do-you-validate-your-javascript-code/#comment-251290</guid>
		<description>I have actually tried but JSLint is sooooooo picky.

I haven't been able to get it ALL right but most of it, if nothing else you get some good code convention pointers from JSLint. Like always using === and indenting with four spaces.</description>
		<content:encoded><![CDATA[<p>I have actually tried but JSLint is sooooooo picky.</p>
<p>I haven&#8217;t been able to get it ALL right but most of it, if nothing else you get some good code convention pointers from JSLint. Like always using === and indenting with four spaces.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Olly</title>
		<link>http://www.robertnyman.com/2008/04/17/do-you-validate-your-javascript-code/#comment-251280</link>
		<dc:creator>Olly</dc:creator>
		<pubDate>Thu, 17 Apr 2008 09:35:00 +0000</pubDate>
		<guid>http://www.robertnyman.com/2008/04/17/do-you-validate-your-javascript-code/#comment-251280</guid>
		<description>Oooh, nice tip for the external dependencies, I've been ignoring those errors ;-)

The main reason I use JSLint is to make sure my Javascript is "valid" before pushing it through something like &lt;a href="http://dean.edwards.name/packer/" rel="nofollow"&gt;Packer&lt;/a&gt;. I had a few instances where I'd missed a semicolon or something, which wasn't a problem until the script got compressed.</description>
		<content:encoded><![CDATA[<p>Oooh, nice tip for the external dependencies, I&#8217;ve been ignoring those errors <img src='http://www.robertnyman.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>The main reason I use JSLint is to make sure my Javascript is &#8220;valid&#8221; before pushing it through something like <a href="http://dean.edwards.name/packer/" rel="nofollow">Packer</a>. I had a few instances where I&#8217;d missed a semicolon or something, which wasn&#8217;t a problem until the script got compressed.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
