Crawl In a Hole and Die

There are a few things of late that have really gotten on my nerves. Here they are:

Exceptions happening in the normal flow of logic

I generally work with Visual Studio set to break on any exceptions. I do this because I like to know where exactly things explode (which is often). To turn this on in Visual Studio, go to Debug->Exceptions and check both checkboxes next to “Common Language Runtime Exceptions”. This will cause Visual Studio to halt on the line of code that throws an exception. This is particularly useful when debugging things.

This also becomes really annoying when not debugging things that still throw exceptions. I’m sorry, but they are called [em]exceptions[/em] for a reason. An exception is something that happens that is not ordinary – something not normal. If you are having exceptions thrown in your regular sequence of events in your application, you are quite possibly doing something wrong. Consider reworking function calls so that rather throwing exceptions they return true/false on success. Of course there are legitimate times to throw exceptions (like when being given garbage input), but that shouldn’t be your normal flow of events. Perhaps understandable if you are parsing through irregular input, but you really shouldn’t be throwing exceptions all willy-nilly.

Fix/Patch it until it gets too bad to work with

If your code looks like a rat’s nest made of spaghetti and tangled kite string, it’s time to reconsider not just your code but your coding practices. Cars require preventative maintenance. Homes require preventative maintenance. Lawns require preventative maintenance (in the form of mowing regularly). So does code. Code often grows with modifications, updates, etc. Before things get too bad, perhaps you should reconsider cleaning things up and reworking things before they get too ugly. Maintaining a rat’s nest is an ugly, ugly, job that no one really wants to do. Why not take a little time to make things better before they get worse? There’s something to be said about the old adage ‘A pound of cure is worth a pinch of prevention’.

Lists of things

If your users have to make selections from long lists of items, they are probably going to want to punch you in the face after a while. Part of my first co-op (student work term) position involved working with a certain piece of software that was used to copy things from a test environment to a production environment. This involved selecting items from very large lists (picture a .Net list box or a drop-down list box with several thousand similarly named items. After several weeks of this I was ready to go postal on the person who created it.

Users are not computers – they aren’t good at filtering out the stuff they need from the stuff they don’t. Help them out. Limit list controls to a proper amount of items. Allow large lists to be searchable. Allow filters to be used to limit visible information to things that are relevant.

Small things make big differences

90% of applications are rubbish because of a 10% difference. Let’s be completely honest -a lot of the applications out there are garbage, including some that I’ve made or worked on. They aren’t garbage because they don’t work, they are garbage because they don’t work as well as they could. When your user says “Why can’t I do that?”, that may be a subtle clue that something is missing or incorrect (or that the user doesn’t understand their own business logic).

Anyway, that’s more than enough of a rant for now. Moral of the story: write software that doesn’t blow chunks.


Leave a Reply

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

You are commenting using your 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 )

Google+ photo

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

Connecting to %s