Author: William

Communication in Software Development

At a meetup I was at recently, the speaker asked what we thought were the most important soft skills. My answer was English, or more generally, communication. Programming can be thought of as communicating with the computer – telling the system what we want it to do – but software development is often just as much about communicating with other people. Before we code, we (sometimes) write a design that lays out exactly what the code should do. When coding, we (hopefully) name our methods and variables, and sometimes even comment, in such a manner as to make it clear to the future reader (whether that be ourselves or another programmer) exactly what’s going on. After the code is complete, we may write testing instructions that should be clear as to exactly what behavior is expected from the code. These are all areas where many people get sloppy. The design doesn’t really explain what the new expected behavior is, the code is difficult to read, the testing instructions are essentially just “make sure it works.” Often much of this documentation fails to be complete sentences. The result is debate over whether or not the code is working correctly, because the stakeholders don’t have a shared understanding of what “working correctly” looks like. For the QAer, clarity can be even more important: a bug report is much more useful when...

Read More

Missing indexes in Oracle

Some little details cause trouble entirely disproportionate to their importance. One such thing is a little quirk in how Oracle handles indexes. I have some code which gets a list of tables using a particular criteria and then gets all of the indexes associated with those tables. Under normal circumstances, the code works fine. However, when testing in a clean database, it will completely fail to find any of the associated indexes, even though they’ve been verified to exist. …or have they? It turns out that when the corresponding table does not contain any data, the index may still be associated with the table but it doesn’t really exist. So when you run a query like this: select * from dba_indexes ind join dba_segments s on ind.index_name=s.segment_name where ind.table_name=’MYTABLE’ It returns no results. Cue confusion. Adding a row to the table causes the index to actually be created and allows my script to start working correctly. Share on...

Read More

Being Matt

When I first started working as a developer over seven years ago, it was a bit overwhelming. Not only had I never worked as a programmer or used any of the languages I’d now need, I also had to get used to a lot of internal tools and processes that often had minimal documentation. It was, in a word, exhausting. Matt was another developer on the team who had already been with the company for half a year, and he was really good at his job. He wasn’t officially my mentor, but he encouraged me to ask questions. I had him as my code reviewer for my first major piece of development, and let’s just say he had a LOT of comments – everything from functional improvements to changes in variable names. It was frustrating, to say the least – but also educational. Having Matt review my code was a great way to learn what good code should look like, and as time went on I would actively seek to have him as my code reviewer whenever I was working on something particularly complicated; having Matt look at my code gave me more confidence that everything was correct. Matt recently passed away from cancer; one of my regrets is that I never got to know him socially. We had several shared interests, but I just haven’t made a practice...

Read More

Introduction to Foster Care

I’m going to go a little off-topic for this blog today and talk about something that’s not technology related but is important to me: foster care. My wife and I have been certified foster parents for several years now, and I find that there are a number of common misconceptions about what foster care is and how it works. What is foster care? Foster care is a way to provide homes and families for children who, for whatever reason, do not have parents who are able to care for them. Sometimes that means no living parents or parents who are currently unable to care for children; other times, this is children who have been removed from their homes due to abuse or neglect. Generally foster care is intended to be a short term solution until the children can be reunited with family members – if not their parents, then other relatives who would be willing to adopt. The actual length of “short term” may vary – children may be in the foster care system for days or years. There are approximately 400,000 children in foster care in the United States, including nearly 7,000 in Wisconsin. Who can be a foster parent? To be a foster parent, you must be at least 21 years old, have sufficient income to cover your own needs, have sufficient room in your home for...

Read More

Parsing doubles in Finland

One problem I had this week is that a piece of code which had, for the previous few years, been perfectly behaved suddenly started crashing for a new customer. This was the first time I’d seen the code run on a Finnish system, so a problem with internationalization seemed like the obvious place to start. Running the software on a fi-fi system, I found that a call to Double.Parse was causing a FormatException: Input string was not in the correct format. The issue here was that the code was attempting to parse a string which contained a software version number, e.g., “2005.100”. In a US English environment, this works fine – that gets parsed as 2005.1. In a German environment, this works fine – that gets parsed as 2005,100. Finnish, however, doesn’t use the period as either a decimal separator or a thousands separator, so when the system tried to parse the string, it didn’t recognize it as a number. The solution is to pass in the second parameter for Parse, which (at least in C#) is an IFormatProvider. When no IFormatProvider is given, the system defaults to InstalledUICulture, which means it was trying to interpret the string according to the system’s locale settings. By passing in InvariantCulture, I force it to ignore the locale settings and interpret the input as an English (no country) string. Double.Parse(version, CultureInfo.InvariantCulture) As...

Read More