ptg
CHAPTER 2 SAYING NO
38
And that’s exactly how it happened. Their store location service, found right where it’s
supposed to be on the top-right corner of their web site, is not a web service. It’s generated by
Java code. Ix-nay with the API-ay. And to boot, it’s hosted by a Gorilla Mart strategic partner.
Enter the nefarious “3rd party.”
In client terms, a “3rd party” is akin to Angelina Jolie. Despite the promise that you’ll be able to
have an enlightening conversation over a nice meal and hopefully hook up afterwards … sorry, it
ain’t happenin’. You’re just gonna have to fantasize about it while you take care of business yourself.
In my case, the only thing I was able to wrestle out of Gorilla Mart was a current snapshot of their
current store listings in an Excel file. I had to write the store location search code from scratch.
The double-whammy came later that day: They wanted the product and coupon data online
so it could be changed weekly. There goes hardcoding! Two weeks to write an iPhone app
have now become two weeks to write an iPhone app, a PHP backend, and integrate them
togeth— . . . What? They want me to handle QA, too?
To m a k e u p f o r t h e e x t r a w o r k , t h e c o d i n g w i l l h a v e t o g o a l i t t l e f a s t e r. F o r g e t t h a t a b s t r a c t
factory. Use a big fat for loop instead of the composite, there’s no time!
Good code has become impossible.
Two We e ks to Comp let ion
Let me tell you, that two weeks was pretty miserable. First, two of the days were eliminated
due to all-day meetings for my next project. (That amplifies how short a time frame this was
going to be.) Ultimately, I really had eight days to get things done. The first week I worked
74 hours and the next week . . . God . . . I don’t even recall, it’s been eradicated from my
synapses. Probably a good thing.
I spent those eight days writing code in a fury. I used all the tools available to me to get it
done: copy and paste (AKA reusable code), magic numbers (avoiding the duplication of
defining constants and then, gasp!, retyping them), and absolutely NO unit tests! (Who
needs red bars at a time like this, it’d just demotivate me!)
It was pretty bad code and I never had time to refactor. Considering the time frame,
however, it was actually pretty stellar, and it was “throwaway” code after all, right? Does any
of this sound familiar? Well just wait, it gets better.
As I was putting the final touches on the app (the final touches being writing the entirety of
the server code), I started to look at the codebase and wondered if maybe it was worth it.
The app was done after all. I survived!
“Hey, we just hired Bob, and he’s very busy and he couldn’t make the call, but he says
we should be requiring users to provide their email addresses to get the coupons. He