Thursday, April 26, 2007

Introduction to Programming

There are two types of people in the world: those who program computers and those who use those programs. Programming is similar to writing music. A piece of sheet music does nothing until it is interpreted by a musician. The computer interprets what a computer programmer writes.

Programming is hard because you have to tell the computer what to do in every situation. For example, let’s say a piece of code takes a number and doubles it. So if you pass the code the number 2, it returns 4, sounds simple right? What if you pass the code a negative number? If you give it the number -2, do you want it to return -4? The answer is sometimes yes, sometimes no depending on what the code is used for. What happens in the code if it tries to double the number but it is too big? These types of situations can happen. Programming these edge cases, that rarely happen, takes probably 50% of the total programming time.

Error situations like this take a lot more programming versus the “normal” things the program is supposed to do. Probably half of Microsoft’s Word programming is concerned with errors like checking if the hard drive is full. Programming is also excruciating hard because every single CHARACTER matters, there is no such thing as an “extra” word or character when you program.

1 comment:

Mihai Maruseac said...

Actually there are extra words. Useless comments, dead code, etc. :D

I'd compare programming with temple building or statue sculpting. Programming is creating something new, programming is competing with your Creator in designing new worlds.