The Philosophy of Programming: What Humans Can Learn From Computer Languages

Programming is a way of thinking

Many people think of programming as a mechanism to tell a computer what to do, but it is much more. Programming is a way of thinking that can help you plan, execute and optimize the decisions you make in life. I work for a company called Semeon Analytics and we use Natural Language Processing (aka Artificial Intelligence) to decipher unstructured data. In essence, We teach computers how to read. If you have a technical background you know that neuroscience and Machine Learning programming go hand in hand. How the brain operates is very similar to that of a computer program. Systems, cognitive, computational, and theoretical neuroscience all focus on how the brain implements computations that give rise to behaviour. I don’t want to trivialize the complexities of the human mind, but a lot of breakthroughs in artificial intelligence have been inspired by studying the brain. By programming over the few years, I have started to notice some subtleties about how I think and have been able to use these to optimize the way I achieve goals.

Planning | Object Oriented Design

Planning is key to programming as it is to life. Every day when you go to work, do you know exactly what you are going to do? If you were like my first job, you go to work and you start to tackle whichever tasks come your way. This is a very disorienting attempt of trying to be productive. What about on a larger scale: do you have goals and aspirations you want to achieve? Can you tell me how you are going about achieving them? Most likely not. Many people today don’t put in the effort up front and instead attempt a brute force technique in order to get things done.
A major concept in programming called object-oriented design. On a basic level, object-oriented design is a concept that encompasses the thinking process behind programming something before you actually start coding. A programmer needs to understand how all the components work in unison before she starts coding. She may not understand how she is going to go about coding a certain section but the entirety of the design needs to make sense.
Whenever I used to go about achieving a goal, let us say learning French, I would attack the problem at hand with brute force. I would try and learn the language in an unstructured way. I would read books I wasn’t ready for. Now I use the concept I picked up from coding and design a structured regiment that has broken down the learning process for french into its key components. I wrote out all the different aspects one would need to master to reach the level of fluency. Much like coding, I knew the outcome I wanted, and I created a detailed plan beforehand so all I needed to do was execute and ‘code’ in a sense.
This goes without saying, but object-oriented design takes time, patience, and practice. It takes a great deal of critical thinking and a lot of unconscious thought. But, think and plan before you act and you will have a much higher likelihood of achieving your goals.

Executing | Errors

Once you think about how to approach a goal and create a plan that you believe will get you there, then you must execute it. If you are lucky, your code will run and achieve the outcome you were looking for, but the more complex the goal or system the less likely that will happen. There are so many interwinding parts that the chances of you misinterpreting how one will interact with another is extremely high.   As with coding, this will cause errors.
There are three types of errors in Java and each is extremely similar to ones that humans make when attempting to achieve their goal:
  1. Run Time Error: In programming, this error occurs when the program is running and it asks the computer to do something it can unreliably do. Runtime errors are comparable to a human miscalculating what she can accomplish at a given point of executing her plan. I had a lot of runtime errors while I was trying to learn French. I miscalculated the amount of time it would take to become proficient enough in the articulation of words as to start unconscious learning. When you’re designing your goals, do not expect the plan to be perfect. We are human, we do not have all the answers and the more complex your goals, the more complex it will be to achieve them. When you come across a runtime error, step back, reevaluate what steps need to be taken in order to get to the next part of your plan.
  2. Logic Errors: A Logic error in programming can be thought of a design flaw in your program. This error happens a lot in programming and in life. You think your code aka ‘plan’ is going to do one thing but ends up doing another. Perhaps your goal is to get promoted at work. You think that if you work hard and don’t make a ruckus that you will get promoted. But, perhaps that isn’t the case at all. Perhaps the correct move was to network and brown nose your boss. This is a logic error. In my personal opinion, these types of errors are devastating and often very hard to find unless you are continually evaluating the execution of your plan and reshaping it.
  3. Syntax Errors: In programming, A syntax error is an error that has to do with the grammar of your code. Every time I run into one of these errors while coding it reminds me of a time in my life that I made a small mistake. That time I blew my first job interview because I was too nervous. These type of errors happen when executing certain steps of the plan you designed. They are hindrances and easily noticeable. Although you planned out the code perfectly and the outcome will be exactly what you expected it to be if you follow all the steps correctly, you botched a small step along the way.
Achieving a goal is not a linear path. The smaller the goal, the more predictable and easier it will be to plan. You are a fool if you think that you won’t run into these types of errors along the way or perhaps you aren’t setting your goals high enough.

Optionality | Optimization

If you can’t-do it one way, you can do it another.
This is really the best thing about coding and planning in general. There is more than one way to code something. There are tons of languages and some of them can accomplish the same task. On top of that, there are different ways you can achieve the same thing in each language meaning there is an extremely large number of ways you can accomplish something. That being said, not every language was made equal to the same task and not every way to code something is the right way. There is a concept in mathematics (and elsewhere) called optimization. Optimization is basically the process of choosing the best option from a set of alternatives and it is probably the number one thing I have taken away from computer science. It’s amazing because you can apply this principle to many aspects of your life.
If your plan isn’t working as expected and you’ve run into an error that can’t be properly handled then there is probably another way you can go about achieving it. Not all plans were made equal and going back on a decision that you’ve made is inherently hard for humans but it’s a necessary part of achieving your goals. Be humble, expect failure, ask for help from people who know what they’re doing.

Conclusion: The Application 

For the past year, I have been applying these practices while working in a marketing role at Semeon Analytics. Optimization, planning, and watching out for errors are huge factors in the success of my role. Without knowing where you are heading, there is no way you are going to end up in the spot you wanted to be. On a concrete level, my teammates have transformed these principals into actionable steps that we make. This entails things like creating meetings specifically made to reevaluate our current operations and make sure that we are optimizing our roles are optimized. Whether this is talking about things we think could be automated or things we don’t think are proving to be as useful as we thought. We continually try and work efficiently as well as effectively but a lot of it has to do with the planning period aka Object Oriented Design.
This article inspired you or interested you I implore you to send it to a colleague or friend! If you are interested in the work we are doing over at Semeon Analytics with regards to unstructured data and natural language processing, I encourage you to check us out here. Make sure to subscribe to the Semeon Medium Account for more article like this!

Leave a Reply

Your email address will not be published. Required fields are marked *