Wednesday, January 25, 2012

Another Good Job

OK, you can do it, you can do it.

Type. Sweep. Cut. Paste.

Hold breath.

Click debug.

Watch screen.

See chart.

Notice lack of breathing.


Notice results.

Wow, it worked! I totally nailed it on the first run.

That's what I'm talkin' bout. Friggin' amazing what I can do.

OK, now let's add the labels.

I've been working for the last few hours writing graphics routines that will dynamically generate pie charts, bar charts and column charts based on results from database queries. I spent time with a bunch of off-the-shelf charting packages like Google-charts, but none of them do what I want them to do. The layouts look fine for simple data, but they get all out-of-sorts when you run more complex queries.

So I decided to write my own graphics library to draw charts.

I'm not sure how meaningful the above sentence is if you've never written software. Many software developers would consider the creation of a graphics library that automatically generates charts from database queries to be a substantial undertaking. It requires an understanding of graphics, of databases, of web protocols, javascript, php and sql. The diversity of the required skills mandates a team effort. The scope of the project requires planning and design.

Given the required cost and effort, and since there are readily available charting packages (limited as they might be), writing a charting library is not something many would do. And of course, they'd likely never do it if they needed to deliver it the next day.

The thing is, well, I've had a lot on my mind lately and something really challenging (i.e., impossible) and self-contained (doesn't require any other people or resources) might be a nice distraction. So yesterday at about 2:00 PM I began writing my charting library.

There's something about solitary challenge that I find to be regenerative. I like sports where it's just you and the challenge. I avoid exercise classes or gym memberships and team sports. I avoid sports where you compete with other individuals. I prefer to compete with the mountain, the road or the weight. I prefer to compete with myself.

I think that's one of the reasons I love programming as much as I do. It's you, the idea, the computer and the deadline. There's no right or wrong way to do it. You either get it done or you don't.

It's 7:00 PM. I've been typing, sweeping, clicking, cutting, pasting, reorganizing, deleting, compressing and expanding for five hours. I haven't once run the program to see if any of what I've written will work.

I look at the line counts: just over two thousand lines of new software. I load up a query, hit the run button and wait. A nice three-d pie-chart appears on my screen. The sizes of the slices are all consistent with the data. When I mouse-over a specific slice, a popup tells me what the slice represents and what its value is.

The process must be strange to observe. I talk to myself. I hold my breath as if watching a climactic battle between hero and villan. I shout encouragement. I cheer. I tell myself that I'm doing a great job.

Yup, it's got to be pretty weird to watch. Yet, it works for me.

It's kind of funny how our paradigms of encouragement seem always to depend on words from others. How we often shun self-congratulatory statements. What if we didn't need others to encourage us? What if we each contained all the encouragement we ever needed?

When's the last time you told yourself, "Good job!"

Happy Wednesday,

No comments:

Post a Comment

Read, smile, think and post a message to let us know how this article inspired you...