Always verify your variables!
Working at the technology team in fronter I see a lot of code, and I review patches on a daily basis. One thing you learn after a while is to see beyond the code that is in front of you: patterns emerge, you start to see problems that can arise because of a patch that maybe looks clean from the outside. We have staging tools and review applications that helps facilitate the process that we go through, and we have a process now that makes patching much easier than it was earlier ( it’s a ongoing process – you can always get better ).
Today I found a two very good examples online while browsing for some information regarding bowmore and arran whisky: “Culture name ‘nn’ is not supported.” This error appears on both the sites, I’ve only included screenshot of bowmore, but the error message is almost exactly the same.
I use a Firefox that is sending “nn” as the prefered locale to use, and the application apparently cannot handle this, and instead of defaulting back to english as the locale to use it throws an exception. The result: to see the website I have to go into preferences and move “English” to the top as my preferred locale. This should not be necessary, the browser is sending “en” when I have “nn” as default locale as well, but not in the preferred order.
This post is really about a couple of things:
- Always check that the element you are trying to use actually exists ( bowmore and arran apparently doesn’t have locale for Nynorsk (nn) ) before trying to use it. You should always verify that your variable is within a legal range of elements that can be used.
- Review your code! Try to see unforseen issues before they happen
- Handle errors gracefully, if not the user will not return to your site, and you can potentially loose customers ( don’t worry, I won’t stop buying Arran because of this! )
- I’m interested in how you do code review and the patching of existing code to ensure that bugs doesn’t happen. What tools do you use and what have you learned is the best process to learn developers to look ahead of the code that they work on.
I do hope both Bowmore and Arran can fix their site, because I prefer “nn” as my locale but I do enjoy their whisky, so instead of going the long way around to get some information I hope they can fix this little problem.