Published 2021 Jun 20 @ 19:55
I have decided that it might be fun to post some stories of things I experienced that I thought were fun, interesting, or otherwise potentially-entertaining. I’ll try to avoid the names of people or places because I don’t want to necessarily call people out or make them feel embarrassed or be mean to any specific individual. I merely wish to relate stories that I think might be enjoyable to others.
The first story I wanted to tell is one that I told very recently to some other people, and thinking about how many other “short” stories that I have similar to it was the catalyst for this series of posts. So sit back, enjoy, and let’s get to it.
The year was 2010, or maybe very early 2011, but definitely one of those. I was working as a Platform Support Engineer for Sony Online Entertainment, the group responsible for the development of games such as EverQuest, EverQuest 2, Planetside, and many more. We were creating a branded card game that you could play from your web browser, but I wasn’t part of the game development team. I was focused on supporting the platform, such as chat, e-commerce payments, authentication, internal tools, and so on. From what I could gather, my team of three engineers (that’s including me) were among the lowest paid full-time staff. The only probable exception might be the QA team, but I’m not sure if they were considered full-time or contractors or what.
Regardless, it was a fun job. I learned a bunch of useful skills from my co-workers, not just those on my team, but everyone working on the platform services. There was a separate team, though, called application services. I can’t remember everything that fell under their purview, but they were best known internally for writing really crappy Java-based applications. I’m sure they had better stuff they developed, but I can only recall that the “largest” of their development efforts tended toward really subpar applications. I’m not sure exactly how much everyone on that team got paid, but it was more than what me and my two teammates were getting, easily.
One day, a junior engineer from the application services team asks if I could help him with something. Seeing as how I was maybe a year more experienced than him, at most, he probably felt most comfortable asking someone of a similar “greenness” to help him out, or maybe since one of my primary jobs was debugging and patching broken software he thought I would just be really good at resolving his issue quickly. Keep in mind, this engineer was probably making 50% or more above my salary at the time, despite being just as - or more - inexperienced as myself.
But hey, whatever, I don’t mind helping out my colleagues. Let’s see what the issue is. He’s coming from a Java background and a team that almost exclusively works in Java to a project whose backend service is written in PHP. He’s telling me how there’s this flow in his code that he can’t get to execute. Ever. There’s just a path of execution that is never taken. Basically, there’s an if/else statement somewhere that’s either always true or always false. So we go over the code together until I spot this:
if (strtolower(type) == "MAGIC_WORD")
The string literal wasn’t actually
"MAGIC_WORD" but you get the idea. Now for those with some level of programming experience, you might be able to infer what a function called
strtolower does, especially if you know that
str is a common abbreviation for “string” and therefore would translate in prose as “string to lower”. For those without any programming experience, now that I’ve written it out in prose I think even you can take a guess as to what this function might do.
If you guessed “it makes all letters in the string lowercase”, you are correct. That’s exactly what it does. So if you passed it, for example,
"MAGIC_WORD" then the result would be
"magic_word". In other words, you can never match against a string literal that uses any uppercase letters since you’re ensuring that your variable contains no uppercase letters. You can also use PHP’s pretty awesome online documentation to check this out in case you were unsure and wanted to know definitely if this is how the function worked. And yes, 2010 was not so long ago that online documentation did not exist; it did, Google was a thing too (if only barley), and you could definitely find the official PHP documentation with little effort.
So I asked him what he thought
strtolower does. He said he didn’t know. I asked him why he was using a function whose purpose he didn’t understand. He said he copied it from somewhere else online. He basically went to like a Stack Overflow post somewhere, trying to solve a very specific problem, then copied someone else’s code and did not at all bother to understand what that code was doing.
Well, I told him what the function did, why his conditional never worked as expected, got it into a working state, had him literally bookmark the index page for PHP’s official online documentation, and then never helped their team with any problem ever again. If you get paid more than me and you can’t even make a half-hearted attempt to do your work properly, I have no time for you.
Hopefully that wasn’t too long or boring, and hopefully if you made it this far you either skipped to the end (no shame in that) or you enjoyed the story just enough to slog through all of it. Thanks either way, I appreciate your time. More of these to come.