Friday, December 19, 2008

I'm a Geek

It's true, and heres why.

There is a site out there called Project Euler, which is basically a collection of math problems that (most of the time) require a computer to solve them. The idea is that you get an account, and then set about solving problems, and after you successfully solve a problem you get access to a forum thread where you can discuss your solution with other geeks. I would be lying if I said this wasn't one of the funnest things I've ever encountered. I actually discovered it during the semester, but I wasn't able to spend any time on it due to school work. Now that I am on break, I decided to try my hand at some problems. As of the beginning of break, I had solved two problems. Now, I have solved 25 problems. This is a particularly important number, as you have to solve 25 to officially obtain level 1 status, which the website informed me 79.89% of members do not do. So yeah, I did it, and I enjoyed it.

This experience has also served to make me and even bigger Python fan-boy that I already was. I have used Python for nearly every solution, and have been nothing less than amazed by the power of the language. I mentioned in my last entry that I didn't think Python was a replacement for Java. Let me clarify that statement quickly. Java is tops in my opinion for building big, carefully designed, object-oriented systems. It offers convenient language constructs for taking advantage of all of the buzz words associated with object-oriented design (encapsulation, inheritance, polymorphism, etc.). However, for smaller projects, which make up 99% of what every programmer I know does, most of that stuff is total overkill. Using Java to write a little app for personal use, or to sketch out an idea for a program, is like trying to kill a fly with a jackhammer. For just about anything I can think of, short of building a industry level project or some kind of speed-intensive application, Python is a much better choice.

I also think that Python is a much better choice for education. My reason for this is that I think what we are primarily studying as computer scientists is problem solving. The computer comes into the picture simply because it is the single best available tool for solving problems. In this way one can think of computer science as simply being applied mathematics, only with a massive scope of problems. When I think of mathematics, I think of the following statement by Alfred North Whitehead:

By relieving the brain of all unnecessary work, a good notation sets it free to concentrate on more advanced problems, and, in effect, increases the mental power of the race.


Python, I believe, is a good notation in this sense. One of the main problems people face when programming computers is that computers are very stupid and must be told exactly what to do and must be given explicit directions on how to accomplish these tasks. This often causes people to spend more time fighting the language than thinking about the problem. The expressiveness of python combined with its compact and intuitive syntax allows programmers to turn their attention back to the problem and let the computer really help them with the problem.

For example, there is a guy I go to school with who is in his second year in the program. He is a bright guy, but not very experienced with computer programming. He was asked to do some independent, out-0f-class work on a project for out school's Bioinformatics Research Group. We were talking about it and I suggested he consider using Python for it. He decided that it would be a good opportunity to pick up a second language and started simulataneously learning Python and writing his program in it. The results were somewhat amazing. He, in one semester, managed to put together a prototype of a application that does some fairly sophisticated analysis on DNA sequences. The seriousness of the problem he solved with this program and the difficulty in solving it was miles above anything he had done previously, and far surpassed anything his peers were doing. This, I believe, was primarily because he was able to use all of his creative potential and problem solving ability in actually solving the problem, and that was due to his language choice.

So in conclusion, Python is awesome, and so is Project Euler. Hooray for geekiness.

No comments: