<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>jonathanjulian.com &#187; javascript</title>
	<atom:link href="http://jonathanjulian.com/category/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://jonathanjulian.com</link>
	<description>Ruby, Rails, JavaScript, software development</description>
	<lastBuildDate>Fri, 13 Jan 2012 21:03:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>My favorite parts of RubyNation 2011</title>
		<link>http://jonathanjulian.com/2011/04/my-favorite-parts-of-rubynation-2011/</link>
		<comments>http://jonathanjulian.com/2011/04/my-favorite-parts-of-rubynation-2011/#comments</comments>
		<pubDate>Mon, 04 Apr 2011 01:03:49 +0000</pubDate>
		<dc:creator>jonathan</dc:creator>
				<category><![CDATA[git]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://jonathanjulian.com/?p=294</guid>
		<description><![CDATA[RubyNation was held this past weekend in Reston VA, and it was a success for the fourth year in a row. For being a (relatively) small regional conference, we consistently get to see quality speakers and draw Rubyists from North Carolina all the way to Philadelphia (and much further, I&#8217;m sure). I&#8217;ve been every year [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://rubynation.org"><img alt="RubyNation 2011 badge" src="http://www.rubynation.org/images/conference/badges/2011/webBadgesConference.png" title="RubyNation 2011" class="alignright" width="180" height="135" /></a>
<a href="http://rubynation.org">RubyNation</a> was held this past weekend in Reston VA, and it was a success for the fourth year in a row. For being a (relatively) small regional conference, we consistently get to see quality speakers and draw Rubyists from North Carolina all the way to Philadelphia (and much further, I&#8217;m sure). I&#8217;ve been every year (it&#8217;s just a little over an hour from Baltimore), and I always have a great time. Here is what I thought were the best parts of RubyNation 2011.</p>

<h3>Hanging out with friends</h3>

<p>We always have a strong contingent of <a href="http://bmoreonrails.org">Bmore on Rails</a> folks at RubyNation. This weekend I twice received unsolicited praise that the Bmore on Rails group was &#8220;friendly and cohesive&#8221; and &#8220;one of the more fun local groups&#8221;. I&#8217;m paraphrasing, but it was awesome to hear that others see us this way. It&#8217;s true!</p>

<h3>Making new friends</h3>

<p>I can&#8217;t even count how many colleagues I&#8217;ve met at previous RubyNations! I don&#8217;t feel like I met <em>too</em> many new folks this year, but it&#8217;s still a big part of any local conference to me. If you met me (or even if you didn&#8217;t), make sure to keep in touch on twitter!</p>

<h3>The Talks</h3>

<p>I was lucky, I had already seen three of the sessions at Bmore on Rails in the last few months (&#8220;Fat Models Aren&#8217;t Enough&#8221; by <a href="http://jumpstartlab.com">Jeff Casimir</a>, &#8220;Confident Code&#8221; by <a href="http://avdi.org">Avdi Grimm</a>, and &#8220;KnowSQL: Database Tricks to Make Your Life Easier&#8221; by <a href="http://www.ngauthier.com/">Nick Gauthier</a>). This made it easy for me to see a couple of new talks.</p>

<h3>&#8220;Git: It&#8217;s All About the Trees, Baby&#8221; by <a href="http://scottchacon.com/">Scott Chacon</a></h3>

<p>Scott obviously knows git inside and out. The details are complex, and I&#8217;m mystified about it on a regular basis, even though I&#8217;ve been using it for over 3 years. I love how Scott slows down to ask, &#8220;Does that make sense?&#8221; after every difficult concept. I took feverish notes and re-read them a few times &#8211; after some digestion, yes, Scott, now it does make sense. I think. <a href="https://github.s3.amazonaws.com/presentations/three_trees.pdf">slides</a></p>

<h3>&#8220;Make Awesome Command Line Applications in Ruby&#8221; by <a href="http://www.naildrivin5.com/">David Copeland</a></h3>

<p>For some reason, this topic speaks to me. Maybe it was all the shell scripts I wrote early in my career, or my love for the &#8220;UNIX way&#8221; of building large systems from many small tools. This was one of those talks that probably snuck under the radar, but those who were there know that they took away a ton of knowledge. I&#8217;m looking forward to David&#8217;s upcoming PragProg book on the subject! <a href="http://awesome-cli-ruby.heroku.com/">slides</a></p>

<h3>&#8220;Search-Friendly Web Development&#8221; by <a href="http://luigimontanez.com/">Luigi Montanez</a></h3>

<p>It must be tough to be the first session of day 2 of a conference (wait, <a href="/2010/06/proof-that-i-was-at-jsconf-2010-hangover-js/">it is</a>). I wonder how many people were scared off by the thought of this being an &#8220;SEO&#8221; talk? Well, it was. And it was excellent. To web developers, SEO doesn&#8217;t have to be much more than checking off a few boxes. Really &#8211; it&#8217;s not crazy difficult. Luigi laid out 
a great plan to help your site be more successful: by optimizing crawling, indexing and ranking. 
I&#8217;ve been forced to learn a ton about this subject while working on <a href="http://replyz.com">replyz.com</a> &#8211; we have a footprint of close to 10 million urls, so managing searchability and the sitemaps has been one of my jobs for close to a year. Great job, Luigi! <a href="http://www.slideshare.net/luigimontanez/searchfriendly-web-development-at-rubynation">slides</a></p>

<h3>&#8220;The JavaScript Renaissance&#8221; by <a href="http://voodootikigod.com/">Chris Williams</a></h3>

<p>Chris is a showman. Did he really hand out 200 pirate hats? When his speakers weren&#8217;t loud enough, did he really voice-over <a href="http://www.youtube.com/watch?v=O2rGTXHvPCQ">the Numb3rs episode where they explain IRC</a>? And did he really convince a room full of Rubyists that their favorite language has strong competition from other programming languages? Yep.</p>

<h3>&#8220;Must. Try. Harder.&#8221; by <a href="http://www.keavy.co.uk/">Keavy McMinn</a></h3>

<p>Every conference needs at least one inspirational talk. And this one fit the bill perfectly. Keavy&#8217;s even-paced delivery and detailed descriptions of the agonies of triathlon training provided a great analogy to our software development careers. The video of the harrowing descent left the room silent for a full minute and a half. Well done!</p>

<h3>Jeff Casimir setting up his gear to take headshots</h3>

<p>Jeff is the coolest. He gives a brief lightning talk imploring everyone to use their <em>face</em> as their avatar, not a cartoon or a logo. Then he invites everyone to step out into the lobby where he has set up a temporary studio &#8211; complete with a backdrop and two remote flashes. Fifty people stepped up and got their photo taken, and Jeff posted the results to flickr the next morning. <strong>The next morning.</strong> Seriously, this guy is awesome. <strong>By the way, are you looking for Ruby or Rails training? Check out <a href="http://jumpstartlab.com/">Jumpstart Lab</a>.</strong> <em>(Also, why are so many folks afraid to step in front of a camera? You know we all can see you right now, right?)</em>
<br/>
<a href="http://www.flickr.com/photos/jcasimir/sets/72157626415670430/"><img alt="headshots taken by Jeff Casimir at RubyNation 2011" src="/wp-content/uploads/2011/04/j3-headshots.png" class="alignleft" width="420" style="margin-bottom:15px"/></a></p>

<h3>&#8220;Your code is awesome. Your copy sucks.&#8221;</h3>

<p>I love lightning talks &#8211; you never know what you&#8217;re gonna get, and the investment is low (5 minutes). This year my favorite was about copy writing (that&#8217;s the stuff between the tags that the user sees). Andrea from <a href="http://www.corgibytes.com/">corgibytes</a> let the uber-techie, male-dominated audience know that the words you write matter. I play the role of copy writer for a few minutes (!) every week, and I appreciate raising awareness about this under-appreciated skill.</p>

<h3>The Hacking</h3>

<p>There was considerably less code hacking this year &#8211; but we still fit some in. <a href="http://paulbarry.com/">Paul Barry</a> wrote a <a href="https://github.com/pjb3/Conflagration">Ruby chat server</a> in the few minutes leading up to Nick Gauthier&#8217;s talk. And I told <a href="http://webandy.com/">Andy Atkinson</a> my idea for listing members on <a href="http://bmoreonrails.org">bmoreonrails.org</a>, and he ran with it and started the feature! (hopefully we&#8217;ll have members listed on the site this week)</p>

<h3>The Party</h3>

<p>Github sponsored the drinks, Living Social sponsored the food. And it was at a Westin. Do I need to say more? If you were there, I&#8217;d love to hear your thoughts on the mini-burgers (I thought they were the coolest things ever).</p>

<h3>My Conclusion</h3>

<p>It was another fun local conference. Congrats to Gray Herter and David Keener and David Bock, and <a href="http://www.rubynation.org/organizers">everyone else</a> who organizes RubyNation every year. Keep in mind that these were <em>my</em> favorite parts of RubyNation &#8211; yours will most likely be different. What did you enjoy most about the conference? What did I miss?</p>
]]></content:encoded>
			<wfw:commentRss>http://jonathanjulian.com/2011/04/my-favorite-parts-of-rubynation-2011/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Proof that I was at JSConf 2010: Hangover.js</title>
		<link>http://jonathanjulian.com/2010/06/proof-that-i-was-at-jsconf-2010-hangover-js/</link>
		<comments>http://jonathanjulian.com/2010/06/proof-that-i-was-at-jsconf-2010-hangover-js/#comments</comments>
		<pubDate>Wed, 30 Jun 2010 21:40:38 +0000</pubDate>
		<dc:creator>jonathan</dc:creator>
				<category><![CDATA[Animal-print robe]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://jonathanjulian.com/?p=247</guid>
		<description><![CDATA[At 9am on Sunday, the folks that needed an easy start to their jsconf day 2 witnessed Hangover.js. I live-coded a simple lightbox, and a simple textarea character counter. The lights were low, the vibe was chill and relaxed. The code that was committed during the session can be found at http://github.com/jjulian/hangover_js_examples. Thanks to those [...]]]></description>
			<content:encoded><![CDATA[<p>At 9am on Sunday, the folks that needed an easy start to their jsconf day 2 witnessed Hangover.js. I live-coded a simple lightbox, and a simple textarea character counter. The lights were low, the vibe was chill and relaxed. The code that was committed during the session can be found at 
<a href="http://github.com/jjulian/hangover_js_examples">http://github.com/jjulian/hangover_js_examples</a>.</p>

<p>Thanks to those that hung out with me and helped me code these features (if I remember correctly, <a href="http://twitter.com/rektide">@rektide</a>, <a href="http://twitter.com/getify">@getify</a>, <a href="http://twitter.com/vinylfox">@vinylfox</a>)&#8230;and thanks to Track B for allowing non-mind-melting sessions <em>cough</em>sproutcore<em>cough</em> to be scheduled after a long night of pirate cruise swashbuckling!</p>

<p><embed src="http://blip.tv/play/g_MngemHQwI" type="application/x-shockwave-flash" width="440" height="346" allowscriptaccess="always" allowfullscreen="true"></embed></p>

<div style="width:425px" id="__ss_3791439"><strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/jonathanjulian/hangoverjs" title="Hangover.js">Hangover.js</a></strong><object id="__sse3791439" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=hangover-js-100420121318-phpapp02&#038;stripped_title=hangoverjs" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed name="__sse3791439" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=hangover-js-100420121318-phpapp02&#038;stripped_title=hangoverjs" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object><div style="padding:5px 0 12px">View more <a href="http://www.slideshare.net/">presentations</a> from <a href="http://www.slideshare.net/jonathanjulian">Jonathan Julian</a>.</div></div>
]]></content:encoded>
			<wfw:commentRss>http://jonathanjulian.com/2010/06/proof-that-i-was-at-jsconf-2010-hangover-js/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>New Ext JS book in the works</title>
		<link>http://jonathanjulian.com/2010/01/new-ext-js-book-in-the-works/</link>
		<comments>http://jonathanjulian.com/2010/01/new-ext-js-book-in-the-works/#comments</comments>
		<pubDate>Thu, 28 Jan 2010 01:08:08 +0000</pubDate>
		<dc:creator>jonathan</dc:creator>
				<category><![CDATA[extjs]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://jonathanjulian.com/?p=158</guid>
		<description><![CDATA[I&#8217;ve heard a rumor from a trusted source that the next version of Learning Ext JS is being written, and it may be titled Learning Ext JS 3.0. It will be updated to reflect working with version 3.x of the library, and have at least three new chapters added. If it is published in 2010, [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve heard a rumor from a trusted source that the next version of <a href="http://learningextjs.com/">Learning Ext JS</a> is being written, and it may be titled <strong>Learning Ext JS 3.0</strong>. It will be updated to reflect working with version 3.x of the <a href="http://extjs.com/">library</a>, and have at least <strong><em>three</em></strong> new chapters added. If it is published in 2010, this could be a great year for Ext JS books, with <a href="http://extjsinaction.com/">Ext JS in Action</a> scheduled to go to print in June.</p>

<p><strong>UPDATE February 10</strong>: Confirmed! I&#8217;ve been asked to be a Technical Reviewer, and I&#8217;ve already received 3 chapters to review! This is going to be a great refresh for what I think is the best entry-level Ext JS book.</p>
]]></content:encoded>
			<wfw:commentRss>http://jonathanjulian.com/2010/01/new-ext-js-book-in-the-works/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Five Tips to Improve Your Ext JS Application</title>
		<link>http://jonathanjulian.com/2010/01/five-tips-to-improve-your-ext-js-application/</link>
		<comments>http://jonathanjulian.com/2010/01/five-tips-to-improve-your-ext-js-application/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 00:43:47 +0000</pubDate>
		<dc:creator>jonathan</dc:creator>
				<category><![CDATA[extjs]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://jonathanjulian.com/?p=138</guid>
		<description><![CDATA[Three Pillar Global sponsored their first Ext JS meetup earlier this week, and they were kind enough to invite me to give one of the presentations. Thanks to Patrick Sheridan (@sheridap) of Three Pillar for pulling it together, and providing the delicious pizza! My presentation was inserted between Shea Frederick and Jay Garcia&#8216;s. Pretty good [...]]]></description>
			<content:encoded><![CDATA[<h3 style="font-size: 1.17em;"><span style="font-weight: normal; font-size: 13px;"><a href="http://www.threepillarsoftware.com/">Three Pillar Global</a> sponsored their first <a href="http://www.meetup.com/baltimore-dc-javascript-users/calendar/12219819/">Ext JS meetup</a> earlier this week, and they were kind enough to invite me to give one of the presentations. Thanks to Patrick Sheridan (<a href="http://twitter.com/sheridap">@sheridap</a>) of Three Pillar for pulling it together, and providing the delicious pizza! My presentation was inserted between <a href="http://www.vinylfox.com/">Shea Frederick</a> and <a href="http://tdg-i.com/">Jay Garcia</a>&#8216;s. Pretty good company, I&#8217;d say.</span></h3>

<p>Pat started off discussing &#8220;<a href="http://www.slideshare.net/threepillar/three-pillar-global-design-for-use">Design for Use</a>&#8220;. Then Shea told us all about &#8220;<a href="http://www.slideshare.net/VinylFox/practical-ext-js-debugging">Practical Ext JS Debugging</a>&#8220;.</p>

<p>My talk is titled &#8220;Five Tips to Improve Your Ext JS Application&#8221;. I briefly touch on five distinct strategies to use to make your code more maintainable and reusable. Below the slides and video is a short discussion of each topic:</p>

<div id="__ss_2958396" style="width: 425px; text-align: left;"><a style="font: 14px Helvetica,Arial,Sans-serif; display: block; margin: 12px 0 3px 0; text-decoration: underline;" title="Five Tips To Improve Your Ext Js Application" href="http://www.slideshare.net/jonathanjulian/five-tips-to-improve-your-ext-js-application">Five Tips To Improve Your Ext Js Application</a><object style="margin: 0px;" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="355" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="src" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=fivetipstoimproveyourextjsapplication-100120131238-phpapp01&amp;rel=0&amp;stripped_title=five-tips-to-improve-your-ext-js-application" /><param name="allowfullscreen" value="true" /><embed style="margin: 0px;" type="application/x-shockwave-flash" width="425" height="355" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=fivetipstoimproveyourextjsapplication-100120131238-phpapp01&amp;rel=0&amp;stripped_title=five-tips-to-improve-your-ext-js-application" allowscriptaccess="always" allowfullscreen="true"> </embed></object>
<div style="font-size: 11px; font-family: tahoma,arial; height: 26px; padding-top: 2px;">View more <a style="text-decoration: underline;" href="http://www.slideshare.net/">documents</a> from <a style="text-decoration: underline;" href="http://www.slideshare.net/jonathanjulian">Jonathan Julian</a>.</div>
</div>

<p><object width="400" height="300"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=9768559&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=9768559&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="300"></embed></object></p>

<p><a href="http://vimeo.com/9768559">Jonathan Julian at the Northern Virginia Ext JS meetup at Three Pillar Global on 1/19/10</a> from <a href="http://vimeo.com/user3205431">Jay Garcia</a> on <a href="http://vimeo.com">Vimeo</a>.</p>

<h3>Define your own components</h3>

<p>Explicitly define your own &#8220;classes&#8221; as you build your UI. This will allow your code to be more reusable, testable, and maintainable. It&#8217;s really easy to do, and along with namespacing your files and only defining one component per file, this approach will lead to amazingly clear directory structure.</p>

<h3>Use an event manager</h3>

<p>Sometimes also known as an &#8220;event broker&#8221;, this is a simple object used to centralize all events. The example in the presentation is the &#8220;simplest event manager you can build with Ext JS&#8221;. I like to use at least one in every project to simplify the coding when someone inevitably asks, &#8220;can you make it do X every time the user does Y?&#8221;</p>

<div id="attachment_146" class="wp-caption alignleft" style="width: 290px"><img class="size-medium wp-image-146" title="describing an event manager" src="http://jonathanjulian.com/wp-content/uploads/2010/01/five_tips-crop-280x300.jpg" alt="Here I am describing the MyApp.eventManager" width="280" height="300" /><p class="wp-caption-text">Fire an event on the MyApp.eventManager</p></div>

<h3>Override the framework properly</h3>

<p>Anytime you need to &#8220;hack&#8221; the framework, do your work in a special file (or dir): call it &#8220;overrides&#8221;. Then when you test your upgrade to the next version of Ext JS, all the integration points to inspect are in one place. I also included my idea of a standard directory layout. I think it works well with the idea of &#8220;Namespace Segmentation&#8221; as discussed in Chapter 16 of <a href="http://extjsinaction.com/">Ext JS in Action</a>.</p>

<h3>Remember, it&#8217;s still a web app</h3>

<p>Write good JavaScript code. Use <a href="http://jslint.com/">JSLint</a>. Read <a href="http://jonathanjulian.com/2009/07/javascript-the-good-parts/">The Good Parts</a> and <a href="http://stevesouders.com/efws/">Even Faster Websites</a>.</p>

<h3>Prefer an Ext JS SPA to a classic &#8220;web app&#8221;</h3>

<p>This is a tricky one. If you have the choice, build your application in two tiers &#8211; Ext JS, and web service. They don&#8217;t even have to share the same endpoint! A cleaner design emerges when you separate the concept of the Ui and the data. If you work on a project that already muddles the two with server-side script tags and generation of Ext JS configs with &#8220;helpers&#8221;, then make it a goal to write all new code in the two-tier style. Put your Ext JS code in .js files. And only communicate with the server via JSONStores and Ajax requests.</p>

<div id="attachment_148" class="wp-caption alignright" style="width: 246px"><a href="http://github.com/jjulian/winner_picker"><img class="size-medium wp-image-148  " title="winner_picker on github" src="http://jonathanjulian.com/wp-content/uploads/2010/01/winner_picker-291x300.png" alt="jjulian/winner_picker" width="236" height="243" /></a><p class="wp-caption-text">The winner_picker UI.</p></div>

<h3>The Winner Picker App</h3>

<p>Shea brought a few copies of <a href="http://learningextjs.com/">Learning Ext JS</a>, and Jay brought a few vouchers for an early access copy of <a href="http://extjsinaction.com/">Ext JS in Action</a>. We needed a way to give them away &#8211; so, I dreamed up a simple app to randomly choose an attendee. To make it fun, I wanted to have a slick animation to randomly highlight attendees names for a few seconds before the choice is shown.</p>

<p>In less than an hour or so, here&#8217;s the Ext JS app I made: it&#8217;s a grid with an Array Store (attendees were entered manually), and one button that kicks off the process. And the silly animation: every 10ms, a grid row is selected at random and highlighted. The delay is slowly ramped down for effect. After a few seconds, the last random choice is made, and a message box is shown with the winner&#8217;s name. The<a href="http://github.com/jjulian/winner_picker"> code is on github</a>, and I encourage you to fork the project and improve it, for no other reason than practice (basic knowledge of git is <a href="http://jonathanjulian.com/2009/08/basic-git/">easy to get</a>). The Five Tips can be applied to this tiny project just as well as they can to your large enterprise project!</p>

<h3>Conclusion</h3>

<p>I think it was a successful event, and I hope to be involved in the future. There were a handful of intense discussions afterwards &#8211; it&#8217;s good to be a part of a passionate community! If you are in the Baltimore area, come on out to <a href="http://www.meetup.com/baltimore-dc-javascript-users/">our JavaScript meetup</a> and hang out with us on the first Wednesday of every month. We meet at the <a href="http://beehivebaltimore.com/">Beehive</a> in Canton. If you are in NOVA and want to help build the Ext JS meetup scene there, get in contact with Pat (<a href="http://twitter.com/sheridap">@sheridap</a>) or Jay (<a href="http://twitter.com/tdgi">@tdgi</a>).</p>

<p>I&#8217;d love to hear what you think about the Five Tips. Feel free to comment here, or on the <a href="http://www.slideshare.net/jonathanjulian/five-tips-to-improve-your-ext-js-application">slideshare page</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://jonathanjulian.com/2010/01/five-tips-to-improve-your-ext-js-application/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>rake jslint</title>
		<link>http://jonathanjulian.com/2009/07/rake-jslint/</link>
		<comments>http://jonathanjulian.com/2009/07/rake-jslint/#comments</comments>
		<pubDate>Thu, 30 Jul 2009 02:38:12 +0000</pubDate>
		<dc:creator>jonathan</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://jonathanjulian.com/?p=71</guid>
		<description><![CDATA[JSLint is one of the most valuable tools for a JavaScript developer. Short of being a &#8220;compiler&#8221;, it&#8217;s a &#8220;code quality tool&#8221; that can keep you from doing things that may come back to haunt you in the future. I&#8217;ll leave the detailed explanation to the author, Douglas Crockford &#8211; I assume you&#8217;re reading this [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.jslint.com/">JSLint</a> is one of the most valuable tools for a JavaScript developer. Short of being a &#8220;compiler&#8221;, it&#8217;s a &#8220;code quality tool&#8221; that can keep you from doing things that may come back to haunt you in the future. I&#8217;ll leave the <a href="http://www.JSLint.com/lint.html">detailed explanation</a> to the author, <a href="http://www.crockford.com/">Douglas Crockford</a> &#8211; I assume you&#8217;re reading this because you want to integrate jslint into your Rails project and run it on the command-line!</p>

<p>To run jslint as a rake task in your Rails project, you&#8217;ll only need a few things:</p>

<ul>
    <li>the Java runtime</li>
    <li>Rhino, the java-based javascript runtime environment</li>
    <li>jslint itself</li>
    <li>a rake task to invoke it</li>
</ul>

<p>So let&#8217;s get it set up. First, the java. Drop into a shell on your development system (or build system, wherever you want to run jslint), and make sure you have access to the java runtimes (run java -v, or which java). If not, <a href="http://www.java.com/en/download/index.jsp">go get it</a>. Don&#8217;t be afraid, it&#8217;s easy.</p>

<p>Next you&#8217;ll need <a href="http://www.mozilla.org/rhino/">Rhino</a>, the javascript execution environment. There are many js implementations (spidermonkey/treemonkey, v8, etc), but Rhino is the one that Crockford chose when he wrote the extension to jsunit that loads a file to be parsed. Its a jar file, <a href="http://www.mozilla.org/rhino/download.html">go get it</a> and put it into your project as vendor/rhino.jar.</p>

<p>Now you need Crockford&#8217;s jslint code. There are two parts: one is <a href="http://www.JSLint.com/fulljslint.js">jslint.js</a>, and the other is the Rhino extension (<a href="http://www.JSLint.com/rhino/rhino.js">rhino.js</a>). We will need both of these, and I&#8217;ve found it&#8217;s easiest when they are combined into one. Concatenate rhino.js to the bottom of jslint.js and save as vendor/jslint.js.</p>

<p>Hey, we&#8217;re almost there! Now you just have to add the rake task to your project.
<script src="http://gist.github.com/158504.js"></script></p>

<p>Drop <a href="http://gist.github.com/raw/158504/0f20e0805e6298fba8d434f28059d5aba62b9431/jslint%20rake%20task">this gist</a> into an existing Rakefile, or rake task. If you don&#8217;t have any rake tasks, then simply save this as lib/tasks/jslint.rake. Rake will find it in your project automatically. Run rake -T to confirm.</p>

<p>A short explanation: it finds all the js files you want to inspect, and runs jslint on them one at a time, printing out failures. Line 6 is the key line &#8211; you can change two parts of this to suit your project. First, the list of files to check is created using a Dir glob. My example gets all <em>.js files under /public recursively (</em>*). Then the second part of that line is used to reject js files you DO NOT want to inspect. Frameworks, 3rd party code, for example (although it can be fun to run jslint on your framework code to see <em>their</em> level of quality). This example excludes the ExtJS installation.</p>

<p>Now youre ready to run</p>

<h2>rake jslint</h2>

<p>and enjoy the benefits of quality-checking your JavaScript code! And since you&#8217;ve just built a rake task that returns 0 or 1, it can be easily integrated into you automated or continuous build process. Heh heh &#8211; now the build will fail and everyone will know who doesn&#8217;t use triple-effing-equals! (see slide 13 of <a href="http://www.slideshare.net/voodootikigod/naked-javascript">Naked JavaScript</a>)</p>

<p>Enjoy command-line jslint. And if you develop using TextMate, I highly recommend <a href="http://www.phpied.com/jslint-on-mac-textmate/">integrating jslint into that as well</a>.</p>

<p>(I&#8217;ve been thinking and talking about this for too long. Inspiration to finally get command-line jslint set up came from reading <a href="http://stackoverflow.com/questions/247209/javascript-how-do-you-organize-this-mess/248951#248951">this</a> stackoverflow earlier today.)</p>
]]></content:encoded>
			<wfw:commentRss>http://jonathanjulian.com/2009/07/rake-jslint/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

