Incorporating Web APIs to spark computer programming exercises
23/Sep 2010
This guest post is contributed by Karmen Blake, who is a software developer for Wildfireapp, focused on creating apps to better help companies integrate branded interactive campaigns with viral features of the social web. Karmen has over 10 years of experience in software development (Ruby since 2006) and 7 years of teaching web and software development at the college level. Karmen speaks at Ruby user groups and meetups on topics as RVM, Rails 3, BDD, and Erlang. He has contributed courseware to Rails Tutor and is active as a Rails Mentor.
I remember sitting in CS 225, my first college programming class. The teacher gave out the final project which was to create a hangman game. It had to use ASCII characters to draw the lynched person and letters while the person was playing the game. ASCII art at its finest! It was a straightforward console application when at the time the Internet and Web were not mainstream. That eventually changed.
(http://www.flickr.com/photos/trevor303/3445152780/)
I was fortunate enough to teach at a community college for seven years. I taught various web and software development courses (http://cis.scc.spokane.edu/?cissoftdev). I was given lots of educational freedom to change curricula and refresh it often. A major alteration was updating the core programming language from Java to Ruby. Not only did it motivate me to teach it but I saw students’ motivation factor raise a lot! It let the student focus more on problem solving, code structure, and efficient algorithms rather than fighting through the syntax of Java.
(http://www.flickr.com/photos/8377903@N06/3875768396/)
I use web apps everyday. Most apps I use are API based, for example Twitter. The programming I do is web-based. So it makes sense to try to mix the rigor of problem solving based console apps found in most university introductory programming courses with cool Web apis. When I taught I gave out lots of Ruby lectures and homework assignments, see: http://github.com/kblake/learning-ruby and http://blog.dudeblake.com/search/label/ruby. I was thinking it would be cool to add a spark of web api development to assignments to give them a fun twist.
For example, this class exercise which builds a histogram from random data:
Using the twitter api you can easily grab information and format in histogram form like this:
Another example is creating a menu driven system such as this:
Similarly, using the Pivotal Tracker API you can create a menu system to interact with it:
The opportunities are endless and vast. Other fun Apis to use are Flickr, Facebook’s OpenGraph, Github and more! Programming exercises should not have to be limited to the desktop because we live in an Internet world. Subsequent courses could then let students build graphical or web clients.
Programming education in general is improving dramatically. I recommend lessons and techniques from http://rubylearning.com/, http://testfirst.org and http://rubykoans as a few great resources for teaching Ruby to new developers.
Gems used in code:
- http://twitter.rubyforge.org/
- http://github.com/jsmestad/pivotal-tracker
- http://highline.rubyforge.org/
So – what do you think? If you have ideas, sites, resources, etc. that I haven’t mentioned, please post them as comments here.
Do read these awesome Guest Posts: