Programming a computer is trivial, programming your colleagues is not

Subscribe to my newsletter and never miss my upcoming articles

A lot of people believe that programming is about formulating a set of instructions for a computer. But once someone has been programming for a while, it becomes apparent that this not the real challenge. Anyone can get a computer to behave as instructed, and in fact they behave perfectly almost 100% of the time.

What complicates the process is our understanding of the intended behaviour and our mental model of the data structures involved. As humans we come pre-loaded with context and assumptions that sit just below the surface of consciousness. A bug in a program is never a computer behaving poorly but a mental blindspot in our understanding of the intended behaviour versus the instructed behaviour.

In fact, we've made programming much more complicated for the sake of making it more understandable. Entire disciplines have been invented out of thin air to make up for the fact that humans are inherently terrible at thinking logically.

A great example of this is Object Orientated Programming (OOP), an entire paradigm that exists solely in our heads. OOP says "Lets think about our problem set in terms of the nameable objects in that problem, their properties, relationships, and methods/functions (actions, in layman speak)". So for example a car might be described like this:

class Car:
    wheels = new Wheels(4)
    motor = new Motor('large')

    def accelerate(self):
        self.wheels.releaseBrake()
        self.motor.increaseCombustion()

    def stop(self):
        self.motor.ceaseCombustion()
        self.wheels.applyBrake(5)

my_car = new Car()
my_car.accelerate()
my_car.stop()

Here we've said "Hey, I think a car should be an object that consists of two other objects, wheels and motors. Wheels can apply brakes and reduce speed, while motors can increase combustion thus supplying acceleration. A client using the car object can access these sub-objects by calling accelerate() and stop() on the car".

And this works, because smart people have created languages that translate this very human idea of interrelated objects and functions into something the computer understands - saved data in memory and saved functions in memory. Nothing more. In reality, computers haven't become any more sophisticated since the invention of transistors, but our ability to translate our ideas into code has, through more sophisticated intermediary languages, along with our access to machines capable of executing more instructions in less time.

So back to programming people. A programmer's objective is never really to make the program run, but to make sure they and other programmers can understand the program. While simultaneously ensuring that they understand the requirements well enough to know if the program is achieving its goal.

From this perspective, the stereotype of the socially inept programmer doesn't make much sense. A programmer should be a master of communication, if you're not agonising over variable names or the overlap of vocabulary between the problem space and technical vocabulary, then you're focusing on the wrong problems.

No Comments Yet