Friday, November 29, 2013

Code, all of you


                In a somewhat recent trend, learning to program has become a popular subject. I think it’s great, but there are a few problematic concepts associated with it. The reason it’s great is because of how technical society has become. As a technical individual who does programming as both a career and hobby, it’s annoying to earn the association of “you work with computers? Well, my computer isn’t working…” Often, it’s the user, not the machine. But here lies the first issues, the general public shouldn’t be going from “Computers are complex, I don’t know how to work them” to “I’m going to program”. They should first learn general IT, a boring but simple and fundamental step to learning programming. If you know why you can’t plug a USB mouse into a Ethernet port (people have plugged them in there, and if it doesn’t fit, trust me, they make it fit) then they might know better that if one port doesn’t work, they can try another one. Then if/when they go to get the computer repaired, instead of “my mouse doesn’t work” (which was a user issue as the repair person will plug in the correct port and say everything works) they will say “The USB ports on my computer don’t work”

                Now, let’s take the next step… scripting. When people are taught math, they aren’t given a function and then told to solve it. They are first given numbers. What are the primitive types used in math. When people are taught formal language, they are first given letters, the basic primitives of the language. Next, in math they are given operations such as add and subtract, in language they are given combinations of words that are arranged in a certain structure. Rules are applied to the structures of words, termed as grammer. As time goes on, the simple math becomes simple functions, y=a+b, language becomes sentences, paragraphs, and pages. If we skip further ahead we have full math equations such as integrals and Taylor series and language becomes specific formatting, layout, grammer, written layout, and structuring.

                Now let’s look at programming, I mean scripting. First we learn the basic primitives; character, number, string. Next, some simple operations such as +, -, if, and goto. Now some might be thinking “hold on there, goto?”, yes, goto. Because… as stated, they should start with a scripting language. Most scripting languages have comparison operations, aka: a basic if, and jump statements to respond to the ifs, goto. Throw in learning storage of variables, retrieval of variables, printouts, and reading information from the user and you have a nice little Turing complete language understanding. Create a batch or shell script that will let someone pick a set of files they want to copy to a flash drive, and name it something well known such as “Backup Computer” and suddenly, the idea might click “if I run that, I will backup my computer.” If an error comes up saying “can’t find drive D:/” they should obviously know they didn’t have their flash drive/external drive plugged in. But, as anyone who has dealt with IT knows, and I will be blunt about it, people can be amazingly stupid sometimes. “Flip the switch on the back of the device”, they press the reset button with a switch being directly above it. This is where general IT comes in, the “Wait, this literal statement is literal. It means exactly what it says!”

                Now, let’s try this again: let’s look at programming. First we learn the basic primitives; char, int, string. Next, some simple operations such as +, -, if, else, while, and for. Next we combine these into functions like in math. We make a whole set of these and then call some of them from other functions. We make one special function called “main” and call all the others from it. Congrats good sir and madam, you have written a program. It was just like learning math and formal language, which both become primitive instruments to learning programming. “Darn, my computer’s running slow”, you’re general IT knowledge will guide you to discovering the cause of the slowdown. “Hmm, I fixed the slowdown. Now I need to combine these two files”, well, go write a basic program or script to do so.

                But learning to program just moves the complexity of the computer to the software while also making software an understandable concrete concept instead of a complex abstract one. But these basic learning steps teach one additional skill that seems lost amongst many today: problem solving. It’s abnormally common to find someone who can identify the problem, but can’t produce a solution. “Hmm, the computer isn’t working”, “Hmm, the car isn’t starting”, “Hmm, the oven isn’t getting hot, and I have company coming over in an hour”, etc. But there is the basic response “I’ll take the car to the mechanic” or “I’ll order take out”. But when a computer isn’t working, something that’s integrated into everything from your watch and (smart)phone, to your furnace, TV, game system (which is a computer in and of itself), car, and much more and nearly all workplace activity, even if it’s just punching in and out, that person is stuck. If they say “I’ll call IT” or “bring it to Best Buy”, it simply becomes another task that may or may not resolve the problem. Knowing programming can solve little tasks and issues in the modern individual’s life while reducing the overall feeling of complexity and difficulty of using a computer or other electronic device. It also provides a buffer between the computer issue and IT, who can then focus on updating the devices (which bring bug fixes and newer software) and fixing actual issues instead of “my mouse isn’t working”.

                Go learn to code, I’m not fixing your computer until then.

No comments:

Post a Comment