I’m currently working on a programming problem at work. This problem has my brain tied in knots, and it makes me realize that to be a good programmer you need to be able to think in a very specific manner, especially if the program you are writing deals with databases in any way. I know programming seems like magic to some people, you write code that makes the computer do things, but in all reality, that is the easy part of programming. You are, for the most part, just giving the computer instructions in a language that has rules. We all use these rules everyday without thinking about it, they are the basic logical operators of our lives. For example, if you get your mail and you are opening each letter, you normally first check to see who the mail is addressed to (unless you’re nosy). So you are taking a piece of data, performing a logical operation on that data, and then making a decision based on that logic. In computer terms, you’d be accessing a string (looking at the name), parsing that string to see if it equals your name (checking to see if the name you looked at is yours), then, if true, open the letter. 

The language used to write computer programs is really that simple. It may look a little different with all of the symbols used, the way it is spaced, and things like that, but you can think of writing programs as writing instructions in a different language that looks like English. That’s the simple part about writing software. The hard part is training your brain to think at a basic logic level and realizing every step that needs to take place in order for that to happen. When it comes to programming you have to think about and create each step so that the program performs correctly. We can’t just check to see if our name is the one on the front of the envelope if we don’t know what the name on the front of the envelope is. Even that part gets simple after a while. But that’s when things begin to get complicated. Programming has several constructs within it that are for advanced use. The array, for example. An array is a sequential list of things with the same name. In real life, this would be like having ten cats all named Baxter. Baxter[0] is the cat with the black stripe on his face, while Baxter[1] is the cat with white feet. Arrays make sense in programming because you’re often dealing with a bunch of something. Like names from a database. When you pull names from a database, you usually pull all of them because you are doing something specific with them.

But now that you  have all of those names you need to do something with that data, like list the names out. However, there isn’t any way to just tell the computer to list all the names. You have to list the names one at a time and perform operations like capitalization, or make some names appear bold if they are guys, or whatever the case may be. Thus we have the loop. A loop is simply a logical function that goes through every item in an array until a condition is met. Now, this is the most simplified way to describe a loop because they can become very complicated. We can create loops that do many things, like loop only ten times, or loop until we get to first names starting with the letter “c”. There is code behind it to make them do so, but the logic behind it is simple.

Where things get complicated is when you are dealing with arrays within arrays, and loops within loops, within loops. Sometimes you have an array that is returned from a database which includes a lot of information. For instance, someone’s name, their email address, etc. So when you pull all of this information, you have an array of arrays, or a multidimensional array.  And to get information from this massive data cube, you have to loop through each record from the database, and then loop through each result of the loop to check various things. So in the problem I am working on right now I have a big cube of data, that has three loops working to produce a simple list of names divided by first letter of the last name. Sometimes trying to force your brain to produce these types of things feels like you’re shoving a boulder through a keyhole. While our brains function like computers, they do it naturally. I can look at a list of names and just know how to parse it correctly. However, as a programmer I have to setup so many checks and balances to do the same thing that it can be frustrating. It is like I’m having to re-teach myself to think.

I wonder if this is the same case for stroke victims who have damage to language centers, or motor functions. Your brain knows it should know how to do these things, but forcing it to actually do them seems like a gigantic hurdle.