Positive outlook   Leave a comment

And planning ahead.

Wednesday. I went to update the software with its new feature that I’d finished on Tuesday night.

Because this feature request was quite odd, its implementation was, fair to say, a bit of a hack. I was making a quantity temporarily negative to indicate a flag, to save adding extra columns to a ListView or some temporary storage or something.

Yeah, well, never trust anything you let the users enter, no matter how utterly ludicrous a given value might be. And never assume they understand how things work or what they’re doing. And a quick look at the code suggests you probably shouldn’t do what you’re told, either, even if it makes the SQL simpler.

Yes, I know, I am an idiot.

You might have thought my users could’ve used the bug-reporting feature to tell me I am an idiot, though.

Still, let’s look on the bright side: nobody could believe the numbers calculated were correct, as it was immediately obvious that they were literally impossible. Obvious idiocy is much better than subtle idiocy. Also, I now know of some valuable usability and sanity-checking improvements to make.

I changed the feature to temporarily set the ListView items’ tags to negative as the flag. This is a much less bad hack; they’re not used for anything else, and are pretty much set out of habit in this case. And they’re generated by the database. I *know* they won’t be negative.

At least until the database generates a key somewhere over two billion, which is interpreted as a negative number. But I’ll be so very dead and buried by then (quick estimate: a million years hence) I don’t care. And if the industry I work in still exists by then I will be even more disappointed in humanity than normal.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s