When I tell someone outside of my field what I do I think I say, "Hi, I'm a computer programmer." By their response you would think that I'm saying, "Hi, I'm an undertaker." People just don't understand the field. This is meant to quickly give someone a background into what we do.
Computer Programming Elevator Speech
You've probably used a computer to type a letter in Microsoft Word. Imagine if you could type in a recipe for cooking a cake into Word. Press a magic button and then a cake pops out of your printer. Computer programming is kind of like that.
Instead of recipes we type code. Code is a set of instructions that are both human readable and machine readable (after some processing). The computer talks in 1s and 0s called bits. If you put enough bits together into a hexadecimal digit you can start to build commands the computer understands. So the actual processor (like the Intel or AMD thing in your PC) understands hex digits as commands and memory locations.
Assembly Language
Humans have a hard time talking in bits and even collections of bits. The first computer code (or programming language) was assembly. It was very similar to the way the computer processes information, really the only thing it gave you were mnemonics for hexadecimal instructions. So instead of typing in 7a04b9 you typed ADD AX BX. To me, writing in assembly language is like chewing foil while getting my finger-nails ripped out.
Computers used to have very few resources. Huge international companies were run on less computing power than what is in your cell phone. Remember the Y2K scare? We had that scare because memory was so scarce that they represented years with 2 digits "71" instead of 4 "1971".
Modern Languages
There are many languages that have been popular since assembler. The general trend in languages has been to make it easier for humans to read and write. Sometimes this means decreased performance but with cheap processing power it's worth the sacrifice. Here is how a modern programming language might look.
for employee in employees: if employee.workedThisWeek(): employee.pay()
Here is computer programming at it's very core
First, you try to understand a problem. This is like the biggest understatement ever, people devote careers and write books on how to get this right. The technical term for this is requirements analysis.
Once you understand the problem you try to visualize the things involved and the way things should happen. We use UML to draw and communicate.
Then you start writing code. Humans can infer the meaning of words based on a lifetime of experience. Computers, however need very specific instructions. So writing code can be tricky. Fortunately we have IDEs (integrated development environment). These are like word processors for computer programmers. They make certain words different colors to convey meaning, help us navigate the code and complete words for us.
We have enough code to do something, now we want to run it. First we have to compile the human readable code into machine readable code. To do this we use a compiler.
Assuming we typed everything in right we get something we can execute. At that point we still need to test it to see that it does what we expect.
Stealing the Work of Others
Taking legal concerns into account computer programmers are encouraged to copy the work of others. In fact to be a good programmer you should be able to find and re-use things others have already done. To facilitate this re-use we have APIs (application programming interface) that are just recipes to do things we commonly have to do.
A big part of computer programming is finding, understanding and using APIs so that you don't have to write stuff yourself. For example, I wrote software to work with conferencing bridges but don't ask me how they work internally, I have no idea. I just used an API that made it simple for me to work with.
Object Oriented Programming
Another approach that helps computer programming is object oriented programming (OOP). Imagine you have a set of instructions for tying your shoe. Every time you want to tie your shoe you have to go through the recipe again. Doing it over and over you're bound to do it wrong. Object oriented programming is like building a button into your shoe that says Tie Yourself. The instructions for tying the shoe are baked into the shoe. Now if you want to change how your shoe ties itself you just do it in one place. In computer terms we say that we are associating the behavior (how to tie a shoe) with the object (the shoe).
Open Source Software
Open Source Software is a very big topic in computer programming. When you buy software from a company like Microsoft it's like buying a car with the hood welded shut. You can't see what's inside and you can't tinker with it.
Programmers work on open source software for lots of reasons. It's fun, they gain experience, respect of their peers (a very strong motivator for programmers). If you have used the Internet for a day you are 100% certain that you have benefited from open source. Open source ably powers sites like Google, EBay, Yahoo, you name it. Some people make fatal the mistake of thinking open source is inferior because it doesn't cost anything.
There are different business models for making money off open source, here's one description. Like medicine, the information about biology, chemistry, drugs, etc. is freely available. You pay people to use that information for your specific situation. So computer programmers can solve a problem by using open source software in a particular situation.
Geekus Erectus
The typical computer programmer actually enjoys what he does (seriously, not kidding). About half seem to have a traditional bachelors degree in computer science. The rest usually have degrees in physics, mathematics and electrical engineering. Maybe a quarter have advanced degrees. With that background it's no wonder that the field is overwhelmingly full of men.
They are very logical creatures. Studies show that they have a heightened sense of justice and logic. When they see unfairness they are particularly perturbed. As I said earlier they are also highly motivated by gaining the respect of their peers. Most of them are introverted (Myers-Briggs has me as an exception). Another common trait is that they enjoy learning. The term hacker (despite the negative connotation) just means someone who enjoys figuring stuff out.
Well that's an extremely high level overview of computer programming. Hopefully I haven't added to the confusion.
blog comments powered by Disqus