Re: Why Can’t Programmers.. Program?

Jeff Atwood made a post on his blog today about a simple test used to screen prospective programmers looking for a job. The reason: many people who claim to be programmers fail to solve the simplest of problems. The test:

Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”.

Just for kicks, I knocked out the program in Python in a few short seconds to see if I could do it. :)

# FizzBuzz test.
for x in range(1,101):
	if( (float(x%3)==0) & (float(x%5)==0) ):
		print 'FizzBizz'
	elif( float(x%3)==0 ):
		print 'Fizz'
	elif( float(x%5)==0 ):
		print 'Bizz'
	else:
		print x

Learning Python

PythonI started teaching myself Python recently because I wanted to enter the realm of desktop application development. The one thing I dislike about PHP is that it is, for the most part, bound to the web; you can’t really use it for anything else. Yes, I know that you can create desktop applications with PHP using PHP-GTK, but who has ever heard of a desktop application written in PHP? There aren’t even any in the applications section of the PHP-GTK site!

DjangoSo why Python? Well, I wanted a language that is relatively easy to learn and is multipurpose. Python was the obvious choice in my eyes. I figure if it’s good enough for Google, it’s good enough for me. A few of my favorite programs like Juice and Bittorrent were written in Python too. Another impetus to learn Python is Django as I have heard a lot of good things about it. I know I said I wanted to build desktop applications, but I still love web development. Don’t be surprised if this very blog is Django powered soon. Django is meant for rapid application development and if the stories about developers creating sites in minutes are true, then you can bet this blog will be Django powered in the near future.