Being Spoiled By Open Source Software

One thing we do in abundance in the Java developer world is use open source software. A lot! If you encounter a bug, there are a few things you can do in order of preference. 1) You can fix it yourself and submit it back to the codebase for other developers/users. 2) You can fix it yourself, and keep the fix to yourself locally. 3) You can locate the bug in the code and not actually fix it, but report it to the authors and let them know where the problem is for them to fix. 4) You can just report the bug and not actually do anything else and hope the authors find/fix it.

In scenarios 1-3 above, whatever problem you have with the open source code, you can work around it. It may be a HUGE bug for something you are doing, but a rarely used feature that most people will never touch. In this case, you are most likely going to fix it yourself instead of waiting / hoping someone else does it for you. Once that’s done, the problem is solved and you can move on to other things. Then you can submit it back to the codebase so others don’t have to deal with it.

Going back to the java roots, we fix open source code all of the time to get around bugs. We even have systems in place to host our own fixes on corporate levels for other internal developers to use, and processes to merge these changes with the master codebase when the fixed version and open source code diverge. It happens frequently.

If you are using closed source code, in which the source code is not available to the public, you cannot change it yourself. The only option you have is #4 above which is submitting a bug and hoping that someone, someday will fix it, and hopefully until that day you can find some workaround to it. For someone who is used to seeing the code, and being able to change it, this is very painful and I recently encountered it.

Using Game Maker, I found a bug that I consider pretty major. When trying to retrieve the contents of a url, and the website or  my local network is down, it behaves poorly. It throws an error message to the console, then triggers the HTTP Event but the contents of that event is empty. Essentially, there is no way to detect this error.

One of the major rules of developing over a network is you never assume the network is reliable. You MUST deal with this issue but with this bug it makes things difficult. What’s more tricky is the response code from this is an HTTP 200 which means “everything’s good” which is obviously not the case. I quickly found a workaround. I simply look at the response code and if it’s 200, but the response body is empty, I’m going to assume this situation occurred.

It’s a hack. A nasty, nasty hack. Pulling out my crystal ball, I can already see my future. Many months from now when I’ve forgotten about this hack, and I try to serve up a valid web page with an empty body for whatever reason, the software will think it’s an error condition and fail. I’ll be scratching my head and trying to detect why the network is down, or website is unreachable, only hours later to find this snippet of hacky code that is doing this.

I searched Game Maker’s bug tracker database and someone had this exact same issue. It was reported 4 months ago with a few desperate “Hey guys, you going to fix this?” and “Come on, it’s been 4 months now” pleas from the original bug reporter as this issue still persists and no one at the company has even looked at it.

I’ve worked around it, and it will probably bite me in the future, but for now I’ve moved on. In the open source world I would have fixed this correctly but I can’t with closed source. I’m such a spoiled brat.

Leave a Reply

Please log in using one of these methods to post your comment: Logo

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