Letting Go the Fear Of Programming and Just Starting

Over the Goatee Plateau

… well, the start of grokking it anyway.  Maybe it’s because I’ve finally made it over The Goatee Plateau, or maybe it just sort of clicked and all the bits and pieces that I’ve been reading about since 2004 started coming into play.

More likely though, is I finally got around to stopping worrying about coding and started coding.

I could tell you that going through the excellent Rails Tutorial site by the most awesome Michael Hartl, gave me some confidence or addressed things differently than the thousands of other free Ruby on Rails sites out there.

So here’s the story.  About 3 months ago a web designer I’d worked with before brought me a project.  The project was a relatively simple, but still complex enough to be interesting, site to allow scheduling of referee’s for the local sports division.  Basically there was the need for users to schedule the games, referees to bid on the games they want to ref, and then “assignors” to select the refs to games.  There’s more to it, but that’s enough for here (I’m sure I’m boring you already).

The point of that is that it’s a small project without the need for any really crazy stuff, but not a super simple “we need a weblog in 15 minutes” type requests.  Additionally, there was enough complexity in the project that doing it in my primary language and framework, Perl and HTML::Mason was something that I’d consider actual “work”, and I got the same cold shiver I get when contract clients come to me with “just one quick little change…”.

So I told her that I’d do it, and work on it.  There wasn’t a deadline, or any agreement on money, and I took this as a learning “fun” project with the only thing that I was planning to really get out of it was knowledge.  A couple of days later I set up a Heroku account, and uploaded an initial set of files (the result of a “rails <sitename>” essentially) without any changes or additions.

And it sat there for 2 months.

I was terrified of doing something with it.  As I’ve written before the Ruby on Rails world has changed since 2004.  It used to be a relatively small ecosystem around 2004 when all your code was auto-generated and all you needed to know was the syntax of an “each” loop in Ruby.  Now it’s a huge and complex world of Cucumber tests that write their own tests, NoSQL and Mongo databases, Markdown and Textile, and about a thousand other gems, plugins and libraries that may or may not help you out with whatever it is you’re doing.

Terrified by the choices available maybe?

A couple of weeks later I actually started out doing a bit of work while at a Fraser Valley Ruby Brigade meeting.  Nothing special, just creating some of the models required and trying to get them properly related to each other.  However, after creating the scaffolding I still had that feeling that I really didn’t know what I was up to, I froze up again.  My brain kept on jumping forward into all the “hows”.

“How will I put all this under the old familiar “/admin” setup when all the routes are /referees/ and /fields/ and /games/?”

“If I set up all the smaller models (ie: a list of pay scales) do I need to set up scaffolding for those too? Where do they go?”

“How will I set up the user authentication?  What will I use?  How do I set up my models ahead of time to make sure I don’t shoot myself in the foot for this?”

And it sat there for another month.

Then last week I made a breakthrough of sorts.  I’m not sure if it was going through the Rails Tutorial, or the awesome DataMapper ninja @dkubb giving me the great advice of (paraphrased)

“Just do it in as simple a way as possible, whatever design you come up with will be wrong, so make sure you do the minimum of work to get it working so there’s that less code to change when you come up with a better design.”

Something in there got through and I just started… “getting” it.  I started with the highest level of object I could think of (in this case, the fields that the games would be played on) and created that, then created a main page that would show them.  Then the next level of object (games) and connected them.  Then the next and the next.  So far I’ve really not done a huge amount more than hand writing the scaffolding that rails does for you anyway, but using some of the techniques in the Rails Tutorial I have slowly been iterating my way forward.

One big hole in this project has been testing.  Even though the Rails Tutorial starts almost right away with doing RSpec tests I haven’t put those in.  I also have avoided doing any “real” work on the site, doing other than the scaffolding type stuff.  But still, not having to worry about needing the generators to create views, and knowing what I need to add to a controller to have something start working has been an amazing weight off my shoulders.

Related posts (maybe):

  1. Functional Vs. Object Oriented Programming In Ruby

One Response to “Letting Go the Fear Of Programming and Just Starting”

  1. curtismchale Says:

    So next time I’m out at the Fv.rb I’m asking you about your tests. Write the tests as you write the app or they become a huge effort.

Leave a Reply