You are currently browsing the savant tag archives.

How Computer Programming Works

Posted 2007.09.19 0.00 in Computers/Internet/Technology by Stephanie

Writing a computer program is kind of like trying to explain a complicated task to a gifted three-year old who only speaks Esperanto.

What do I mean by this? Well computers are usually very fast, and they usually have a very good memory, but they are not very smart. They need you to explain things in detail, and the fancier the task, the harder it is to explain exactly what you want done. And in Esperanto, because no matter what your native tongue is, the computer speaks something different. Unlike three-year-olds, however, computers always do exactly what you tell them.

Example: Tell the computer to pick up your dry cleaning:

If you’re using a high-level computer language, then there might be lots of built-in functions or routines that you can use, such as getNextDryCleanTicket, accessCar, and driveCar. You still have to program the actual map to the drycleaners, so how many meters on what bearing. You’ll want to include some event-handling processes to respond to other traffic and so on. High-level languages work because someone else has done the low-level work of creating those various functions / routines.

If you’re using a low-level computer language then you have to build your own functions and routines, so instead of just accessCar you need to define how to access it (where’s the key, where’s the car, what the key does, how to turn the key, etc.)

At the assembly language level – the lowest level language – you have to tell the computer everything – not just what’s a key, and what’s a car, but what’s a noun. Then work your way up from there.

The bottom line is, computers always do exactly what you tell them; they just don’t always do what you want, or what you expect.