<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Nimble Code: Category Programming</title>
    <link>http://www.nimblecode.com/articles/category/programming</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Jacob Harris' Weblog</description>
    <item>
      <title>Rails Under the Knife</title>
      <description>&lt;p&gt;After months of rehearsing and revising, I finally gave the talk at &lt;span class="caps"&gt;OSCON&lt;/span&gt;. I think it could use another month of refinement, but people seemed to enjoy it, and I actually enjoyed giving it as well. If you were at the talk, thank you for coming and feel free to let me know if you have any feedback or questions.&lt;/p&gt;


	&lt;p&gt;My talk was &lt;strong&gt;Rails Under the Knife&lt;/strong&gt;, a look at the some of the internals of Rails to get a better idea of 3 powerful Ruby techniques:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;Metaprogramming&lt;/li&gt;
		&lt;li&gt;Reflection&lt;/li&gt;
		&lt;li&gt;Blocks&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;You can download the slides at&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;a href="http://s3.amazonaws.com/harrisj-share/oscon2007.pdf"&gt;http://s3.amazonaws.com/harrisj-share/oscon2007.pdf&lt;/a&gt; (&lt;em&gt;5mb &lt;span class="caps"&gt;PDF&lt;/span&gt;!&lt;/em&gt;)&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;This talk is aimed at an intermediate Rails programmer who knows the basics of Rails coding (I have another similar talk for beginners called Rubyisms in Rails), but still is a bit unsure about the power trio of serious Rails hackery. Hopefully, this will help to provide some inspiration for you to delve into the Rails code on your own. Enjoy.&lt;/p&gt;</description>
      <pubDate>Thu, 26 Jul 2007 18:20:00 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:7b7fce0c-25ef-4561-8ca1-6552ceb9e572</guid>
      <author>harrisj@nimblecode.com (Jacob Harris)</author>
      <link>http://www.nimblecode.com/articles/2007/07/26/rails-under-the-knife</link>
      <category>Programming</category>
      <category>ruby</category>
      <category>rails</category>
      <category>oscon</category>
      <trackback:ping>http://www.nimblecode.com/articles/trackback/990</trackback:ping>
    </item>
    <item>
      <title>Packaging Your First Gem With Hoe</title>
      <description>&lt;p&gt;My name is Jacob Harris, and I am a rubygem addict. I&amp;#8217;d estimate I have hundreds of them tooling around on my hard drive, useful little snippets of Ruby or C library wrappers or random noodlings. I might not actually use most of them in any of my projects, but like a vast library of unread books, I enjoy having them around. But for the longest time, I&amp;#8217;ve been a freeloader. I&amp;#8217;ve downloaded gems, but I&amp;#8217;ve never written one, but it&amp;#8217;s time I start giving something back.&lt;/p&gt;


	&lt;p&gt;And so, I&amp;#8217;ve written my first gem. It&amp;#8217;s nothing incredible &amp;#8211; all things have to start simple &amp;#8211; but I like it. It&amp;#8217;s called &lt;a href="http://amazon-hacks.rubyforge.com/"&gt;Amazon Hacks&lt;/a&gt; and it consists of two classes (for now) to benefit people whose sites handle Amazon links. The Amazon::Hacks::Link class contains a few methods to extract an &lt;span class="caps"&gt;ASIN&lt;/span&gt; from any product link, normalize product links, and append an affiliate ID easily. The slightly sillier Amazon::Hacks::Image class puts a convenient Ruby wrapper around the &lt;a href="http://aaugh.com/imageabuse.html"&gt;convoluted syntax Amazon uses for its image transformation engine&lt;/a&gt;. If you work on a site that links to Amazon product pages (e.g.,  &lt;a href="http://www.allconsuming.net/"&gt;All Consuming&lt;/a&gt;), try it out and let me know if it works for you or it can be improved. It&amp;#8217;s simple to get started, simply run&lt;/p&gt;


	&lt;blockquote&gt;
		&lt;p&gt;&lt;strong&gt;gem install amazon-hacks&amp;#8212;include-dependencies&lt;/strong&gt;&lt;/p&gt;
	&lt;/blockquote&gt;


	&lt;p&gt;Which brings me to &lt;strong&gt;hoe&lt;/strong&gt;. Last night, I gave a talk on hoe to the &lt;a href="http://www.nycruby.org/"&gt;NYC.rb group&lt;/a&gt; and the slides are here if you want to learn more about the process. &lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;a href="http://www.nimblecode.com/files/hoetalk.pdf"&gt;Building Your First Gem With Hoe&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;Before last week, I had no idea of what it takes to create a gem, but it seemed like a lot, and I had better things to distract myself with. And it does indeed require a fair amount of busy work, what I call &lt;em&gt;administrivia&lt;/em&gt;, to turn your snippet of Ruby code into a packaged gem, and this work has to be started anew for each gem you want to create. Now, as pragmatic programmers, we learn to automate menial tasks whenever possible, and hoe makes the creation of gems a lot more manageable by automating the busy-work away via a set of useful rake tests. The result is more time for coding, faster releases, and more likely you&amp;#8217;ll release that gem in the first place. So, give hoe a shot, learn about gems, and start writing gems. You&amp;#8217;re a brilliant Ruby coder, it&amp;#8217;s time to share it with the world. And when you write that gem, I&amp;#8217;ve got a cherished spot on my hard drive for it.&lt;/p&gt;</description>
      <pubDate>Wed, 10 Jan 2007 14:36:00 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:8260c73d-36d8-4853-a148-a946e2961226</guid>
      <author>harrisj@nimblecode.com (Jacob Harris)</author>
      <link>http://www.nimblecode.com/articles/2007/01/10/packaging-your-first-gem-with-hoe</link>
      <category>Programming</category>
      <category>hoe</category>
      <category>gems</category>
      <category>presentations</category>
      <category>ruby</category>
      <trackback:ping>http://www.nimblecode.com/articles/trackback/980</trackback:ping>
    </item>
    <item>
      <title>Or You Can Cheat</title>
      <description>&lt;p&gt;Wow, long time no blog. Work and home life have just sucked all the mental energy out of me lately. For those of you who still have kept me in your feedrolls or click here from time to time, I have a new set of slides presented for your personal enjoyment.&lt;/p&gt;


	&lt;p&gt;Last week&amp;#8212;transfixed by the horror of an empty slate of speakers&amp;#8212;I decided it was time to give another talk to the &lt;span class="caps"&gt;NYC&lt;/span&gt;.rb and so I spent a few days throwing together a presentation I titled &lt;em&gt;Or You Can Cheat&lt;/em&gt;. It&amp;#8217;s all about how you can write C extensions for Ruby and also how this something you shouldn&amp;#8217;t undertake lightly. I have a very &lt;em&gt;interesting&lt;/em&gt; approach to presentations: when I want to learn more about a subject, I throw together a presentation on it. I think the combination of casual interest and the abject fear of humiliation in front of my peers is a great personal motivational tool. This talk continues that trend, and while I can not claim to be a definitive expert on C extensions for Ruby, I certainly know a lot more about the subject now and I think you will too.&lt;/p&gt;


	&lt;p&gt;If you are interested, you can download the talk here&lt;/p&gt;


	&lt;p&gt;&lt;a href="http://www.nimblecode.com/files/rubyextend.pdf"&gt;Or You Can Cheat&lt;/a&gt;  (600K &lt;span class="caps"&gt;PDF&lt;/span&gt;)&lt;/p&gt;


	&lt;p&gt;This is a bit more silly and off-the-cuff than &lt;a href="http://www.nimblecode.com/articles/2006/04/25/rubyisms-in-rails"&gt;Rubyisms in Rails&lt;/a&gt;, and I really enjoyed it. There are a few references I should clarify though. First, there is the matter of &lt;a href="http://en.wikipedia.org/wiki/Arepa"&gt;arepas&lt;/a&gt;. The arepa is &lt;strong&gt;the&lt;/strong&gt; official food of &lt;a href="http://www.nycruby.org/"&gt;NYC.rb&lt;/a&gt; and it is a rite of passage here to take visiting Ruby eminences to our official supplier, the &lt;a href="http://www.caracasarepabar.com/"&gt;Caracas Arepa Bar&lt;/a&gt;. Asides from being addictively tasty, arepas serve as a perfect metaphor for Ruby extensions, in that they wrap the tasty ingredients inside a pragmatic corn flour shell. They really are that tasty. Yes, I also suppose I was a bit harsh calling Joel Spolsky a troll, but I had no other term to &lt;a href="http://www.joelonsoftware.com/items/2006/09/12.html"&gt;describe his wild extrapolation&lt;/a&gt; that current Ruby interpreter performance augurs that Ruby will always be slow, that Rails is a horrible web development framework, and how you should shackle your entire development environment around the slowest part. But he is right that Ruby currently is slow for &lt;em&gt;some uses&lt;/em&gt;, and C exensions are a potent way to resolve those edge cases without throwing in the towel.&lt;/p&gt;


	&lt;p&gt;And yet, I hope you&amp;#8217;re not dropping everything to write them.&lt;/p&gt;


	&lt;p&gt;Why the lukewarm recommendation? Well, I think Ruby performance has become an all-purpose scapegoat these days. In some cases, this is deserved (we need &lt;span class="caps"&gt;YARV&lt;/span&gt;. Now.), but it&amp;#8217;s all too easy to blame Ruby when the real problem is your web server, your database, or some stupid algorithm you wrote that&amp;#8217;s wildly inefficient. Rule all that out first before you dive into C extensions for Ruby. Because C is dangerous, C is tricky, and C is just plain &lt;strong&gt;no fun.&lt;/strong&gt; C extensions can be like eating an arepa filled with broken glass if you aren&amp;#8217;t careful. But they also are a useful tool for performance and especially for wrapping existing libraries and legacy code.&lt;/p&gt;


	&lt;p&gt;Which gets me wondering if there are any cool killer apps for C extensions and Ruby. Are there some cool open-source libraries that would be nice with Ruby bindings? How cool would could a combination of &lt;a href="http://www.rufy.com/starfish/doc/"&gt;Starfish&lt;/a&gt; and &lt;a href="http://www.zenspider.com/ZSS/Products/RubyInline/"&gt;RubyInline&lt;/a&gt; really be? Would we need to use C extensions to create rbsh, a Ruby shell? What other fun things could you do if you had nice Ruby tongs to keep that nasty C code at bay? Let me know if you have any awesome ideas and if you enjoyed these slides. And in return, I&amp;#8217;ll try to see if I can actually blog again one of these days. Thanks.&lt;/p&gt;</description>
      <pubDate>Wed, 27 Sep 2006 13:08:00 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:cac7d787-298f-46df-8cf4-66f06aef20b3</guid>
      <author>harrisj@nimblecode.com (Jacob Harris)</author>
      <link>http://www.nimblecode.com/articles/2006/09/27/or-you-can-cheat</link>
      <category>Programming</category>
      <category>ruby</category>
      <category>performance</category>
      <category>presentation</category>
      <trackback:ping>http://www.nimblecode.com/articles/trackback/959</trackback:ping>
    </item>
    <item>
      <title>Rubyisms in Rails Redux</title>
      <description>&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_ruby "&gt;&lt;span class="constant"&gt;self&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;promote!&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;I am pleased to announce that the &lt;a href="http://www.informit.com/bookstore/product.asp?isbn=0321474074&amp;#38;rl=1"&gt;digital shortcut &lt;span class="caps"&gt;PDF&lt;/span&gt; version&lt;/a&gt; (to purchase, you have to go to the &lt;a href="http://www.informit.com/shortcuts"&gt;Digital Shortcuts page&lt;/a&gt; or you can buy it from &lt;a href="http://safari.awprofessional.com/0321474074"&gt;Safari&lt;/a&gt; Sorry!) of my &lt;a href="http://www.nimblecode.com/articles/2006/04/25/rubyisms-in-rails"&gt;Rubyisms in Rails&lt;/a&gt; presentation is finally available for purchase. At 54 pages in length for the low price of $9.99, I guarantee you&amp;#8217;ll glean at least 18.5 cents of insight from each page (disclaimer: that&amp;#8217;s a mean instructional value; although gorgeous, the title page is not particularly educational in itself).&lt;/p&gt;


	&lt;p&gt;In addition, the book is also now available in &lt;a href="http://safari.awprofessional.com/"&gt;Safari Books Online&lt;/a&gt;, and possibly Amazon or other retailers as well. Also, be sure to check out the list of &lt;a href="http://www.informit.com/shortcuts"&gt;other upcoming Ruby titles&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;So, what&amp;#8217;s in it? If you&amp;#8217;ve read the original presentation, you already have a sense of the scope of material I am covering here, but the shortcut allows me to focus on the material in greater depth. The result is a richer and more thorough examination of the examples presented in the original slides. If you are an intermediate to advanced Rails hacker, you probably know all this stuff already. But if you are a newcomer to Ruby through Rails, or you still find yourself still stuck coding &lt;span class="caps"&gt;PHP&lt;/span&gt; or Java-like Ruby, this ebook might help to align your thinking to the Ruby way.&lt;/p&gt;


	&lt;p&gt;Will I write another ebook? I&amp;#8217;d say yes, but I&amp;#8217;ll have to think up another interesting topic. But if you are ever thinking of creating a technical book, I&amp;#8217;d recommend starting in a smaller dose like this first. As I discovered, even 54 pages can be a lot of work, and it&amp;#8217;s better to test out your time commitments and abilities with something small before you start pitching large references. But that&amp;#8217;s a topic for another blog posting. Make me happy: &lt;a href="http://www.informit.com/shortcuts"&gt;Buy the ebook&lt;/a&gt; or &lt;a href="http://safari.awprofessional.com/0321474074"&gt;read it on Safari&lt;/a&gt; and give me your feedback. Thanks!&lt;/p&gt;


	&lt;h4&gt;Update&lt;/h4&gt;


	&lt;p&gt;Fixed purchase link to be go to Shortcuts page (where you can add to cart).&lt;/p&gt;</description>
      <pubDate>Wed, 02 Aug 2006 09:46:00 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:542f8763-96ba-4dad-8185-8ece45adad9e</guid>
      <author>harrisj@nimblecode.com (Jacob Harris)</author>
      <link>http://www.nimblecode.com/articles/2006/08/02/rubyisms-in-rails-redux</link>
      <category>Books</category>
      <category>Web Coding</category>
      <category>Programming</category>
      <category>ruby</category>
      <category>rails</category>
      <category>rubyisms</category>
      <trackback:ping>http://www.nimblecode.com/articles/trackback/946</trackback:ping>
    </item>
    <item>
      <title>Things I Figured Out</title>
      <description>&lt;p&gt;And now for something different (and &lt;em&gt;shorter&lt;/em&gt;, for those recovering from the length of the last post). Insanely talented Internet prankster &lt;a href="http://www.cockeyed.com/"&gt;Rob Cockburn&lt;/a&gt; recently posted a short and sweet article &lt;a href="http://www.cockeyed.com/lessons/figured/figured.shtml"&gt;Things I Figured Out&lt;/a&gt;, where he listed a bunch of interesting and slightly stupid revelations he&amp;#8217;s had over the years. This has been followed by 15 pages of &lt;a href="http://www.cockeyed.com/lessons/figured/figured01.shtml"&gt;reader comments&lt;/a&gt; chronicling their own  brilliant insights and forehead-slapping moments.&lt;/p&gt;


	&lt;p&gt;I think this is a brilliant idea for an article, and I&amp;#8217;ve certainly had my moments of utter brilliance and sheer stupidity (even this blog probably has examples of both). So, I&amp;#8217;m going to post a few of the things I&amp;#8217;ve figured out on my own or, failing that, learned the hard way. But since this is a technical blog only, there will be no personal idiocy. Just technical things I now know better about now&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;strong&gt;XML is Not For Everything&lt;/strong&gt; Great for long data files, lousy for configuration files, downright terrible for love notes. It&amp;#8217;s not one-size-fits-all.&lt;/li&gt;
	&lt;/ul&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;strong&gt;XML Is a Minute to Learn, a Lifetime to Master&lt;/strong&gt; It&amp;#8217;s easy to gloss over some of &lt;span class="caps"&gt;XML&lt;/span&gt;&amp;#8217;s subtleties when you begin, but they&amp;#8217;ll get you later if you aren&amp;#8217;t careful. Sadly, very few resources articulate some of the things that&amp;#8217;ll get you, but maybe there&amp;#8217;s a future blog post about that.&lt;/li&gt;
	&lt;/ul&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;strong&gt;Somebody&amp;#8217;s Done It Better Already&lt;/strong&gt; I&amp;#8217;m being glib here, but one of the joys of Open Source is that if you need a generic component, it&amp;#8217;s best to look for someone who&amp;#8217;s created it already. For instance, if you need a logger, you could write one on your own, but there are excellent libraries out there and your time is better spent writing stuff you can sell.&lt;/li&gt;
	&lt;/ul&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;strong&gt;HTTP Blows Away Raw Sockets&lt;/strong&gt; Unless you absolutely, positively have no choice, there is no reason you should use raw sockets instead of &lt;span class="caps"&gt;HTTP&lt;/span&gt; protocol for remote services. Sure, it might be harder to set up in the short run, but it&amp;#8217;s so much easier to debug and maintain in the long run this is a no-brainer. Especially since small, light, and fast &lt;span class="caps"&gt;HTTP&lt;/span&gt; parsing libraries are available for all.&lt;/li&gt;
	&lt;/ul&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;strong&gt;Often Too Much Is Worse Than Too Little&lt;/strong&gt; Or as Donald Knuth put it, &amp;#8220;Premature optimization is the root of all evil.&amp;#8221; I&amp;#8217;ve been stung so many times by trying to be clever, I&amp;#8217;ve finally realized I should see if it&amp;#8217;s slow before I try to fix what ain&amp;#8217;t broke.&lt;/li&gt;
	&lt;/ul&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;strong&gt;Stored Procedures Are Evil&lt;/strong&gt; DBAs swear by them because they&amp;#8217;re supposed to control access and speed up performance. In reality, they move application logic out of your program into an awkward language (SQL) that will usually fall out of sync with your application and aren&amp;#8217;t kept consistently in sourcesafe or migrations. Worse still, they&amp;#8217;re the trenches for warfare between developers and operations.&lt;/li&gt;
	&lt;/ul&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;strong&gt;Developers Black-Box Way Too Much&lt;/strong&gt; It&amp;#8217;s too easy to leave this with a cliché admonition to &amp;#8220;think outside the box,&amp;#8221; but it&amp;#8217;s sadly true. As developers, we&amp;#8217;re taught early the useful technique of abstracting away complexity within black boxes. This is useful for that third-party &lt;span class="caps"&gt;API&lt;/span&gt; or calling operating systems, but it&amp;#8217;s very easy to fall into that trap in your job (&amp;#8220;we&amp;#8217;ve &lt;em&gt;always&lt;/em&gt; done it this way&amp;#8221;) or your life (&amp;#8220;I&amp;#8217;ll just wait for career advancement to come to me&amp;#8221;).&lt;/li&gt;
	&lt;/ul&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;strong&gt;Physical Contact Matters&lt;/strong&gt; The Internet still hasn&amp;#8217;t annihilated geography yet. And personal, physical presence still matters. Meeting people is so much better than emailing them. Which I guess is just a roundabout way of saying, yet again, I should&amp;#8217;ve gone to &lt;a href="http://www.railsconf.org/"&gt;Railsconf&lt;/a&gt;. Sorry!&lt;/li&gt;
	&lt;/ul&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;strong&gt;You&amp;#8217;re Going to Screw Up The First Time. Just Accept It.&lt;/strong&gt; It&amp;#8217;s so easy to fall into the fear of not getting it right the first time, you never get started. Get over it. Accept you&amp;#8217;re going to make mistakes the first time around and you&amp;#8217;ll fix it later and do the best you can. And if you can, write unit tests to make it easier to clean it up when you start.&lt;/li&gt;
	&lt;/ul&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;strong&gt;Things Break Slowly, Rarely All at Once&lt;/strong&gt; It&amp;#8217;s rare you can pinpoint a single decision or piece of code where everything catastrophically failed. Instead, the road to failure and mediocrity is a gradual and painful process, of many small failures along the way. It&amp;#8217;s hard to resist the downwards momentum, because it always seems feasible to reverse. I would like to see more project management texts that tell you how to stop digging that hole.&lt;/li&gt;
	&lt;/ul&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;strong&gt;If You Can&amp;#8217;t Explain It, You Shouldn&amp;#8217;t Do It.&lt;/strong&gt; Sometimes I think half of IT operates by overwhelming your natural instincts and confusion with so much jargon, your brain just gives up. It&amp;#8217;s a mysticism of sorts, but the wakeup to reality again is painful. My rule of thumb is if I can&amp;#8217;t explain it in plain English using metaphors, and optionally table utensils, then it&amp;#8217;s not worth doing. Because it most certainly will not be maintainable.&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;Okay, that&amp;#8217;s all I have so far. But I&amp;#8217;m sure the realizations will keep coming. Happy 4th of July everybody!&lt;/p&gt;</description>
      <pubDate>Mon, 03 Jul 2006 09:58:00 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:3c39b050-a882-4368-8e37-92bd39eb32a0</guid>
      <author>harrisj@nimblecode.com (Jacob Harris)</author>
      <link>http://www.nimblecode.com/articles/2006/07/03/things-i-figured-out-technical-edition</link>
      <category>Project Management</category>
      <category>Silly</category>
      <category>Programming</category>
      <category>Career</category>
      <trackback:ping>http://www.nimblecode.com/articles/trackback/877</trackback:ping>
    </item>
    <item>
      <title>Are You Happy?</title>
      <description>&lt;p&gt;I read a lot of feeds. A &lt;em&gt;lot&lt;/em&gt; of feeds. In my hobby trend-spotting (it&amp;#8217;s like a dorkier birdwatching), I read my feeds to monitor the zeitgeist to see what the real &lt;a href="http://www.macdevcenter.com/pub/a/mac/2002/05/14/oreilly_wwdc_keynote.html"&gt;Alpha Geeks&lt;/a&gt; are into. And the last year has had some interesting trends. For instance, dynamic languages like Python and Ruby are now firmly the new wave, although functional languages (Haskell, &lt;span class="caps"&gt;OCAML&lt;/span&gt;) and prototype languages (Io) seem to also be attracting interest. Web2.0 is a term bandied around casually, mocked, and even &lt;a href="http://radar.oreilly.com/archives/2006/05/web_20_service_mark_controvers.html"&gt;litigated over&lt;/a&gt; , but the concept seems to be here to stay. The most novel aspect I&amp;#8217;ve seen about Web2.0 is that the Web has become a source of real tools many developers are using to manage their lives; as a holder of Sun stock much diminished in value, I guess I can at least take comfort in the fact that their adage &amp;#8220;The network is the computer&amp;#8221; seems to finally be coming true. Sure, it&amp;#8217;s about 6 years later than predicted, but it&amp;#8217;s happening.&lt;/p&gt;


	&lt;p&gt;But most interesting to me is when the alpha geeks flock to ideas not directly related to coding frameworks, business plans or the like. For instance, six months ago it seemed like every serious hacker was devouring &lt;a href="http://www.davidco.com/"&gt;Getting Things Done&lt;/a&gt; and blogging about organizing their lives. And now the new obsession is &lt;a href="http://web.ionsys.com/~remedy/FLOW%20%20.htm"&gt;Flow&lt;/a&gt;. A conceptualiztion first coined in a book fifteen years ago, Flow is a term Mihaly Csiksczentmihalyi (&lt;em&gt;don&amp;#8217;t ask me to pronounce that&lt;/em&gt;) coined for that mental state where work is  stimulating but not frustrating, intention translates effortlessly into action, and happiness and productivity are intertwined. Csiksczentmihalyi teased out a description of Flow by looking at the mental states of people practicing Zen mindfulness or risking bodily harm in extreme sports like rock-climbing or surfing. But he could just as easily described the euphoric states of serious computer programming. Small wonder this  book has now been &amp;#8220;discovered&amp;#8221; by the alpha geeks, this fleeting feeling is what we find so addictive about programming in the first place.&lt;/p&gt;


	&lt;p&gt;&lt;span style="float: right; display: block; padding: 5px;;"&gt;&lt;img src="http://www.nimblecode.com/files/flow_channel.jpg" alt="" /&gt;&lt;/span&gt; The basic concept of Flow is that certain tasks make us happy to do them because they exist within a narrow channel between fear and boredom, because they encourage us to improve our skills but do not overwhelm us with too many challenges at once (&lt;em&gt;for Donnie Darko fans, the goal of flow is to find the middle of the fear-love axis&lt;/em&gt;). We developers are well-acquainted with that fear. It&amp;#8217;s the fear that keeps you from refactoring that legacy system because you&amp;#8217;re not sure what would break, the fear that keeps us using a clunky library because we can&amp;#8217;t test changes, the fear that makes deploying the new version to the server nail-biting because it&amp;#8217;s crammed full of changes that might take it down. In short, fear and specifically &lt;em&gt;fear of change&lt;/em&gt; is a constant state of mind for too many programmers, but it doesn&amp;#8217;t have to be. A state of happiness is possible if you can conquer the fear.&lt;/p&gt;


	&lt;p&gt;Flow is the reason why some frameworks like Ruby on Rails are so appealing to programmers; it straddles that line between utter boredom (coding a web site in &lt;span class="caps"&gt;PHP&lt;/span&gt; like always) and high anxiety (having to master a complicated system like Cocoon just to print out &amp;#8220;Hello World&amp;#8221;). The key is allowing people to add capabilities (like authentication, tagging) as their skills grow, but not require everything to be planned up front. It conquers the fear of change, but hacking change into smaller steps. What makes a framework &lt;em&gt;good&lt;/em&gt; (the same is true for languages, methodologies, testing, architectures) is how it destroys this anxiety.&lt;/p&gt;


	&lt;p&gt;For most of my career, the basic question asked of developers was &lt;strong&gt;are you productive?&lt;/strong&gt; Computer programmers are naturally obsessed with productivity. This is after all a field where good programmers can outperform bad coders by several orders of magnitude. and for years the industry has marketed to this by selling tools that promise leaps in productivity. The key to productivity was seen only through uses of higher-level toolsets/IDEs or APIs. This is a philosophy Cote has memorably termed &lt;a href="http://www.redmonk.com/cote/archives/2006/05/oracle_develope.html"&gt;Right-Click Coding&lt;/a&gt; because of all the right clicking and fiddling you have to do to get anywhere. This was seen as a development accelerator, because it enabled poor developers to do complicated things like enterprise integration and &lt;span class="caps"&gt;GUI&lt;/span&gt; development without needing to actually write code or learn details of how things work. But, I think that overall such tools have actually decreased developer productivity in several ways. Like a teacher teaching only to her worst students in class, the wizards and libraries stifle and frustrate more able programmers. And since they remove developers from using the underlying code, wizards only accelerate bloat and complexity in their underlying code bases.&lt;/p&gt;


	&lt;p&gt;Worse of all, the fear was still out there. Indeed, like air conditioner output makes city streets hotter, they&amp;#8217;ve made the situation worse. By piling away programming within massive APIs and single-purpose wizards, this approach has created a nightmare of complexity waiting to ambush more able developers. Now the question becomes &lt;strong&gt;are you compliant?&lt;/strong&gt; Being savvy to the latest standards, libraries, or buzzwords is touted as the key. But the difficulties people have had using &lt;span class="caps"&gt;SOAP&lt;/span&gt; is but one example of how compliance doesn&amp;#8217;t really help either.
Just mention &amp;#8220;interop&amp;#8221; to any &lt;span class="caps"&gt;CTO&lt;/span&gt; or high-level architect and you&amp;#8217;ll see what I mean. The complexity (and the fear) are still there, standards compliance just blames the programmer when things go wrong.&lt;/p&gt;


	&lt;p&gt;Instead, it&amp;#8217;s time for a new question: &lt;strong&gt;are you happy?&lt;/strong&gt; I think the growing interest in Flow and &lt;span class="caps"&gt;GTD&lt;/span&gt; and higher-level languages and test-driven development and agile project management reflects a sea change in attitude by the alpha geeks. Trying to find happiness through artificially increasing productivity is like putting the cart before the horse. The key point of Flow is not that productivity fights fear and creates happiness, but recognizing that creating happiness is what creates productivity. I think it&amp;#8217;s about time, if we want to avoid the descent into compromises and disillusionment common in computer science. So, get in touch with your feelings when deciding about that design, language, system, api, etc. and ask yourself &amp;#8220;am I happy doing this?&amp;#8221; I think your instincts are a better guide than you know. Trust them. And don&amp;#8217;t be afraid to be happy.&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; I added some links to the original book as well as discussion in a &lt;a href="http://www.nimblecode.com/articles/2006/06/01/short-takes-pdas-planet-argon-and-happiness"&gt;short take posting&lt;/a&gt;. Happy reading!&lt;/p&gt;</description>
      <pubDate>Wed, 31 May 2006 15:25:00 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:b63a1668-fd65-4133-b422-beeec8f0a510</guid>
      <author>harrisj@nimblecode.com (Jacob Harris)</author>
      <link>http://www.nimblecode.com/articles/2006/05/31/are-you-happy</link>
      <category>Project Management</category>
      <category>Programming</category>
      <category>Career</category>
      <category>flow</category>
      <category>programming</category>
      <category>productivity</category>
      <trackback:ping>http://www.nimblecode.com/articles/trackback/536</trackback:ping>
    </item>
    <item>
      <title>Rubyisms In Rails</title>
      <description>&lt;p&gt;In an apparently blatant attempt to be more like &lt;a href="http://www.slash7.com/"&gt;Amy Hoy&lt;/a&gt;, I&amp;#8217;ve decided it&amp;#8217;s time I did some Intro to Rails writing. Tonight I&amp;#8217;m going to be giving a little talk on what I&amp;#8217;m calling &lt;strong&gt;Rubyisms&lt;/strong&gt; as seen in Ruby on Rails. I think one of the things that makes Rails so cool is how it is built upon some of the best aspects of Ruby&amp;#8217;s style: duck typing, symbols, blocks, and metaprogramming. And yet, I think many newcomers to Rails don&amp;#8217;t really notice some of the magic going on behind such simple declarations as&lt;/p&gt;


&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_ruby "&gt;&lt;span class="punct"&gt;&amp;lt;%&lt;/span&gt; &lt;span class="number"&gt;30&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;minutes&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;from_now&lt;/span&gt; &lt;span class="punct"&gt;%&amp;gt;&lt;/span&gt;&lt;span class="string"&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;or more complicated Rails cases like&lt;/p&gt;


&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_ruby "&gt;&lt;span class="keyword"&gt;class &lt;/span&gt;&lt;span class="class"&gt;Review&lt;/span&gt; &lt;span class="punct"&gt;&amp;lt;&lt;/span&gt; &lt;span class="constant"&gt;ActiveRecord&lt;/span&gt;&lt;span class="punct"&gt;::&lt;/span&gt;&lt;span class="constant"&gt;Base&lt;/span&gt;
  &lt;span class="ident"&gt;belongs_to&lt;/span&gt; &lt;span class="symbol"&gt;:article&lt;/span&gt;
  &lt;span class="ident"&gt;validates_presence_of&lt;/span&gt; &lt;span class="symbol"&gt;:author&lt;/span&gt;
&lt;span class="keyword"&gt;end&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;My humble little slideshow goes out to those Rails newcomers hacking code to look like &lt;span class="caps"&gt;PHP&lt;/span&gt; or Java. The conceit is to use some sample Rails code as starting points for deeper explorations into some of the Ruby coolness lurking inside Rails. This is a nice little look under the hood, but I hope it will educate people new to Rails on how to embrace Ruby style for cleaner and &lt;em&gt;cooler&lt;/em&gt; code.&lt;/p&gt;


	&lt;p&gt;I&amp;#8217;m posting the slides early for some last minute feedback and I might update these files if any other errors are found. I&amp;#8217;d like to thank &lt;a href="http://www.nycruby.org/"&gt;NYC.rb&lt;/a&gt; compatriots &lt;a href="http://www.zonageek.com/"&gt;Sebastian Delmont&lt;/a&gt;, &lt;a href="http://locomotive.raaum.org/home/show/HomePage"&gt;Ryan Raaum&lt;/a&gt;, &lt;a href="http://www.lifecoding.com/"&gt;Trotter Cashion&lt;/a&gt;, and &lt;a href="http://www.rubypowerandlight.com/"&gt;David Black&lt;/a&gt; for their help and corrections as well.&lt;/p&gt;


	&lt;p&gt;The presentation itself is two parts. I&amp;#8217;m releasing it here in two style. The &lt;em&gt;light version&lt;/em&gt; is stripped of interstitial chapter screens and is a lot easier on the bandwidth:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;a href="/files/rubynewbies-lite.pdf"&gt;PDF Version&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href="/files/rubynewbies-lite.swf"&gt;Flash Version&lt;/a&gt; (&lt;strong&gt;Note&lt;/strong&gt;: Flash version is cutting off bottoms of some slides)&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;If you like what you see there and want to get the version I&amp;#8217;m presenting with images, the full 2MB &lt;span class="caps"&gt;PDF&lt;/span&gt; dump is also available:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;a href="/files/rubynewbies.pdf"&gt;Huge &lt;span class="caps"&gt;PDF &lt;/span&gt;Version&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;Anyhow, I hope you enjoy my little presentation, and as always feedback and corrections are welcome in the comments.&lt;/p&gt;


	&lt;h3&gt;Update (8/2/06)&lt;/h3&gt;


	&lt;p&gt;This presentation is now available for sale as a &lt;a href="http://www.informit.com/shortcuts"&gt;digital shortcut from Informit&lt;/a&gt; (54 pages, $9.99). Please see my &lt;a href="http://www.nimblecode.com/articles/2006/08/02/rubyisms-in-rails-redux"&gt;Rubyisms Redux&lt;/a&gt; for a small pitch and purchasing links. Thank you!&lt;/p&gt;</description>
      <pubDate>Tue, 25 Apr 2006 10:44:00 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:12a5164c-0a8b-4924-8661-9d66a0e6a691</guid>
      <author>harrisj@nimblecode.com (Jacob Harris)</author>
      <link>http://www.nimblecode.com/articles/2006/04/25/rubyisms-in-rails</link>
      <category>Web Coding</category>
      <category>Programming</category>
      <category>ruby</category>
      <category>rails</category>
      <trackback:ping>http://www.nimblecode.com/articles/trackback/215</trackback:ping>
    </item>
    <item>
      <title>If You Can't Scoop The Poop, You Shouldn't Own A Dog</title>
      <description>&lt;p&gt;If you own a dog in New York, you&amp;#8217;re probably very familiar with the sentiment of the title. New York has &amp;#8220;pooper scooper laws&amp;#8221; that require all dog walkers to clean up after their dogs. It&amp;#8217;s not really pleasant to clean up after my dog, but it&amp;#8217;s something I accept as part of owning her. It&amp;#8217;s simply being considerate to my fellow person, but especially to my fellow dog owner; when someone doesn&amp;#8217;t clean up, it makes all of us look bad.&lt;/p&gt;


	&lt;p&gt;Perhaps it&amp;#8217;s a result of fatigue from having stayed up late the night before fixing an urgent bug, but the next morning at the dog run with &lt;a href="http://www.dogster.com/?26541"&gt;Bella&lt;/a&gt; this seemed like a remarkably good aphorism about taking responsibility as as a programmer.&lt;/p&gt;


	&lt;p&gt;I can&amp;#8217;t really give details, but I was up the night before fixing an extremely critical bug. I was fixing the bug because it was my fault. And I was fixing it that night because it was vitally important it not inconvenience customers any further (it had already affected them for a few days). And the bug was completely my fault, not the code&amp;#8217;s, not the operating system&amp;#8217;s, not my coworkers&amp;#8217; or the QA testers&amp;#8217;, all mine. And this is what I told my boss and my coworkers, and this is what I think was also told to the customers.&lt;/p&gt;


	&lt;p&gt;This may sound like I am only pointing out what&amp;#8217;s natural (like tooting my horn about how my heart is able to speed up when I exercise). But from my experience, software developers are horrible at handling failure. We blame it on the language we write in, the overwhelming complexity of our tasks, those testers we expect to find all our bugs for us or those project managers we expect to manage all our time for us. When we fall behind on deliverables, most of us keep silent and vainly hope we can catch up before the next milestone (a mistake so common it&amp;#8217;s earned the euphemism &lt;em&gt;hope creep&lt;/em&gt; among project managers). And when we mess up technically in front of the customer, we mask it in euphemisms like &lt;a href="http://www.amazon.com/exec/obidos/redirect?link_code=ur2&amp;#38;tag=httpwwwnimbco-20&amp;#38;camp=1789&amp;#38;creative=9325&amp;#38;path=http%3A%2F%2Fwww.amazon.com%2Fgp%2Fproduct%2F073571410X"&gt;a technical error has occurred&lt;/a&gt; whose passive voice make the customer wonder if they&amp;#8217;re being blamed and if errors just magically fall from the sky like rain.&lt;/p&gt;


	&lt;p&gt;To be fair, taking responsibility hurts. It damages your pride, makes you look bad for the moment, and might almost feel like a &lt;em&gt;career-limiting move&lt;/em&gt;. But as Chad Fowler puts it in &lt;a href="http://www.amazon.com/exec/obidos/redirect?link_code=ur2&amp;#38;tag=httpwwwnimbco-20&amp;#38;camp=1789&amp;#38;creative=9325&amp;#38;path=http%3A%2F%2Fwww.amazon.com%2Fgp%2Fproduct%2F0976694018%2Fqid%3D1138914507%2Fsr%3D2-1%2Fref%3Dpd_bbs_b_2_1%3Fs%3Dbooks%26v%3Dglance%26n%3D283155"&gt;My Job Went To India&lt;/a&gt;, you must &lt;strong&gt;learn how to fail&lt;/strong&gt;. Your managers might be pissed at the moment but I think honesty as well as concrete plan for fixing things and taking action will impress them. Your customers might be annoyed but will appreciate your forthrightness instead of fuzziness when explaining what broke and will love it if you can make things right as soon as possible instead of a few months. It&amp;#8217;s good for your fellow developers because it fights the cynicism and despair that result from too much unapologetically bad software already. And it&amp;#8217;s good for your character. You will actually turn out the stronger for having taken your lumps and emerging from it.&lt;/p&gt;


	&lt;p&gt;So, the next time something breaks (and there will be a next time), embrace it. And if that&amp;#8217;s too hard for you to do, get a different career; and don&amp;#8217;t get a dog.&lt;/p&gt;</description>
      <pubDate>Thu, 02 Feb 2006 15:59:00 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:7c370e62-9116-4a49-b7ff-767c098e1664</guid>
      <author>harrisj@nimblecode.com (Jacob Harris)</author>
      <link>http://www.nimblecode.com/articles/2006/02/02/if-you-cant-scoop-the-poop-you-shouldnt-own-a-dog</link>
      <category>Programming</category>
      <category>Career</category>
      <category>responsibility</category>
      <category>bugs</category>
      <category>career</category>
      <trackback:ping>http://www.nimblecode.com/articles/trackback/98</trackback:ping>
    </item>
  </channel>
</rss>
