Wednesday, January 21, 2009

Is Computer Science an Oxymoron? Or am I just a moron?

image from http://www.headlineshirts.net/t-shirts/mass-quantities-of-code.htmlYears ago somebody told me that studying Computer Science would help me learn to write software. I believed that and so I spent 4 (er... 6 really) years getting a degree in Computer Science. Fast-forward 5 years after graduation and I am a programmer both professionally and as a hobby. So that advice turned out to be good, right? Wrong. In the past 5 years I have yet to understand how to apply what I learned of Computer Science to being a programmer. In fact since I've been a practicing programmer I have steadily moved away from identifying myself as a Computer Scientist. In my college days I called myself a Computer Scientist. Then when I got my first job I decided I was a Software Engineer. Since I have been at ThoughtWorks I have given up all pretense and I just call myself a programmer, though I have an eye toward the passionate types who call themselves software craftsmen. But what the hell?!? How about that notion of being a Computer Scientist? Was I just crazy? Four years of data structures, algorithm analysis, statistics, math. What was that all about? Ok. I'm not a complete idiot. The connection between Computer Science and Programming is obvious. Computer Science is the study of algorithms and transforming information. And that is central to what I do every day, but it just isn't the way I end up thinking about things. Instead I'm thinking about my tools, (languages, libraries, editors) the people I am trying to help and the problems I want to solve.

I could continue this discussion, but there is a much better writeup than I could do at Phil Windley's Blog about this. It discusses a talk given by Alan Kay, a real Computer Scientist. Do yourself a favor and go read it.

Saturday, January 10, 2009

Programming for Kids

As a kid I can remember going to the library to check out books about programming in BASIC. The books were geared towards young people and had plenty of games that you could tpye into your computer. Now days things aren't as easy for burgeoning young programmers. Even though computers are more prevelant than ever, the tools and knowledge for connecting kids with programming are still scarce. To get started programming you need that initial leg up. In the old days a book about BASIC was a leg up.

These days a search for "programming for kids" on Amazon wouldn't return any interesting results, until now. A new book called "Hello World! Computer Programming for Kids and Other Beginners" has just come out. It is a book in the spirit of those old BASIC programming books. It covers the fundamentals of programming using the Python language and has game programs that you can get started with including a lunar lander game and a ski-free clone. If you want to learn programming or teach it to a kid, this is your book. Enjoy!

Other resources:
  • http://scratch.mit.edu/
  • http://hacketyhack.net/
  • http://el.media.mit.edu/Logo-foundation/logo/index.html

Friday, January 2, 2009

Cloudy With a Chance of Words

Wordle: Cuberick I've always thought tag clouds were ugly. Until NOW. Wordle makes the most wonderfully customizeable tag clouds I've ever seen. Oh wait... I guess they are just word clouds. Anyway, they look great! Adjust the composition, colors, fonts and make your word cloud the best looking word cloud around. Go ahead and click above on the word cloud I created of this blog. See wordle in all it's splendor.

Thursday, January 1, 2009

Creating a Launchpad PPA For a Simple Python Project


For some background information on Launchpad and PPA's see my previous post. For more information about information given here check out the list of links at the bottom of this post. Now on to the bullet points:

Getting Launchpad Ready
  1. Create a new Launchpad project.
  2. Have imported your PGP key to your Launchpad account (apt uses these to verify the authenticity and integrity of packages it installs).
  3. become an Ubuntero (i.e. you must sign the Ubuntu Community Code of Conduct)
  4. activate your PPA on your profile page or your team's overview page.
  5. Build a source package for your project.
Building A Source Package For Your Python Project
  1. I followed these instructions but since we are trying to build a source package, not a binary package I made the following changes.
  2. Added a buildsrc target to the Makefile. See my makefile for specifics.
  3. Changed rules file to have a full path to the destination directory. See my rules file. I did this because Launchpad's process will be calling the rules file directly (probably via debuild) as opposed to using ghantoos's makefile which sets up the DESTDIR environment variable.
Upload Your Source Package
  1. install dput - sudo apt-get install dput
  2. edit ~/.dput.cf so it looks like
    [my-ppa]
    fqdn = ppa.launchpad.net
    method = ftp
    incoming = ~your-launchpad-id/ubuntu/
    login = anonymous
    allow_unsigned_uploads = 0
  3. Run dput my-ppa P_V_source.changes Replace P with the package name and V with the version number.
  4. Now you have to wait 5 or 10 minutes. Launchpad is spinning up a whole virtual server that will grab all the dependencies you listed using pbuilder or some such and will do a clean build of your package. An email will get sent out when your build kicks off.
  5. If you go look at your PPA your build will have a little spinny icon next to it. Here is my PPA site for example.
  6. If something goes wrong you will want to read the build logs to diagnose the problem. Click on one of the various binary builds to get to the link. Here are some sample ones from my build.
That is pretty much it. It is alot of stuff, but I hope my code serves as an example for you to get your own PPA setup. Questions are probably best answered on IRC. #launchpad on irc.freenode.net is loaded with knowledgeable types. Or you can drop your questions in the comments of this post if you have em. I'm no expert, but I might be able to help.

Those links I promised:
  • https://wiki.ubuntu.com/PackagingGuide/Complete
  • http://ghantoos.org/2008/10/19/creating-a-deb-package-from-a-python-setuppy/
  • https://help.launchpad.net/Packaging/PPA

Distribute Your Software Just Like Ubuntu With Launchpad


Launchpad is project hosting provided by Ubuntu. It is free for projects with an open source license. The service consists of distributed version control, bug tracking, team collaboration and other features too numerous to list. The most unique feature and the one under consideration here is the PPA, "Personal Package Archive". This feature allows you to publish your software to users using the standard ubuntu software installation and update tools (apt/synaptic). Imagine finishing a new release of your software, and at the click of a button Launchpad builds your software for multiple architectures, and notifies your users that updates are available. Brilliant! Before PPA's, maintaining a standalone package repository was out of the realm of what mere mortals could accomplish. Now launchpad has removed nearly all the barriers to entry. In my opinion this makes Launchpad the best project hosting out there.

It isn't all beer and skittles though. There is much to know about building packages for ubuntu. I had to spend the better part of a day learning about how debian packages work in order to get my PPA up and running. (It was worth the effort). And launchpad does have its warts. The user interface isn't very nice when compared to git-hub or lighthouse, and with the large number of features packed in there, it takes too long to figure out how to do something for the first time. Also, Launchpad can seem sluggish, especially the bug tracker, which can be infuriating if you are updating lots of bugs.

To sum it all up Launchpad isn't perfect, but it is the only solution for all-in-one project hosting: distributed version control, issue tracking, collaboration and software distribution. In my mind git-hub, lighthouse and google code are the only real contenders for the title. Git-hub has a great UI but doesn't offer issue tracking. Lighthouse has another great UI, but doesn't have version control. Google code is wonderfully simple, but doesn't offer distributed version control. If only I could combine the best parts of Git-hub, Launchpad, Lighthouse and Google code...

Coming up... Based on my own experiences of creating a PPA on launchpad for a project of my own I am going to write a walkthough of setting up your own PPA. However, I am going to make it a separate entry. If you are interested just read my next post.