I've spoken before that whatever it is that you chose to work on, you're going to be married to it in a way you can't possibly fully understand until you're knee-deep in some edge case a week or more past whatever internal deadline you've set for yourself.

For instance, I thought I'd write a quick app to manage creating podcast feeds. And owning your feed really is one of the most important things to do when you start a podcast. Writing a quick utility like that shouldn't take long, right? It's just XML with some madlib spots, essentially a long string.Format call, with one one-to-many relationship. I've done really quick and dirty apps like this before.

From rufwork.com (for heaven's sake, don't download these ancient VB6 apps):

FAQ Maker
A quick VB 6.0 app made to make making FAQs easier. ย Add, edit, delete, change order of FAQ questions. ย Links, anchors, links back to the question list, etc, all done for you. ย CRAZY FAST. ย Get source to FAQ html into clipboard with Ctrl-G. ย It doesn't get any better.

There's no installer. ย If you have Win2k, XP, or have ever installed another VB 6 app it should "just work". ย Use at your own risk.

ย FAQ Maker exe download
FAQ maker screengrab
Stupid Pet Tricks
This is an idiotic group of text manipulation functions that I use fairly often in lieu of learning regular expressions as well as I should. Does do some interesting stuff, like insert wildcards from seperate files into repeated chunks of code, format tab separated rows (say from a database) into easy to read columns, etc. Again, at your own risk, yo. This one's just a zipped exe to download.ย 

ย Stupid Pet Tricks, aka "The Lazy Man's Regular Expressionless RegExp Tool"

Child's play, right?

Sheesh, no. Once you start programming for others (which even the wack apps really aren't), you've got loads of overhead you'd never expected.

Here's an example. For podcasts, you need to add a duration. Instead of asking users to slap in durations in a specific format, I split hour, minute, and second into separate textboxes.

three textboxes for duration

Simple, right? Well, sorta. What's wrong with this code?

this.CurrentEpisode.Duration = this.txtEpDurationHours.Text
    + ":" + this.txtEpDurationMins.Text
    + ":" + this.txtEpDurationSecs.Text;

Well, duh. What happens when any of the textboxes aren't filled in? How about if one is? What if they aren't numbers?

And I thought I was saving myself validation work...

This is a very simple thing to fix (first cut is below), but the point is that small decisions like this add up.

// This is in a static class of extension methods.
public static string ToDurationString(this string str, bool maxOf60)
{
    string ret = "00";
    int intRun;
    if (int.TryParse(str, out intRun))
    {
        ret = maxOf60
            ? Math.Min(intRun, 60).ToString()
            : intRun.ToString();

        if (maxOf60 && ret.Length < 2)
        {
            ret = "0" + ret;
        }
    }

    return ret;     // though note that I now probably have to check 
                    // for all zeroes when serializing to RSS.
}

I mean, how about this one, where I insert a subtitle for your new episodes based on the date, just as a default:

subtitle doesn't match edited date

Great if you keep the current time, not so great if you edit that time to something different. Then my attempt at giving you a "shortcut" doesn't work at all. In the above screenshot, we have a publication date of the 30th, but the subtitle still says the 27th.

So what to do? Do you look for dates in that format and automatically update them if the pub date is changed? Yes, you do, but what a pain... I don't want to have settings in an application this simplistic, but that also means you have to make sure all the "features" aren't ever annoyingly in the way.

See? You can't just skip stuff and expect users to figure out what actions bring down the app and what don't, like some unpatched, extremely rushed Playstation game. You have to mind the p's and q's and actually finish your work.

And that means you'll be doing whatever app work you decide to do for a heck of a lot longer than you ever expected. It also means, luckily, that you'll be a lot prouder of what you've made once it's finally out of the door...

This is the life of an indie.

Labels: , , , , ,