# How to code

- Link: https://www.andreidraganescu.info/2017/07/11/how-to-code/
- Published: 2017-07-11T13:21:08+03:00
- Author: Andrei Draganescu

#### The computer is an asshole

Learning to program a computer is a lot like talking to a person you’ve barely met.
You are kinda awkward for a while, they are also a bit of holding back on emotions
and both of you try not to screw it up.

When you program a computer you will write your things so that the computer understands
what you want.

### The script

For starters you will define some common ground.

This is a: car A car has: wheels, doors, body, seats, windows, engine. A car can:
start engine, stop engine, move, halt, move faster, move slower, steer (in some 
direction), wipe windows, signal (the direction change).

You will then explain how things are done.

How to: drive. Car! Start engine! Move! Move faster! Move slower! Signal (left)!
Steer (left)! Move slower! Halt! Stop engine!

And when they are done in what specific order:

How to: start engine. Get the key! Place key into slot! Rotate key! Wait untill 
ignition sound! Release key!

### Control structures

The computer is an asshole but time is a son of a bitch. It changes everything and
because of that we need to check first whether time has left our universe in place
of if it ruined everything we know.

For example:

 *  **if** I’ll still have my wooden house, I am coming home from holiday and I 
   will cook myself some fish.
 *  **while** the fish is frying, I will make some garlic sauce
 *  **for** each garlic, I need to to the same shitty peeling operation over and
   over.

### High level, low level, scripting, assembly, compile, memoize, recursive, lambda, clojure and more jargon

Smart people tend to formalize a lot.

The problem with formalization is also its main benefit: it limits interpretation.

In a heavy formalized environment limiting interpretation helps because it makes
communication fast and precise, but, if the emitter and the receiver have varying
levels of formalism assimilated to their culture, then it will make communication
not only slower, but seriously damage the information density in it.

Interpretation is the activity of relating what you receive with what you stored
so that the new makes sense and is connected to the old.

Formalisation is therefore self referential, as the more abstract it gets, the more
it requires previous levels of formalization to be assimilated. So it is a bad idea
to teach programming using mathematics.

What if you are not math enabled? What does a “control structure” mean to an art
graduate trying to make a circle spin on the damn screen, even mean?

The problem with computers is that they are machines.

Machines will not instantly help you unless **you ask them to** and unless _someone
made them helpful in the first place_.

The computer is an asshole. It does nothing unless you shout at it: do this! Then
it stops. Like a brat.
