Some time ago, poor Keith found himself working on an antique Classic ASP codebase. Classic ASP uses VBScript, which is like VisualBasic 6.0, but worse in most ways. That’s not to say that VBScript code is automatically bad, but the language certainly doesn’t help you write clean code. In any case, the previous developer needed […]
Matt needed to add a new field to a form. This simple task was made complicated by the method used to save changes back to the database. Let's see if you can spot what the challenge was: public int saveQualif(String docClass, String transcomId, String cptyCod, String tradeId, String originalDealId, String codeEvent, String multiDeal, String foNumber, […]
Jon recently started a new project. When setting up his dev environment, one of his peers told him, "You can disable verbose logging by setting DEBUG_LOG=false in your config file." Well, when Jon did that, the verbose logging remained on. When he asked his peers, they were all surprised to see that the flag wasn't […]
Jason was investigating a bug in a bitmask. It should have been set to 0b11, but someone had set it to just plain decimal 11. The line responsible looked like this: byte number = (byte) 11; This code takes the decimal number 11, casts it to a byte, and stores it in a byte, leaving […]
The power of exception handling is that it allows every layer in our stack be notified of an error condition, do something about it, and pass it on if necessary. For example, if you have a data access layer and a query fails, you may catch the exception and potentially retry there, only passing the […]