The Joy of Refactoring in the Green

by byamabe on January 22, 2010

I was BDDing some code for an idea I had for a Church Year website. I was using RSpec to drive the code that would return the church season based on a date. Some seasons are based on a fixed date, like Christmas, and others are relative to another date, Advent starts 3 weeks before the Sunday before Christmas. I didn’t document all the steps I took to write the code (I’m thinking of doing this as a kata), but what I wanted to point out was that at one point, I was “in the Green” and saw a bunch of duplicate code, ill-named method, and obscure variable names. I started making changes left and right while running the tests after each change and remaining “in the Green.” The experience was amazing to say the least. I hadn’t felt so proud of my code or excited about programming in a long time. I’ve always intellectually believed in the benefits of BDD, but that was the first time I’ve felt it emotionally. I can see why some people refuse to work any other way.

{ Comments on this entry are closed }

Does Anyone Have the Perfect Editor?

by byamabe on January 6, 2010

MPW, CodeWarrior, Visual Studio, Emacs, XEmacs, vi, NetBeans, Eclipse, TextMate, XMLSpy, NotePad, and any number of editors/IDEs all which I’ve used to write code. It’s crazy, but I’ve gone through more editors than programming languages and I still haven’t settled on one that makes me really happy. I almost standardized on Emacs, but it was too much like Linux in that I spent too much time working on it instead of using it. I almost standardized on Eclipse, but that thing is such a memory pig on Windows. I feel like ditching that thing but it’s the standard at work. I want TextMate’s simplicity and project-wide find, Emacs’ auto-complete and integrated shell, and Eclipses debugging and refactoring tools.

One of the big things that thwarts my efforts to find a single editor/IDE is that I use Windows at work and a Mac for everything else. If I ever leave my current job, I’m working somewhere that’s a Mac shop or is platform agnostic so I can choose a Mac to work on.

What brought this on? I was flirting with Emacs again, did I mention I love the integrated shell? Checked out the Cucumber bundle for TextMate, did I mention I love running tests with command-R? And suffered through a day of 400MB Eclipse taking 10s of seconds to open a JSP, did I mention that Eclipse is a memory pig on Windows?!?!

{ Comments on this entry are closed }

ADD or a Better Way?

January 1, 2010

I’ve done it again and decided to change the technology I’m going to use to build LaG. Some my attribute this to technological ADD which I freely admit to, but this time I believe my reasons are substantive.
Uncertain Future of App Engine Patch
I was pretty excited about being able to use Django on Google App [...]

Read the full article →

FBML vs iFrame

December 11, 2009

I’ve been working on the HTML and CSS for LaG using Espresso. I first created the markup in a base html file and then I’ve adding the CSS classes and styles as needed. I’ve now come to the point where I’m going to start implementing the UI in the server. The first decision I need [...]

Read the full article →

Just Trying to Test Leads to Cleaner Code

October 27, 2009

As I mentioned in my last post, I’ve been trying to get some unit testing going so that I can keep focused and gain a higher level of comfort with the code I’m writing. I started by trying move a business method that had crept into the model and put it in its own business [...]

Read the full article →

Refatoring for Unit Testing

October 17, 2009

I’ve been working on LaG for a month or so. Progress has been slow, because I haven’t set enough short term goals. I really need to get back to my GTD weekly review to prioritize and get to a list of actions for the project.
Most of the work I have done has been to flesh [...]

Read the full article →

Project Setup

September 11, 2009

app-engine-patch
Let’s get down to some programming. First, I downloaded app-engine-patch 1.1RC. This gives me Django 1.1 with Google’s model classes instead of Django’s own Model. For those who don’t know, Google App Engine (GAE) uses BigTable instead of a relational database like SQL Server or MySQL. With BigTable you trade the data integrity of a [...]

Read the full article →

UI Design

September 11, 2009

My UI Design Paradigm
Let me say upfront that User Experience (UX) design is a major weak spot in my skill set. I’m pretty good at exposing the functionality to accomplish a given task, but optimizing workflow, influencing behavior, and polishing experience are areas I need to work on. Part of the problem is that it [...]

Read the full article →

Designing the Game

September 8, 2009

In my continuing exploration of whether video games can convey the Gospel, I’ve decided to develop a Facebook game that incorporates some of my thinking along the lines of basic catechesis and apologetics. The basic idea is to have a Mafia Wars like game which has “catechetical tasks” instead of “jobs” and “apologetic encounters” instead [...]

Read the full article →

Facebook Game with Django on Google App Engine – Setup

September 7, 2009

Now that I’ve decided to write a Facebook app using Django on Google App Engine I plan to document as much of the development process as possible. The first steps were purely administrative. I registered a Google App Engine application called “law-and-gospel” (lawandgospel was taken). I then registered a Facebook application called “LawAndGospel.” Nothing complicated [...]

Read the full article →