Tag Archive for 'coding'

Sometimes its like my brain is on fire

Over the past few months I’ve noticed that I just can’t get enough information into my head fast enough. My mind is constantly racing with ideas that I’ve been picking up through reading books, blogs, listening to podcasts, and actually working on projects. The more I learn, the more I want to know. I’ve always enjoyed programming and felt the same affinity for it as IT, however lately I find myself being drawn to programming more and more. Technology excites me and the prospect of leveraging new technology through programs I have written excites me even more. It’s a simple passion, but I like it that way because it gives me the freedom to truly enjoy the learning process.

In an effort to increase my skillset I have embarked on the journey of trying to get an MCSD certification. I know a lot of Rubyists would be shocked to hear such a thing, most people go the other direction. However, I am not abandoning Ruby, rather just “sweetening the pot.”

The path that I will be pursuing will be the C# path, and I’ve already begun to take a look at it. It’s amazing how easy it is to pick this language up. I picked up a book on this yesterday and going through the exercises I am already half way through it. I will say that having spent the last 7 months learning/working with Ruby has definitely prepared me for the object oriented approach in C#. While C# is more verbose than Ruby, I can still see myself having fun with the language. Also if John Lam or the Ruby.NET team continue to make progress with their projects, using Ruby to work on the .NET platform will be a breeze (and since I’m not a big fan of IIS, I’ll be eager to see how these projects work with Mono & Apache).

command line in windows? cygwin to the rescue.

I had totally forgotten about Cygwin until today when I came across a text editor for windows that can use textmate bundles. In their forum there was a post about e needing Cygwin to do some of its automation.

I used to cygwin years ago, and the idea of having unix tools on windows is extremely appealing. Microsoft is only recently coming on board with the idea of command line automation scripting with their introduction of Powershell. Powershell is definately something I’ll look into. Still, its nice to be able to install tools that are intended for linux or mac use and not have to set up a virtual environment to play with them.

I’m also looking forward to seeing how well e works.

My first “Agile” book

A week or so ago I downloaded the peepcode screencast on Test First Development. It was the first really clear example on Test Driven Development I’d seen and it helped clear up a lot of questions I’d had about it.

I was introduced to the idea of writing code based tests when I started learning about Ruby on Rails. When learning PHP (or any other language for that matter) it was not something mentioned in any of the literature I had encountered. But as Rails takes an “agile” approach to things, writing tests are an expected part of development.

Shortly after beginning my exploration of Rails I was hanging out in the #railsonrails IRC channel and Luke Redpath was talking about Behavior Driven Development (BDD) a variation of Test Driven Development (TDD). I was totally lost but wanted more information. He suggested reading Kent Beck’s book “Test Driven Development By Example” first and get familiar with that before trying to wrap my head around BDD. I promptly added it to my Amazon Wishlist and there it stayed until today. After watching that peepcode episode, I decided that I would finally plunk down for a copy of the book and today it arrived in the mail.

As the title suggests, this is my first book specifically about Agile Methodologies. While the Agile Web Development with Rails book is technically an Agile book it is more about the Rails framework than evangelizing and explaining any specific processes or philosophies. I’m looking forward to exploring the world of writing automated tests for my code prior to doing any sort of development. Hopefully it is as helpful as I expect it to be.

Exploring the Agile world

Well in my effort to develop my programming skills I’ve spent a lot of time listening to various software engineering podcasts lately. The most common theme throughout the podcasts has been Agile Development in its various forms. Some dealt strictly with XP and others dealt with Agile in a more general sense.

One person interviewed on two separate podcasts really caught my attention: Alistair Cockburn (pronounced Coe-burn for the non-Scottish). One of the original founders of the Agile movement, and someone who spent several years actively researching software development methodologies, Alistair’s approach was very practical and refreshing.

In an nutshell, he found that anything that made a development team work better together was good and should be kept and anything that inhibited productivity should be tossed out. The humor of this is emphasized in the fact that Alistair is a Ph.D.specializing in methodologies and has developed his own Agile methodology called Crystal Clear.

To be sure, he does identify certain practices that when applied often lead to an increase in productivity. However what separates Alistair from most other Agile methodologists is that he is not rigid in the implementation of his or any other best practices. This was captured in a story he told about how he was brought in to an organization implementing XP and struggling with the weekly meetings. The developers weren’t enjoying them and as a result were not benefiting from them. But since they were a part of XP the meetings kept happening. Once Alistair discovered this, he suggested that they drop the meetings until the next evaluation cycle (3 weeks later) and see if losing the weeklies helped. The solution while simple was revolutionary to the team because it showed them that nothing was set in stone and that they could choose what worked best for them in the situation/project they were working.

When looking at Crystal Clear you get a clear picture of the best practices that Alistair values most:
1. Frequent Delivery
2. Reflective Improvement
3. Osmotic Communication
4. Personal Safety
5. Focus
6. Easy Access to Expert Users
7. A Technical Environment with Automated Tests, Configuration Management, and Frequent Integration

Each of these are relative and flexible in their implementation and need to be defined based on the values of the development team and the requirements of the project but when applied they consistently yield an increase in productivity.

What makes this approach so refreshing is that the ultimate goal of the methodology is to help development teams make better software and enjoy the process. The flexibility on the specific implementation of methods while holding fast to the values that inspired those methods is profound and shows a true grasp of the complexities that each project has the potential to bring to the table. Ultimately it also comes closer to the values espoused by the Agile Manifesto than other methods that are more rigid in their implementation.

Rails Cookbook

Rails Cookbook (bookcover)
A couple of weeks ago I picked up a “Rough Cuts” version of the Rails Cookbook by Rob Orsini. This is the same book that was recently highlighted on the Ruby on Rails blog.

Almost immediately it started to pay for itself. I had a couple issues where I was trying to get my join model to be a sortable list but only keep track of a records position in the list constrained to one of the foreign keys. Well on page 117 there is a recipe for using acts_as_list that automatically manages the position of record in the model and takes a :scope => :model option to constrain the position field to keep track of a record’s position relative to the foreign key “model_id”. Each new “model_id” would behave as a separate list within the same model.

The recipe’s are logically organized and there are A LOT of them: 15 Chapters (560+ pages) dealing with every aspect of Rails you can imagine. While I prefer the writing style of Chad Fowler’s Rails Recipes a bit more, the sheer wealth of information in this resource can not be understated. And the content spans subjects at various difficulty levels from “I built my whole app using scaffold!” to “I’m getting a free ticket to Railsconf.

Two areas that were extremely helpful were in the areas on Active Record and RESTful resources. Since Active Record is the largest and arguably the most powerful part of rails , it’s really helpful to be able to leverage it’s features whenever possible. As they say, “Convention over configuration!” Also RESTful resources are brand new and as such there is not a lot of information out there to help you know how to best use them, so it is good to find resources that do.