<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

  <title><![CDATA[Karmajunkie.com]]></title>
  <link href="http://karmajunkie.com/atom.xml" rel="self"/>
  <link href="http://karmajunkie.com/"/>
  <updated>2011-12-30T16:43:00-06:00</updated>
  <id>http://karmajunkie.com/</id>
  <author>
    <name><![CDATA[Keith Gaddis]]></name>
    
  </author>
  <generator uri="http://octopress.org/">Octopress</generator>

  
  <entry>
    <title type="html"><![CDATA[Evolving Rails]]></title>
    <link href="http://karmajunkie.com/blog/2011/12/30/evolving-rails/"/>
    <updated>2011-12-30T13:38:00-06:00</updated>
    <id>http://karmajunkie.com/blog/2011/12/30/evolving-rails</id>
    <content type="html"><![CDATA[<h2>(or, &#8220;How I made peace with my father and learned to love the enterprise&#8221;)</h2>

<p>[<em>Update: if you liked this post, please take a second and upvote it on <a href="http://news.ycombinator.com/item?id=3409368">HN</a></em>]</p>

<p>As I write this, I&#8217;m sitting in my father&#8217;s TV-watching chair as my son plays with the various and sundry toys he&#8217;s accumulated over the holidays. Not that long ago I&#8217;d have regarded this scene as improbable at best, as my father and I rarely see eye-to-eye on much of anything, and haven&#8217;t for years. For a number of reasons, this is the first Christmas I&#8217;ve been to my father&#8217;s in quite some time, but chief among them is the persistent notion I have that while my father and I rarely agree, it doesn&#8217;t have to mean one of us is wrong. If there&#8217;s one thing being a parent has taught me, its that maybe Dad was right about a few things as well.</p>

<p>And if there&#8217;s been one theme I have kept seeing popping up in 2011, its the idea that more and more in the Ruby and Rails world have started noticing some of the problems in Rails. <a href="http://blog.steveklabnik.com/posts/2011-12-30-active-record-considered-harmful">Steve Klabnik&#8217;s most recent post</a> is the latest salvo in a long string of high profile Rubyists noticing that what we&#8217;ve been doing for the vast majority of applications <em>isn&#8217;t working anymore.</em></p>

<!-- more -->


<p></p>

<h3>Love at first sight</h3>

<p>Like Steve, and many others, my first impression of Rails was formed in large part by the ease of using ActiveRecord to get at my data. No more hand-forming SQL and manipulating cursors! No more rolling my own ORM layers in every application! I fell in love at first sight.</p>

<p>My exposure came through reading a copy of <a href="http://pragprog.com/book/rails4/agile-web-development-with-rails">Agile Web Development With Rails, 1st ed.</a> I found in Barnes and Noble while I should have been studying for a Biochemistry exam early in 2006. The more I read the more I wanted to read—finally I felt like someone had crystallized all the essential elements of creating web apps into a great framework with a hell of a learning curve driven mostly by learning what basic problems you <em>don&#8217;t</em> have to deal with anymore.</p>

<p>And so it had, to some degree. The clusterfuck that every PHP app eventually degenerates to was gone, replaced with a well-organized codebase where <del>every</del> most ideas have a home. Early scalability criticisms focused on the ability of a Rails app to withstand high levels of traffic, and solutions and &#8220;best practices&#8221; began to develop, allowing bigger and bigger apps to be built easily and quickly.</p>

<h3>And then the underwear comes out</h3>

<p>But like all love-at-first-sight relationships, reality eventually sets in. Solving the traffic scalability problems eventually leads to a much more insidious problem: design scalability. The more we demonstrate an ability to solve Big Problems™, the more we&#8217;re called on to solve Bigger Problems™—but the tools in our kit aren&#8217;t evolving.</p>

<p>Does it ever strike you as odd that we&#8217;re basically using the same patterns that Visual Basic used to create UIs that map directly to database records? Yes, the mechanisms have changed, and we&#8217;ve found new and interesting ways to introduce HTTP into the mix, but even today most Rails applications map a database record to a form view with a CRUD architecture.  Why, when we abstract the hell out of everything else, do we fail to break this mental model of shoveling data directly into a data store?</p>

<p>I frequently talk to developers maintaining apps with hundreds of models in monolithic apps. Nobody sets out to do that—its an outgrowth of the <a href="http://www.laputan.org/mud/">Big Ball of Mud</a> pattern. Does it strike anyone as a good idea? I think not. But there it is—reality intruding into our cozy ActiveRecord world.</p>

<h3>Back to the parents&#8230;</h3>

<p>Until fairly recently, Rails was largely the province of startup developers who made their own rules about the companies they were creating. HR? Fuck that noise, I never want to work at a company big enough to need it. EJB? Who needs it? If your environment is so complicated that your IDE has to create code for you, you&#8217;re Doing It Wrong™.</p>

<p>This is mostly my opinion, but a lot of us let our rejection of enterprise culture lead to rejection of &#8220;enterprisey&#8221; design patterns, many of which developed in order to solve problems we&#8217;re now encountering in the Rails world as we tackle problem domains that are not only non-trivial but exceedingly complex. This is not accidental—as we&#8217;re making deeper and deeper inroads into the enterprise world, by hook or by crook, we&#8217;re being called on to use architectural patterns that have demonstrable value there.</p>

<p>But this is also an opportunity to create new growth in the enterprise. ORM&#8217;s cause as many problems there as they can in non-trivial Rails applications. They&#8217;re just a much more configurable animal, and thus, a much bigger pain in the ass to use. Ruby&#8217;s huge productivity boost can help enterprises get more done with less, and many of the ideas of the Rails world (like convention over configuration) can drive those productivity gains even further. If there&#8217;s one overriding idea from the Rails world that I think should be promoted far and wide, its this: <em>it shouldn&#8217;t be this hard.</em></p>

<p><strong><em>In other words, Dad wasn&#8217;t wrong about everything&#8230; but neither am I.</em></strong></p>

<h3>Where do we go from here?</h3>

<p>Over the next few weeks and months, I&#8217;m going to be blogging a lot about a couple of topics in particular: <a href="http://cqrsinfo.com">CQRS</a> and <a href="http://martinfowler.com/eaaDev/EventSourcing.html">Event-sourced Data</a>.  These two patterns go together like peanut-butter and jelly, and I think they have a lot of potential to form the basis of an evolved Rails stack, or perhaps a different beast altogether.</p>

<p>These ideas are mostly used in the .Net (and to some degree, Java) world, and there&#8217;s a bit of a cognitive load to using them, especially if your only exposure to OOD is through Rails&#8217; idea of modelling with ActiveRecord.  But the benefits in design and flexibility I think make it well worth it, especially in the enterprise where heterogenous and polyglot stacks are far more common.</p>

<p>Briefly, CQRS (Command Query Responsibility Separation) is an idea that has grown out of Domain Driven Design, and it promotes the notion that your domain models can and should be separate from your read models which are consumed more directly by your application. In practice, writes happen through commands, typically with a Command object that works directly with the domain model, and changes are reflected for reads through the use of events (which is where the event-sourced data comes in).  One of the key points is that your domain objects are basically PO*Os (Plain Old [insert language of choice here] Objects), and you model your domain with back-to-basics object oriented modeling techniques.</p>

<p>This is but one possible path of many, but its the one I&#8217;m most interested in exploring right now. I think the flexibility and meta-programming features of Ruby have the potential to make these patterns exceedingly easy to access, just as ActiveRecord (the library) made the <a href="http://martinfowler.com/eaaCatalog/activeRecord.html">ActiveRecord pattern</a> trivially easy to use. I&#8217;m also really interested to see what else the community cooks up over the next year, because I think we&#8217;ve been resting on our laurels for a bit too long now, and we&#8217;ve still got plenty of room to grow.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Merry Christmas to Me: new blog]]></title>
    <link href="http://karmajunkie.com/blog/2011/12/26/merry-christmas-to-me-new-blog/"/>
    <updated>2011-12-26T17:00:00-06:00</updated>
    <id>http://karmajunkie.com/blog/2011/12/26/merry-christmas-to-me-new-blog</id>
    <content type="html"><![CDATA[<p>So my latest resolution is to start blogging more, and as part of that I&#8217;m giving myself a new blog. I moved to Posterous a year or two ago, but I never really enjoyed the experience. Jumping on the bandwagon with everyone else, I&#8217;m giving <a href="http://octopress.org">Octopress</a> a try. So far so good—it took me about fifteen minutes to set up.  Next step is to migrate my DNS to <a href="https://dnsimple.com/">DNSimple</a> and get rid of Godaddy, and point everything at my heroku site for the blog.</p>

<p>I tried to migrate all my old posts from Posterous, but that was a great big fail whale for some reason (I keep getting 410-Gone for the http error; if you know what I&#8217;m doing wrong, drop me a line in the commnts.) I&#8217;ll have to migrate that stuff manually, I suppose—good thing I didn&#8217;t spend much time blogging in the last couple of years or I&#8217;d have a lot more work to do there.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Panic.]]></title>
    <link href="http://karmajunkie.com/blog/2011/12/05/panic/"/>
    <updated>2011-12-05T01:39:00-06:00</updated>
    <id>http://karmajunkie.com/blog/2011/12/05/panic</id>
    <content type="html"><![CDATA[<p>Its Monday. Again. Where&#8217;s my Monday Morning Panic Attack? Oh, there it is. Again. Right on time.</p>

<!-- more -->


<p>Since we started <a href="http://publikdemand.com">PublikDemand</a> a little over a month ago, things have moved at a lightning pace, but nothing like its about to be moving. Product? Almost there. Funding? Check. Check. Awesome cofounder? <a href="http://twitter.com/courtneypowell">Check</a>. Ridiculously supportive wife? <a href="http://twitter.com/barbramode">Check, check, checkity check.</a></p>

<p>Right now I&#8217;m thinking about the multitude of boxes to check off before we can launch.  Design. That last teency-tiny raft of actual features. Invitations. Admin features. Customer features. Analytics. Ad network. Rent out my house so I can move if we get into an incubator. Figure out how I&#8217;m going to pack said house.</p>

<p><strong>OH MY GOD ARE WE F&#8217;ING CRAZY?</strong></p>

<p>Don&#8217;t they know I&#8217;m a <a href="http://en.wikipedia.org/wiki/Impostor_syndrome">fraud</a>? Don&#8217;t they know the chances of success are only slightly better than <a href="http://www.intrade.com/v4/markets/contract/?contractId=669534">those of Ron Paul actually winning a nomination?</a> Don&#8217;t they know <a href="http://news.ycombinator.com/item?id=3310355">I&#8217;m almost 35</a>?</p>

<p><em>This is never going to work. We&#8217;re insane for even trying.</em></p>

<p>I&#8217;m putting my family&#8217;s financial future on the line for this. I&#8217;m letting friends count on me for their own. Its going to blow up. Everyone&#8217;s going to hate me.</p>

<p>I can&#8217;t even get this blog entry out the way I want it. How the hell am I going to build a company that can sell millions in inventory every year?</p>

<p><em>Take a breath. Go outside. Smoke a cigarette. Remember why you don&#8217;t smoke. Have a screwdriver for breakfast.</em></p>

<p>Now: <strong>Man. The fuck. Up.</strong></p>

<p>You are not Mama&#8217;s precious snowflake. You are not special. You are not a thought leader, a rockstar, or a ninja.  Your Klout score sucks. Guess what?</p>

<p><strong>You&#8217;ve still got to get it done.</strong></p>

<p>Stop reading HN and freaking out about every funding-crunch-of-doom article. Stop thinking about valuations and how much equity you&#8217;re going to have to give away and when. Stop worrying about this design decision or that one and flip a fucking coin, because you don&#8217;t have enough traffic for either of them to matter. Stop dreaming.</p>

<p>Start building. And get the fuck over yourself, you&#8217;re not that important.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Mocking out Passenger in a Rails app]]></title>
    <link href="http://karmajunkie.com/blog/2011/11/14/mocking-out-passenger-in-a-rails-app/"/>
    <updated>2011-11-14T11:05:00-06:00</updated>
    <id>http://karmajunkie.com/blog/2011/11/14/mocking-out-passenger-in-a-rails-app</id>
    <content type="html"><![CDATA[<p>I&#8217;m integrating AMQP with an app right now, and ran into a problem using <code>rails server</code> to serve up the app for development purposes.  The short version (see <a href="http://railstips.org/blog/archives/2011/05/04/eventmachine-and-passenger/">here</a> and <a href="http://rubydoc.info/github/ruby-amqp/amqp/master/file/docs/GettingStarted.textile#Integration_with_objects">here</a> for the longer versions) is that when integrating into a forking environment like Phusion Passenger, you have to jump through a few (relatively easy) hoops to initialize the EventMachine reactor that the AMQP gem uses.</p>

<!-- more -->


<p></p>

<p>My big problem was not being able to use the debugger in the environment, since the use of the Passenger callbacks means you have to use Passenger, which doesn&#8217;t work with the ruby debugger.  Even using Passenger in standalone mode (<code>passenger start</code>) forks the environment, which means the debugger is out.</p>

<p>So here&#8217;s my somewhat hackish solution:</p>

<div><script src='https://gist.github.com/1364919.js?file='></script>
<noscript><pre><code>module PhusionPassenger
  def self.on_event(event_name, &amp;block)
    #the only event I use this with is :starting_worker_process, 
    #which takes a `forked` parameter, which we want to be false
    yield false
  end
end</code></pre></noscript></div>


<p>Its short, sweet, and probably oversimplified. Stick that in your lib folder and require it in your AMQP initializer. If anyone has a better way of pulling this off, please point me towards the better solution in the comments.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[You can always do it different.]]></title>
    <link href="http://karmajunkie.com/blog/2011/10/24/you-can-always-do-it-different/"/>
    <updated>2011-10-24T11:24:00-05:00</updated>
    <id>http://karmajunkie.com/blog/2011/10/24/you-can-always-do-it-different</id>
    <content type="html"><![CDATA[<p>I have my terminal set to spit out a quote from the unix utility fortune every time I pop open a new shell.  This one came up a few minutes ago:</p>

<p><strong>The Man Who Almost Invented the Vacuum Cleaner</strong></p>

<blockquote><p>The man officially credited with inventing the vacuum cleaner is<br/>Hubert Cecil Booth.  However, he got the idea from a man who almost<br/>invented it.  </p><p>In 1901 Booth visited a London music-hall.  On the bill was an<br/>American inventor with his wonder machine for removing dust from carpets.  </p><p>The machine comprised a box about one foot square with a bag on top.  After watching the act &#8211; which made everyone in the front six rows sneeze &#8211; Booth went round to the inventor&#8217;s dressing room.</p><p>&#8220;It should suck not blow,&#8221; said Booth, coming straight to the<br/>point.  &#8220;Suck?&#8221;, exclaimed the enraged inventor.  &#8220;Your machine just moves the dust around the room,&#8221; Booth informed him.  &#8220;Suck?  Suck?  Sucking is not possible,&#8221; was the inventor&#8217;s reply and he stormed out.  Booth proved that it was by the simple expedient of kneeling down, pursing his lips and sucking the back of an armchair.  &#8220;I almost choked,&#8221; he said afterwards.</p><footer><strong>Stephen Pile</strong> <cite>The Book of Heroic Failures</cite></footer></blockquote>


<p>When you&#8217;re engaged in an endeavor that someone else has already tried, its important to remember that the details count. Small differences may seem trivial at first, but the smallest twist on an idea can make the difference between Friendster and Facebook. Timing can be the difference between MP3.com and Apple&#8217;s iCloud or Amazon&#8217;s Cloud Player.</p>

<p>Just because someone else did it first doesn&#8217;t mean you won&#8217;t be the first to do it right.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Advice to Technical Recruiters: Get Involved]]></title>
    <link href="http://karmajunkie.com/blog/2011/08/05/advice-to-tecnical-recruiters-get-involved/"/>
    <updated>2011-08-05T11:37:00-05:00</updated>
    <id>http://karmajunkie.com/blog/2011/08/05/advice-to-tecnical-recruiters-get-involved</id>
    <content type="html"><![CDATA[<p>Look, we get it.  Despite the ridiculous pain in most sectors of the economy, and despite the huge numbers of jobless people out there, things in the tech world are largely rosy.  There are jobs galore.  If you&#8217;ve got an opening demanding a hot technology like Rails and you&#8217;re based somewhere like San Francisco or New York, good luck filling it.  I get at least three emails a week (in a quiet week) from a recruiter looking to fill a position. I love that.  Its a great time to be a strong technologist.</p>

<!--more-->


<p>But something I see over and over again is emails from different recruiting agencies successively recruiting for what is clearly the same position at the same company. Company calls recruiter, works with them for two or three months unsuccessfully, then moves on to a new agency, hoping for different results.  I&#8217;m not sure why they think that&#8217;s going to make a difference—I would hope everyone realizes at this point that the recruiters are probably targeting the same population.</p>

<h3><em>Got a job to fill?</em></h3>

<p>Judging by my inbox, your process looks a little like this:
1. Open position lands on your desk
2. Email said position to mailing lists and database of names you have from&#8230; somewhere.
3. ????
4. Send suitable applicants to company (or hiring manager if you&#8217;re internal)
5. Collect recruiting fee or keep internal recruiting job.</p>

<p>What&#8217;s step 3, the astute reader asks?  For many, it seems to be mostly filled with waiting, hoping, and praying.  I hate to be the one to tell you this, but you&#8217;re going to have to work harder than that.</p>

<p>You&#8217;re probably laboring under a false assumption—that your job is filling jobs.  Its not.  Yes, I realize you&#8217;ve probably been doing this job for years, and based on my totally unscientific research of recruiters I&#8217;ve met, talked to, and worked with, there&#8217;s even a 30% chance you&#8217;re good at it.  Who am I to tell you what your job is?</p>

<h3><em>I&#8217;m the guy you&#8217;re trying to hire.</em></h3>

<p>Your job is not filling jobs.  Your job is creating relationships.  Mostly, you need to be creating relationships between yourself, and people in technology, across the country.  Candidates is such an aseptic word, so we&#8217;re going to call the latter category &#8216;friends&#8217;.  When you have a job to fill, you use those relationships to create a new relationship between your client and your friends.  And like your everyday friends, you should care enough to know a few things about your geek friends.  Here&#8217;s why: in technology today, there are more jobs than qualified people to fill them, and that problem seems to be getting worse. So chances  are, you&#8217;re going to have to convince someone to leave their current job and go to a new job.  If your friends like their job, you&#8217;re going to have to convince at least one of them that this job offers them more.  You do that by selling them on the idea that the new job is going to be better than the one they have, and to do that you have to know what &#8220;better&#8221; means to them.  Maybe its money; maybe its free time.  Maybe its company culture, or the chance to learn something new or work on an interesting problem.</p>

<h3><em>Whatever their weakness is, its your job to know it.</em></h3>

<p>When I come to you as a client, I&#8217;m not paying you 5, 10, or even 20% commission on their first year&#8217;s salary to send a bunch of emails.  I&#8217;m on all those lists and I can do that myself.  What I&#8217;m buying from you is your network, and it damn sure better be better than mine, or you&#8217;ve got a problem. Because if its not then that means that your client can do your job better than you can.</p>

<p>So, how do you get there? If you&#8217;re in any kind of market with a tech scene, you had better be a part of it.  Here in Austin, we actually have technical groups negotiating with each other for who is going to meet on what night, because there are so many groups of us meeting that we have to try to minimize scheduling conflicts between groups with overlapping membership.  If you&#8217;re a recruiter in Austin and you&#8217;re not spending at least two nights a week going to these groups and getting to know the members, you&#8217;re Doing It Wrong™.</p>

<p>When I say &#8220;getting to know the members&#8221; that needs to really sink in.  That doesn&#8217;t mean you stand up at the beginning or end of the meeting and say &#8220;Hi, I&#8217;m so-and-so, and I&#8217;m hiring for a bunch of clients so if you&#8217;re looking, please come talk to me.&#8221;  When you do that, you&#8217;re asking me to get to know you and what you&#8217;ve got to offer.  Most of us aren&#8217;t actively looking, and we&#8217;re not going to come ask you who you&#8217;re hiring for, because we probably don&#8217;t care. That doesn&#8217;t mean we can&#8217;t be made to care.</p>

<p>When I say &#8220;getting to know the members&#8221; that means you get to know us.  You engage in conversation.  You listen to conversations, find out what we&#8217;re interested in (side note: that means you also need to know at least a bit about the technologies we&#8217;re interested in.) You know who&#8217;s got families and is risk-averse with respect to their employment.  You know who&#8217;s young and ready to try new things and might be willing to work for a startup who can&#8217;t pay as much.  You know who&#8217;s not altogether unhappy at their job but seems bored.  You know who&#8217;s been working on side projects with a new technology and isn&#8217;t quite comfortable with their knowledge (but who is probably ready to work with it full-time). If you&#8217;re really good, you know about that one guy who&#8217;s about to have to put his parents in a nursing home and could use some extra cash.</p>

<h3><em>You know this, because these people are your friends.</em></h3>

<p>Let&#8217;s face it: half of us probably should get a new job, we just don&#8217;t know it.  We&#8217;re complacent, happy enough that we don&#8217;t feel compelled to look around. But if the perfect job landed on my desk, coming from someone I know and trust (and maybe even like) who says &#8220;Hey, I know you&#8217;re not looking, but I really want to talk to you about this position and I think you ought to at least think about it, so let me buy you lunch or a beer and tell you about it.&#8221; I&#8217;d listen.  Because you&#8217;re my friend, and you know what makes me interested.</p>

<p>Conversely, when you send me (a longtime Rubyist and Rails developer) a Java or PHP position, that tells me something—that you don&#8217;t know the first thing about me as a potential hire, and that you&#8217;re just doing the spray-and-pray thing that so many of your peers do. But we know you now, and we don&#8217;t call you back or respond to your emails.  You&#8217;re lucky if we don&#8217;t add a filter to send your email to the trash. If this describes you, you are not my friend.</p>

<p>Gary Vaynerchuck sometimes talks about what he calls the &#8220;give-a-damn&#8221; economy (which he later revised to the The Thank You Economy), where companies are in business because they really, sincerely care and are grateful for their customers business.  As someone recruiting to fill a position, this had better describe you, because we can smell it a mile away when you don&#8217;t really give a damn.</p>

<h3><em>And we remember when you do.</em></h3>

<p>By the way, if you&#8217;re a company looking to hire in technology, this all applies even moreso to you.  Most of the technical groups I referred to above are educational in nature—so you ought to be encouraging and rewarding your employees for going to them. The companies around Austin that are actually managing to fill positions are the ones who we all know from meetings.  We know the employees and that they like their work.  We know the people we&#8217;d be working for, because we get together and have a beer with them at least once a month.  If you have an open position that no recruiter seems able to fill, why don&#8217;t you try doing it yourself? If you still can&#8217;t fill it, cast a wider net: be open to remote employees, offer relocation, travel to some regional conferences and network.  We&#8217;re not coming to you.</p>

<p>And if you&#8217;re someone looking (which deserves a post of its own) remember—these groups are where you&#8217;re going to find your dream job.  if you live somewhere there isn&#8217;t a group, show some initiative and start one—not because you need a job, but because you give a damn about technology.  If you have them and don&#8217;t go, you&#8217;re missing out.  Not only on potential work, but on making a lot of honest-to-god friends you&#8217;d jump at the chance to work with.</p>

<p>Be a part of the community, and the community will be a part of you.</p>
]]></content>
  </entry>
  
</feed>

