Archive for October, 2008

Making the Leap from Spectator to Newbie with Ruby on Rails

What’s the difference between a spectator and a Newb?

In order to achieve spectatorhood, you really just need to run through a few samples in books and tutorials. If you want to be diligent spectator, you can even go as far as tweaking a few of the samples before passing judgement, but that is not strictly necessary and most certainly is not the norm.

When I wrote my initial impressions about Ruby on Rails post a while ago, I was definitely spectator.

I don’t think I graduated to a full fledged Newbie in Ruby on Rails until I started working on a code base that was destined for production and had someone other than myself making decisions about the functionality. This forced me to quickly abandon the safety net provided by the samples and start hacking away based on my initial, oftentimes faulty, assumptions.

Lest there be any confusion, I am not using the word ‘hacking’ in the technically artistic way, but rather in the brutish, blindly destructive, massively messy way that ends in stuff working, but only just barely and probably not for long.

In the spirit of full disclosure, I also must confess that this alleged code that is destined for production is really only a rather small and simple e-commerce app for my wife’s new side business of selling jewelry. Furthermore, I am not actually getting paid for my toil unless you consider the absence of persistent, not-so-subtle hints from the spousal unit a form of payment.

Despite these marks against me, I’m still claiming my status as Rails Newbie (not to be confused with n00b) and doing so with pride.

In honor of the occasion, I thought I would share a few thoughts that are, of course, heavily colored by my .NET centric developer background.

So far I’ve enjoyed…

  • Writing Less Code - While I am always suspicious about claims of drastic code reduction, especially since these numbers are often confused with the total time it will take to deliver a project by misguided CIO types, I have noticed that my code files are pleasantly sparse compared to what I am used to as a .NET developer. While much of the code reduction can be achieved on the .NET side by using an implementation of an ORM and ActiveRecord framework (i.e. NHibernate and Castle’s Active Record), some of the niceties, such as the lack of redundant type names, curly braces, and keywords are unique to either dynamic languages as a whole or Ruby specifically. Some of my fellow developers who voted against including the new C# var keyword in our coding standards would hate the loss of explicitness, but I find it refreshing.
  • Having Code Be Organized More Logically - My attitude towards the MVC (Model-View-Controller) approach to doing things has dramatically changed over the past year. I went from initial annoyance at not being able to map a url directly to a file name, to delight once I  got used to it and eventually realized that finding code was actually easier once it was split across three files according to function instead of all crammed into one file. I also like that I am immediately familiar with the directory structure whenever I open a new Rails project because it is mandated by convention and created automatically for each new project. This avoids the initial period of disorientation that I always feel whenever I open up an unfamiliar .NET project.
  • Rapid Feedback - I have to admit that I like being able to pop open a file instantly in SciTE (think notepad with syntax highlighting) and then immediately seeing the results by simply saving and hitting refresh on the browser. It actually made me nostalgic for the good ole’ days of classic ASP when I didn’t have to suffer through 10-25 second compile times each time I wanted to verify whether a change would work or not.
  • Managing Database Changes with Migrations - Being able to express database changes (both shema and data) in code rather than SQL and then roll the versions forward or backward in an automated and controlled way is definitely one of my favorite features of this new landscape. It’s such an obvious requirement for such a common pain-in-the ass task that I can’t believe that it isn’t built into the .NET development experience. My top TO DO item at work after our next release is to steal some time to integrate one of the .NET open source MIgrations clones that I’ve recently read about.

…but I have NOT enjoyed…

  • Discoverability - While working on Rails, I’ve gained a new appreciation for how discoverable the functionality within the .NET framework is. When I want to figure out how to do something, I can usually find the functionality without ever having to leave the IDE. I simply use intellisense to start navigating through the namespaces until I find a good candidate and then simply glance at the tool tip popups to find out information about the parameters. The Microsoft framework is not only huge and comprehensive in the functionality it provides, but the designers have invested ungodly amounts of time into making the API well named, consistent, and logically organized according to namespace. I’ve been relying heavily on Google with all the Rails work I’ve done and it feels like I’ve wasted a lot of cycles just finding how to do stuff. While I often like the answer I get better when it comes to Rails, it still annoys me that it takes so much more effort to find the answers in the first place.  The main documentation site, http://api.rubyonrails.org/, contains good information if you can arrive at it via google, but simply trying to browse the site for information is a nightmare.
  • Rails 2.0 breaking changes - This is also something that you just don’t see in the .NET world since Microsoft is so fanatical about maintaining backwards compatibility. It wouldn’t seem like this would be a big deal unless you had a big legacy app to worry about, but this actually made the whole discoverability and learning process all the more frustrating because there are so many stale nuggets of information out there. Although the main book I have been reading, Agile Web Development with Rails, was tremendously helpful for what I was trying to do, I still had to spend a decent amount of time figuring out why several of the code sample didn’t work because method calls that were renamed or simply stripped out of Rails 2.0.
  • Hosting Site Support for Rails - I really like my hosting site, precisioneffect, because it has an awesome support staff that answers questions and solves problems extremely quickly. However, I was disappointed to learn that they were no longer going to offer Rails support on their newer servers because of some troubles they’ve had trying to support it. I was also dismayed that some of the reliance on command line tools in Rails didn’t always translate nicely into a web hosting environment. For example, I wasn’t able to execute my Migrations files to create my database so I had search around to figure out a way to generate a traditional sql file from my migrations script so that I could deploy it. I’m sure there are advanced tools to help in deployment situations, but I’m just barely a Newb so I haven’t gotten that far yet.
  • Debugging -  Having easy access to an advanced visual debugger is such a central part of the out of the box experience in .NET that it is not uncommon for a .NET newb to be stepping through hello world example code in the debugger. Although Rails does have a command line debugger that allows you to step through code,  it is definitely no where near as accessible or usable as I’m used to with Visual Studio. I’ve seen several IDE’s mentioned that offer visual debugging for Rails, but so far I’ve only tried Aptana, which is so far most notable because it actually took longer to load than Visual Studio which I mistakenly thought was one of the more bloated pieces of software out there.

All in all, I have really enjoyed the last month of late night Rails development and feel pretty motivated to dig deeper into a few more books once I launch version one of my first Rails site. Who knows, perhaps someday I may even graduate to whatever level comes after the Newb stage.

Triple Shot Links # 8

I’m still feeling sleepy from my late night of figuring out how to add fancy Ajax effects and pagination to my wife’s new RoR e-commerce site that we are getting close to launching.

Here’s some light Monday reading…

  1. On the Difference between Newb and n00b - Don’t know the difference between a Newb and a n00b? Let this humorous urban dictionary definition clear some things up for you.
  2. PDC 2008 Gang Signs - If you’re feeling left out for missing PDC08, cheer yourself up by learning the official PDC gang signs. This morning I flashed our tester the BSOD sign right before I popped a cap into his *ss.
  3. The Web Browser is the New Laptop - Jeff brags on his new ‘netbook’, a cheap laptop for under $400 that’s optimized for web surfing. He makes an interesting point about this new breed of affordable machines potentially challenging MS & Apple’s oversized and\or overpriced behemoths.

Triple Shot Links # 7

I’m taking a needed break from implementing PCI compliance security features in order to bring you some of my favorite links from my weekend blog reading.

  1. Version control with Subversion: so easy my wife can do it - There is no way that Jimmy Bogard didn’t get at least one night on the couch for this one (even with the ‘this is not my wife’ disclaimer that he added to the caveman picture). He’s right about the current Subversion toolset being dead simple though. After endless procrastination, I finally put my personal files under source control using Visual Subversion and TortoiseSVN and was amazed at how quick and easy it was to setup and use.
  2. The 5 Most Annoying Programs on your PC - My favorite quote from this post: “Sure IE 7.0 is better than IE 6.0, but that is only in a ‘at least Mussolini made the trains run on time’ sort of way.” It has some spot-on rants against Outlook and Acrobat Reader for being so slow and bloated. It even inspired me to finally dump Acrobat Reader in favor of the much lighter weight FoxIt Reader. As a final F*** YOU, Acrobat insisted that I restart my computer after uninstalling it.
  3. Is Product Splintering The Future Of Software? - Max Pool not only finally solves the mystery of why there are so many frickin’ brands of toothpaste at the grocery store, but also makes some interesting predictions about how software will be packaged and marketed in the future.

Podcast Roundup

General Thoughts on Podcasting

When given a choice between listening to a podcast and reading a book, blog, or tutorial, podcasts would always be my last choice. Talking is not a very high bandwidth form of communication in general when compared to reading and its overall value decreases even more when it is purely passive endeavor without any way of interjecting questions. I am also a very visual and tactile learner, so I always do better when I can look at code and experiment with it than I do when I am just listening to someone talk about it.

Despite these downsides, I am a still huge fan of podcasts because they help make otherwise tedious tasks that I am not rich enough or smart enough to outsource yet more palatable. I will often wear my mp3 player while commuting, mowing, shoveling, vacuuming, raking and running.

Since my commuting time has been drastically cut in the last year, I don’t listen to nearly as many podcasts as I used to and consequently tend to be more selective when looking for good content. In fact, lately I’ve been getting into the habit of hosting my own personal gong show and simply stopping and deleting shows that don’t catch my interest or aren’t very good.

Here are my current thoughts and\or recommendations:

 

Long Time Favorite: Hanselminutes

If I’m even remotely interested in the topic, I usually opt for a Hanselminute podcast first and almost always make it through the whole show. I really appreciate the Scott’s brisk pace and the fact that he is pretty disciplined about sticking to the 30 minute format. When the show first started, I remember him repeating the mantra ‘the podcast that doesn’t waste your time’ and so far he’s done a pretty good job of staying true to his original aim. He also does an excellent job at asking questions that are not only technically insightful, but also relevant to what the interviewee just talked about. This makes it feel much more like a natural conversation and not just a random Q & A type interview. If anything, his show has gotten even better since he joined Microsoft and gained access to even more interesting people to talk to and projects to talk about.

 

Up and Coming: Herding Code

This is a relatively new show (only on episode 22) that I just recently started listening to, but it already shows great promise. I like the fact that there are four hosts: K. Scott Allen (OdeToCode), Kevin Dente, Scott Koon (Lazycoder), and Jon Galloway, because I think it helps raise the overall quality and relevancy of the questions being asked (4 brains are better than one). They’ve also done some episodes where they just chat about a particular topic rather than interviewing someone. This turned out really well some episodes, like the Browser Roundup, but not quite as well for others (I didn’t make it all the way through Real World Development). I look forward to future episodes from these guys and plan to go back to catch up on some of the first ones that I missed.

 

Barely holding On: DotNetRocks

This pains me to say because I have literally listened to hundreds of these episodes over the last few years, but my interest in dotnetrocks is rapidly waning. I’ve noticed myself fast forwarding and stopping halfway through quite a few shows lately. Perhaps they have just over-extended themselves when they moved to 2 shows a week or maybe they’ve just run out of steam after producing almost 400 hour plus long episodes. More than likely it is just my short attention span for show formats kicking in (I rarely can stick with a sitcom for more than a few seasons). Nevertheless, they definitely deserve praise for being the only game in town for so long and I would still recommend certain shows to people. Recently I really enjoyed listening to Ted Neward and Amanda Laucher on F#, Udi Dahan Scales Web Applications!, and Jeffrey Richter on the Windows Memory Model.

 

Fallen by the Wayside: Polymorphic Podcast, RunAsRadio, ARCast

I used to listen to occasional episodes of Polymorphic Podcast and RunAsRadio, but they seemed to have fallen off my radar these days due to time constraints. I also experimented with ARCast a long time ago because architecture seemed like a perfect focus for a podcast since it is so conceptual in nature, but I never quite warmed up to Ron Jacobs so this quickly dropped from my list as well.

 

I have a few of the Alt.NET Podcast episodes queued up on my mp3 player because the topics sounded interesting, but haven’t listened to any of them yet

Are there any other high quality gems in the podcasting world that I am missing?

Triple Shot Links # 6

Take a break from watching the stock market tank and your retirement savings dwindle and check out the following links.

  1. Growing Up Geek (A Hanselmeme) - Leon Bambrick (Secret Geek), a blogger after my own heart, posted the best meme response ever. After confessing that he used to beat up kids that looked like Scott Hanselman and steal their code, he then produces shocking photographic evidence of his own from his childhood.
  2. 9 Options, 4 Icons, 1 MessageBox - A great WTF expose from Bill Simser on some bizarre behavior from the Windows MessageBox API.
  3. Three simple Rhino Mocks rules - I’ve been stuck in .NET 1.1 legacy land for the last several months so I haven’t had a chance to dig into Rhino.Mocks 3.5 AAA syntax (Arrange, Act, and Assert) yet. Jimmy Bogard provides a very clear and concise explanation of how it works.

I Won!

…and I’m not just talking about my recent eBay exploits or that million dollar lottery in Ghana that I keep getting notified about via email.

Jurgen Apello, Dutch blogger extraordinaire, just notified me that I won his $100 Book Contest for my Driving Forces Behind My Coding Compulsion post, which I submitted a couple of weeks ago as an answer to his contest question about what motivates developers to do their job really well.

Somehow his alleged jury members chose me as the winner. I suspect that either I was the only non-fictitious person to enter the contest or else the winner was totally chose by random, but either way I made off with $100 Amazon gift certificate to spend on any of the books featured in his Top 100 Software Engineering Book List that he recently posted.

I decided it was best to indulge in my guilt-free tech book buying frenzy as soon as possible in case he changed his mind.

Here’s what I came up with:

My Choices

$100 isn’t very much money when it comes to tech books, but I stretched it out by shopping in the used book section.

Return to product information6 Robert C. Martin
Agile Software Development: Principles, Patterns and Practices

This Uncle Bob book has been recommended to me so many times that it was the first one I thought to look for on the list. I didn’t know there was an updated C# version until I poked around some more on Amazon.

 

Return to product information19 Andrew Hunt, David Thomas
The Pragmatic Programmer: From Journeyman to Master

This is one of those books that I read several chapters over several lunch hours at the bookstore, but never got around to buying. I figured it was only fair that I finally throw some royalty love their way.

 

 

Return to product information42 Mary Poppendieck, Tom Poppendieck
Lean Software Development: An Agile Toolkit

I’ve been hearing about this from Alt.NET bloggers like David Laribee for quite a while so I figured I should find out what all the fuss is about.

 

 

If Only I Had More Money to Spend…

These books were close runner-ups.

2 Elisabeth Freeman, etc.
Head First Design Patterns - I’ve heard high praise for this book, but it’s hard to get too excited about design patterns after all the blogosphere backlash related to their overuse and misapplication.

16 Donald E. Knuth
The Art of Computer Programming, The, Volumes 1-3 Boxed Set (2nd Edition) - I figured I would do my part to jump on the Back-To-Basics bandwagon.

18 Jeffrey Friedl
Mastering Regular Expressions - I desperately need to improve my RegEx-fu, but I ultimately decided that I could limp by with the help of the most amazing Expresso tool for now.

74 Michael Nygard
Release It!: Design and Deploy Production-Ready Software - Ayende has talked this book up quite a few times, so it remains on my ‘Books I should eventually buy and possibly even read’ list.

 

Current Bookshelf Favorites

I already had several of the books on his list, but these three are my favorites and the ones I would most recommend. They’ve easily had the biggest positive influence on my career as a developer.

1 Steve McConnell
Code Complete: A Practical Handbook of Software Construction

10 Martin Fowler
Refactoring: Improving the Design of Existing Code 

58 Michael Feathers
Working Effectively with Legacy Code

 

The one book I really wished was on the list was Domain Driven Design by Eric Evans, but beggars can’t be choosers.

** UPDATE: I just got the full list from Jurgen, which contained the last 25 books on his list. It turns out that Eric Evan’s book was number 89. That’s what I get for being impatient and picking my books too soon.

Thanks again to Jurgen for his most excellent prize.

Triple Shot Links # 5

A few good reads I discovered while recovering from my 16 mile training run over the weekend in preparation for the upcoming New York marathon next month.

  1. Transitioning between consulting projects -  Random reflections by Jimmy Boggard that contain good insights on the effect that absorbing new team members has on productivity and team dynamics. The post also has some good suggestions about focusing the majority of the modeling effort on the most critical, difficult, and volatile parts of the domain model.
  2. Top 10 Things That Annoy Programmers - One of the rare top 10 lists that don’t suck. I identified with all the items on the list, but if I had to pick the three biggest annoyances I would go with: interruptions (#9), documenting my applications (#6), and self-evident code comments (#10).
  3. For Fun: Bank Robber Hires Accomplices on Craigslist - A news gem that I found on Bruce Schenier’s blog. This is by far the most intelligent use of a web 2.0 social networking site that I’ve seen yet.

Triple Shot Links # 4

I spent all my blogging time this week brushing up on my paltry Ruby on Rails skills for an upcoming personal project and reading a most excellent book called  The Kite Runner, my first foray into non-brain candy fiction in over a year.

Here’s a few link recommendations to tide you over until I get inspired again to pull another real post out of my arse.

  1. Software Development’s Classic Mistakes 2008 - Don’t let the page count (40) on this white paper from Steve McConnell, the author of the classic book Code Complete, scare you off. It’s really a pretty quick and informative read with updated stats and insight about the most common mistakes that lead to project failures. While many of the catalogued mistakes are common sense, I came across a few thought provoking ones regarding excessive multi-tasking, noisy\crowded offices, inappropriate outsourcing, and over-estimating savings from new tools and methods that I’ll probably spin off into future posts.
  2. Epiphany on a plumber - A nicely written personal anecdote by Kyle Baley (Coding Hillbilly) about the intersection between passion and communication. As JP’s “Develop with Passion” mantra becomes more and more ingrained into our collective developer psyches, it’s good to get an occasional reminder about the importance of taking your audience into consideration before unleashing our new found passion upon some poor, unsuspecting soul.
  3. For Fun: 1 minute video showing condition 1 conditions in Antarctica: - Winter is just around the corner, so I couldn’t resist sharing this eye-opening video I came across on the Kickin’ In the Darkness blog. Suddenly my childhood memories of Michigan winters don’t seem so impressive anymore.