<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: JSLint puked on my javascript!</title>
	<atom:link href="http://unscriptable.com/2010/04/06/jslint-puked-on-my-javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://unscriptable.com/2010/04/06/jslint-puked-on-my-javascript/</link>
	<description>Just another WordPress site</description>
	<lastBuildDate>Wed, 25 Jan 2012 04:45:41 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: John H</title>
		<link>http://unscriptable.com/2010/04/06/jslint-puked-on-my-javascript/#comment-107</link>
		<dc:creator>John H</dc:creator>
		<pubDate>Tue, 13 Apr 2010 11:52:43 +0000</pubDate>
		<guid isPermaLink="false">http://unscriptable.com/?p=568#comment-107</guid>
		<description>Hey James,

Heh, the old Netscape specs are kinda &lt;em&gt;loose&lt;/em&gt;.  In a recent &lt;a href=&quot;http://webreflection.blogspot.com/2010/02/arguments-callee-call-and-apply.html&quot; rel=&quot;nofollow&quot;&gt;blog post&lt;/a&gt;, Andrea Giammarchi reminded me that &lt;code&gt;if (x == null)&lt;/code&gt; is the same as writing &lt;code&gt;if (x == null &#124;&#124; x == undefined)&lt;/code&gt; (and also removes your responsibility of ensuring that undefined is really undefined.)  Once in a while I&#039;ll use that if I don&#039;t care about whether the next developer understands Javascript&#039;s many coercion nuances.  

You&#039;re certainly right about just using &lt;code&gt;if (obj)&lt;/code&gt; some times.  If the docmentation clearly states that we&#039;re expecting an object for a parameter (or something else that won&#039;t coerce ambiguously), I&#039;ll use that.  Until ES5, it&#039;s by far the fastest and lightest way to detect missing args -- and, imho, the easiest to read. :)</description>
		<content:encoded><![CDATA[<p>Hey James,</p>
<p>Heh, the old Netscape specs are kinda <em>loose</em>.  In a recent <a href="http://webreflection.blogspot.com/2010/02/arguments-callee-call-and-apply.html" rel="nofollow">blog post</a>, Andrea Giammarchi reminded me that <code>if (x == null)</code> is the same as writing <code>if (x == null || x == undefined)</code> (and also removes your responsibility of ensuring that undefined is really undefined.)  Once in a while I&#8217;ll use that if I don&#8217;t care about whether the next developer understands Javascript&#8217;s many coercion nuances.  </p>
<p>You&#8217;re certainly right about just using <code>if (obj)</code> some times.  If the docmentation clearly states that we&#8217;re expecting an object for a parameter (or something else that won&#8217;t coerce ambiguously), I&#8217;ll use that.  Until ES5, it&#8217;s by far the fastest and lightest way to detect missing args &#8212; and, imho, the easiest to read. <img src='http://unscriptable.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John H</title>
		<link>http://unscriptable.com/2010/04/06/jslint-puked-on-my-javascript/#comment-106</link>
		<dc:creator>John H</dc:creator>
		<pubDate>Tue, 13 Apr 2010 11:41:51 +0000</pubDate>
		<guid isPermaLink="false">http://unscriptable.com/?p=568#comment-106</guid>
		<description>Ok, so like 95% of the world insists on braces.  Sheesh.  (Including at least one minifier -- although I haven&#039;t encountered it.) 

So now I&#039;m trying to use braces for one-liners.  Maybe I&#039;ll get used to it.  

&lt;em&gt;Eventually.&lt;/em&gt;  :P

(@Pankaj, yah, I found the bug the old-fashioned way: alert() statements!)</description>
		<content:encoded><![CDATA[<p>Ok, so like 95% of the world insists on braces.  Sheesh.  (Including at least one minifier &#8212; although I haven&#8217;t encountered it.) </p>
<p>So now I&#8217;m trying to use braces for one-liners.  Maybe I&#8217;ll get used to it.  </p>
<p><em>Eventually.</em>  <img src='http://unscriptable.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>(@Pankaj, yah, I found the bug the old-fashioned way: alert() statements!)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pankaj</title>
		<link>http://unscriptable.com/2010/04/06/jslint-puked-on-my-javascript/#comment-105</link>
		<dc:creator>Pankaj</dc:creator>
		<pubDate>Mon, 12 Apr 2010 14:58:13 +0000</pubDate>
		<guid isPermaLink="false">http://unscriptable.com/?p=568#comment-105</guid>
		<description>Hey John, Nice post.
You might have observed during the time we interacted - I too write my code with braces, whenever possible. I still feel it is easier to read code that way.
BTW, you did nail the IE-only bug right?</description>
		<content:encoded><![CDATA[<p>Hey John, Nice post.<br />
You might have observed during the time we interacted &#8211; I too write my code with braces, whenever possible. I still feel it is easier to read code that way.<br />
BTW, you did nail the IE-only bug right?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jordan</title>
		<link>http://unscriptable.com/2010/04/06/jslint-puked-on-my-javascript/#comment-104</link>
		<dc:creator>Jordan</dc:creator>
		<pubDate>Wed, 07 Apr 2010 16:04:04 +0000</pubDate>
		<guid isPermaLink="false">http://unscriptable.com/?p=568#comment-104</guid>
		<description>When you intend to do that things that JSLint thinks are wrong, you can indicate it in the code and the tool will not warn you:

var test = 0;
/*jslint: eqeqeq: false */
if (test == false) { /*jslint: eqeqeq: true */
  doStuff();
}
/*jslint plusplus: false */
for (test = 0; test &lt; 5; ++test) { /*jslint plusplus: true */
  doMoreStuff()
}

Of course, there doesn&#039;t seem to be an option to allow == null - since null and undefined are distinct values, &quot;typeof(test) === &#039;undefined&#039; &#124;&#124; test === null&quot; indicates to the next programmer (with fewer bytes than a comment) that you know precisely what your variable should contain.

Definitely agree with #3 - if you post your issue on http://tech.groups.yahoo.com/group/jslint_com/ Douglas usually responds very quickly.</description>
		<content:encoded><![CDATA[<p>When you intend to do that things that JSLint thinks are wrong, you can indicate it in the code and the tool will not warn you:</p>
<p>var test = 0;<br />
/*jslint: eqeqeq: false */<br />
if (test == false) { /*jslint: eqeqeq: true */<br />
  doStuff();<br />
}<br />
/*jslint plusplus: false */<br />
for (test = 0; test &lt; 5; ++test) { /*jslint plusplus: true */<br />
  doMoreStuff()<br />
}</p>
<p>Of course, there doesn&#039;t seem to be an option to allow == null &#8211; since null and undefined are distinct values, &quot;typeof(test) === &#039;undefined&#039; || test === null&quot; indicates to the next programmer (with fewer bytes than a comment) that you know precisely what your variable should contain.</p>
<p>Definitely agree with #3 &#8211; if you post your issue on <a href="http://tech.groups.yahoo.com/group/jslint_com/" rel="nofollow">http://tech.groups.yahoo.com/group/jslint_com/</a> Douglas usually responds very quickly.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James Padolsey</title>
		<link>http://unscriptable.com/2010/04/06/jslint-puked-on-my-javascript/#comment-103</link>
		<dc:creator>James Padolsey</dc:creator>
		<pubDate>Wed, 07 Apr 2010 14:21:33 +0000</pubDate>
		<guid isPermaLink="false">http://unscriptable.com/?p=568#comment-103</guid>
		<description>I&#039;m not sure what specs you were looking at but ECMAScript defines the following syntax:

if ( Expression ) Statement else Statement 
if ( Expression ) Statement

{...} (a block) is technically a statement in itself (a statement that contains statements). I tend to use blocks because, oddly, I find them more readable.

With the variable declaring issue, I always opt for declaring ALL variables at the top of the function -- you may as well, considering that they&#039;re all going to be &quot;hoisted&quot; there anyway...

I&#039;ve never had to use obj == null ... most of the time this is exactly the same as just &quot;obj&quot; in a boolean context. (i.e. if(obj){...} or !!obj).</description>
		<content:encoded><![CDATA[<p>I&#8217;m not sure what specs you were looking at but ECMAScript defines the following syntax:</p>
<p>if ( Expression ) Statement else Statement<br />
if ( Expression ) Statement</p>
<p>{&#8230;} (a block) is technically a statement in itself (a statement that contains statements). I tend to use blocks because, oddly, I find them more readable.</p>
<p>With the variable declaring issue, I always opt for declaring ALL variables at the top of the function &#8212; you may as well, considering that they&#8217;re all going to be &#8220;hoisted&#8221; there anyway&#8230;</p>
<p>I&#8217;ve never had to use obj == null &#8230; most of the time this is exactly the same as just &#8220;obj&#8221; in a boolean context. (i.e. if(obj){&#8230;} or !!obj).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tweets that mention JSLint puked on my javascript! &#124; Unscriptable.com -- Topsy.com</title>
		<link>http://unscriptable.com/2010/04/06/jslint-puked-on-my-javascript/#comment-102</link>
		<dc:creator>Tweets that mention JSLint puked on my javascript! &#124; Unscriptable.com -- Topsy.com</dc:creator>
		<pubDate>Wed, 07 Apr 2010 13:54:35 +0000</pubDate>
		<guid isPermaLink="false">http://unscriptable.com/?p=568#comment-102</guid>
		<description>[...] This post was mentioned on Twitter by John Hann, integralist. integralist said: RT @unscriptable: #JSLint puked on my #javascript! http://bit.ly/aqTrzG [...] </description>
		<content:encoded><![CDATA[<p>[...] This post was mentioned on Twitter by John Hann, integralist. integralist said: RT @unscriptable: #JSLint puked on my #javascript! <a href="http://bit.ly/aqTrzG" rel="nofollow">http://bit.ly/aqTrzG</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Krof Drakula</title>
		<link>http://unscriptable.com/2010/04/06/jslint-puked-on-my-javascript/#comment-101</link>
		<dc:creator>Krof Drakula</dc:creator>
		<pubDate>Wed, 07 Apr 2010 12:32:13 +0000</pubDate>
		<guid isPermaLink="false">http://unscriptable.com/?p=568#comment-101</guid>
		<description>Not sure about those points; but you can always address those issues on the JSLint group list at http://tech.groups.yahoo.com/group/jslint_com/ – Crockford personally oversees all the suggestions and usually integrates patches, fixes and enhancements in a matter of days.

Gotta hand it to Doug, he&#039;s sure streamlined the work he does on JSLint. ;)</description>
		<content:encoded><![CDATA[<p>Not sure about those points; but you can always address those issues on the JSLint group list at <a href="http://tech.groups.yahoo.com/group/jslint_com/" rel="nofollow">http://tech.groups.yahoo.com/group/jslint_com/</a> – Crockford personally oversees all the suggestions and usually integrates patches, fixes and enhancements in a matter of days.</p>
<p>Gotta hand it to Doug, he&#8217;s sure streamlined the work he does on JSLint. <img src='http://unscriptable.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob McDonagh</title>
		<link>http://unscriptable.com/2010/04/06/jslint-puked-on-my-javascript/#comment-100</link>
		<dc:creator>Rob McDonagh</dc:creator>
		<pubDate>Wed, 07 Apr 2010 12:21:00 +0000</pubDate>
		<guid isPermaLink="false">http://unscriptable.com/?p=568#comment-100</guid>
		<description>I always had trouble with minification tools whenever I skipped the curly braces in IF, so I started insisting my team use them. Maybe the tools have gotten smarter since then? The side benefit, of course, was that grouping/nesting problems (which plagued one colleague in particular) magically went away. heh.

PS Old Rasputin FTW!</description>
		<content:encoded><![CDATA[<p>I always had trouble with minification tools whenever I skipped the curly braces in IF, so I started insisting my team use them. Maybe the tools have gotten smarter since then? The side benefit, of course, was that grouping/nesting problems (which plagued one colleague in particular) magically went away. heh.</p>
<p>PS Old Rasputin FTW!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John H</title>
		<link>http://unscriptable.com/2010/04/06/jslint-puked-on-my-javascript/#comment-99</link>
		<dc:creator>John H</dc:creator>
		<pubDate>Wed, 07 Apr 2010 11:46:15 +0000</pubDate>
		<guid isPermaLink="false">http://unscriptable.com/?p=568#comment-99</guid>
		<description>Hey Krof, thanks for the info about the configuration options.  I used the online version at &lt;a href=&quot;http://jslint.com/&quot; rel=&quot;nofollow&quot;&gt;http://jslint.com/&lt;/a&gt;.  It&#039;s got only a few configuration options.  I imagine if I download and run it locally, it might have options for some of the other items I encountered.  

For instance, it also didn&#039;t like that I used unescaped curly braces in my regular expressions or that I used escaped line endings in my strings.  I imagine those might break some of the dumber minification tools.  

I didn&#039;t see any options for those on the site.  I think they should put some text in the options to let users know. Something like &quot;Want more options to configure jslint?  Download it for full control.&quot;  Or something like that.</description>
		<content:encoded><![CDATA[<p>Hey Krof, thanks for the info about the configuration options.  I used the online version at <a href="http://jslint.com/" rel="nofollow">http://jslint.com/</a>.  It&#8217;s got only a few configuration options.  I imagine if I download and run it locally, it might have options for some of the other items I encountered.  </p>
<p>For instance, it also didn&#8217;t like that I used unescaped curly braces in my regular expressions or that I used escaped line endings in my strings.  I imagine those might break some of the dumber minification tools.  </p>
<p>I didn&#8217;t see any options for those on the site.  I think they should put some text in the options to let users know. Something like &#8220;Want more options to configure jslint?  Download it for full control.&#8221;  Or something like that.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Krof Drakula</title>
		<link>http://unscriptable.com/2010/04/06/jslint-puked-on-my-javascript/#comment-98</link>
		<dc:creator>Krof Drakula</dc:creator>
		<pubDate>Wed, 07 Apr 2010 06:31:55 +0000</pubDate>
		<guid isPermaLink="false">http://unscriptable.com/?p=568#comment-98</guid>
		<description>Well, looks like someone&#039;s feelings got hurt. :)

Joking aside, though, you can configure it so it only spits out errors and warnings that you do care about, which is what I respect about JSLint; not forcing itself upon the user with self-righteous demands. While I do agree with some of the points you&#039;ve raised (especially using clauses like the &#039;==&#039; you mentioned earlier), this tool is draconic for a reason – there&#039;s a myriad of developers who come from all sorts of backgrounds, and JSLint helps with the most common eyesores and no-nos.

While I agree, this tends to align itself with the way Apple treats its users (lock &#039;em out since they don&#039;t know what they&#039;re doing), but the fact that with a little configuration you can get only &quot;your&quot; good parts out of the parser, which makes it an excellent tool.</description>
		<content:encoded><![CDATA[<p>Well, looks like someone&#8217;s feelings got hurt. <img src='http://unscriptable.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Joking aside, though, you can configure it so it only spits out errors and warnings that you do care about, which is what I respect about JSLint; not forcing itself upon the user with self-righteous demands. While I do agree with some of the points you&#8217;ve raised (especially using clauses like the &#8216;==&#8217; you mentioned earlier), this tool is draconic for a reason – there&#8217;s a myriad of developers who come from all sorts of backgrounds, and JSLint helps with the most common eyesores and no-nos.</p>
<p>While I agree, this tends to align itself with the way Apple treats its users (lock &#8216;em out since they don&#8217;t know what they&#8217;re doing), but the fact that with a little configuration you can get only &#8220;your&#8221; good parts out of the parser, which makes it an excellent tool.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

