Saturday, January 17, 2015

Why Geeks Need to Know How to Write

    When faced with a programming assignment, I find it very difficult to resist the urge to just start coding without a plan. I get a very poorly formed idea of how to solve the problem, and I just start typing away using variable names that make no sense, and zero written explanations as to what the code even does. What I end up with is a jumbled mess of seemingly unrelated text filled with variables called 'a' or 'variable1' and a whole bunch of if statements that reference said variables. Unfortunately for me, the code usually works, and I learn nothing from my mistakes as I'm not the one who has to go back and try to interpret what the code is supposed to do.

    The problem is, if these methods were applied to a very complex program, or if anyone ever had to look through the code to identify a problem, it would probably be just as efficient to look through machine code. While the organization and comments on code do not matter very much to the superior processing power of the computer executing the commands, it is vital for code to be understood by our fellow meat-bags.


    It is one thing for code to work, but if no one can understand why it works in a reasonable amount of time, the code becomes useless if it doesn't work, or needs to be updated. This becomes especially important when working with other people, which often needs to be done in the programming world. Keeping logs of the coding process, explaining what the code does and how it works, and using relevant variable names are all vital if anyone is going to understand your work. If no one understands each other's code, then working together will be impossible, and any program that is too complex will simply not be possible. So for the sake of humanity, write code that is coherent to people as well as computers, or the computers will win. 

No comments:

Post a Comment