LFNW09 - Developing in the Clouds

I gave a talk at LFNW '09; I started with the question "can you create a web application, development to deployment, all in the browser?" I already knew the answer; yes, because of my experience with Bungee Labs' BungeeConnect project, and Heroku's HerokuGarden project.

A variety of solutions exist for creating web content in your browser, but most of them are exceptionally limited, or niche products. These include Yahoo Pipes, Google's Gadget Editor, and AppPad. Unfortunately, none of them provide an complete, robust development environment, leaving... wait for it... BungeeConnect and HerokuGarden. :-)

What the heck is BungeeConnect?

Bungee Connect, from Bungee Labs, is Object-Oriented Programming for the web. No HTML/JS/CSS required. Familiarity design patterns, on the other hand, is. But don't worry too much about it - there's a complete learning curriculum ( videos, sample code, even tests!) to get you up to speed.

The best way I know to demonstrate a programming language, though, is to dig in. So, here's 19-minute video showing the complete process of developing and deploying an app, from 0 to a published app.

Download native resolution video as OGG/Theora or AVI/h.264 (download link at the bottom).

You have what kind of garden?

In a fit of asexual reproduction, Heroku recently split their solution in two: heroku.com is now a paid service for hosting Ruby on Rails in the cloud; herokugarden.com continues to provide the service of my primary interest - web based development of live-deployed Ruby on Rails application. This is straight-up Ruby on Rails, no monkey business. You need to either know or be learning RoR, or this system will be useless to you. Thankfully, RoR has a robust community, so tools, tutorials and samples are never far away.

Again, I think its better to show than to talk, so here's the video: building an RoR app on HerokuGarden, in 12 minutes!

Download native resolution video as OGG/Theora or AVI/h.264 (download link at the bottom).

Small Note: Please don't judge my coding abilities in either environment, as a result of the samples. I do produce solid, well documented, tested code on a regular basis. Just not in the under-20-minutes category ;-)

Thanks to Brad at BungeeLabs for some visuals that help explain the BungeeConnect environment, and everyone who attended my presentation at LFNW. See you next year!

BungeeConnect Basecamp API version 0.1.4 "Green Bar" - Release Candidate

I revved the BungeeConnect Basecamp API tonight, with the following improvements:
  • Time Entries have complete test coverage. Thanks to Yamato Engine Specialists for allowing testing of the API with their account.
  • Messages and Comments now have complete test coverage (and yes, the tests pass).
  • Todo-Items now update all recommended fields; v0.1.2 only updated the text of the todo-item.
  • Milestones update successfully; Milestone due-dates were incorrectly types as DateTime - they are now properly typed as Date.
  • An issue with properly identifying responsible parties for milestones, and todo-items was resolved.
The following issues are still outstanding:
  • There is currently no support for Attachments.
Prerequisites (unchanged):
Just as a reminder, this code is released completely free to the BungeeConnect community; feel free to use and abuse it to your hearts content.

CampHappier Project

I'm also proud to announce that this code is also the first Release Candidate from the CampHappier Project: a group of code components arranged around the concept of making 37Signals' Basecamp Project Management app more feature rich via the API. Chime in on the Wiki or via GetSatisfaction.

Drop me a comment and let me know how you're using the code.

Google Mobile Apps Just Keep Getting Better

This morning the GMail team blogged about a new feature for the Google Mobile Apps - a map view of your contact list... nice.

Although this has been seen before (I'm sure there's an iPhone commercial of something similar), Google will make it significantly more useful by not limiting it to a single platform: the app has runs on Android, Blackberry, S60, Windows Mobile at launch, and (eventually) will support the iPhone.

This just makes me miss my Blackberry even more...

Official Gmail Blog: See where your friends are with Google Latitude

BungeeConnect Basecamp API version 0.1.2

I (finally) updated the BungeeConnect Basecamp API this morning, with the following improvements:
  • Milestones and Todo-Items no longer error out during the uncomplete function.
  • Getting archived messages correctly uses the AbbreviatedPost class, instead of the Post class.
The following issues are still outstanding:
  • TimeEntry methods are not well tested, as this is a premium feature. I've asked 37Signals for access to TimeEntries for testing & development.
  • Update methods are still failing out. BungeeLabs is working with me to resolve this issue.
Prerequisites (unchanged):

Getting Started with Rails

I've recently had a few inquiries about how to get started writing web apps with Ruby on Rails so, in order to repeat myself less, and in general, congeal my thoughts, I blog:

(1) Learn Ruby.

Unless you're a Smalltalk &/or Perl whiz, and instantly absorb unusual programming syntax, Rails will seem like black magic without a clear understanding of how Ruby works, and what it is capable of.

Ruby is a non-compiled (scripting) programming language. It's very plain-english in style, and, from what I read, draws upon some of the best practices of Smalltalk and Perl. Yes, Ruby comes from Japan. Yes, everything is a first-class object. Yes, Ruby is a scripting language. No, it doesn't compile. Yes, it really is cross-platform. And, yes, it does totally rock.

Go to the source and read a bit. Wow yourself. Then go buy a good book. I recommend the PickAxe book from Pragmatic Programmers.

(2) Pick a working environment.

A key to getting your work moving will be to develop a stable workflow. (I hesitate to use the term IDE, because I associate it with big clunky develop-crap-ware, like Visual Studio and Eclipse. Yuck.) Ruby is extremely flexible here, leaving you plenty of choices from which to select a good fit. So do so.

If you like to work online, Heroku/Heroku Garden are your workspaces. If you think GMail is a 1st class email client, Jungle Disk is the best removable media you've ever used, or subscribe to the Bungee Labs mantra 'Build the App, not the Crap', then Heroku is your new best friend. Heroku is built around a web application for developing and testing Rails applications. What about deployment? Get over it. It's waaaay easier than you think. BTW, your test app is publicly deployed, as you develop it, if you so choose. ;-)

If you like IDEs, and took serious offense to my prior parenthetic remark, please please download NetBeans w/Ruby. You'll do just fine. Or, if you're primary OS is Windows, NetBeans is for you, too, because command-line work in Windows still isn't any fun. NetBeans will let you run projects either on the built-in JRuby, or any other local Ruby install. If you plan to do something freakishly wacky, like run Rails apps on a Java App Server, this is also the place for you. Otherwise, install Ruby and switch the Netbeans default platform over to it.

If you worship Steve Jobs, then take out a withdrawl from your Mac Tax account and iBuy your iSelf a copy of Textmate. That's what all the cool iKids use.

What do I use? NetBeans on Linux. Until it annoys me, then I go back to gnome-terminal and gedit. I use a custom script (called grails - yes I do like to gname gthings on gnome) that launches gnome-terminal with 3 tabs (a web server in development mode, a ruby console in development mode, and bash in my project folder) as well as gedit with the folder view rooted on my project, with the database schema & the README open (one of these days I will read it...).

(3) Commit to learning Rails.

Don't even think about all the cool things your first Rails app could do. Stop drooling over how many plugins you could use. Get a book. Take a class. Run some demos. Write 50 Hello World apps. Learn how it works before you even think about making it do what you want. Think of it as investing in your Karma. If you go into your first Rails app thinking it will be anything useful, from an amazing .com startup to a little toy for your spouse, YOU WILL NEVER DEPLOY THE APP.

If you're going the NetBeans route, Sang Shin has a course that covers all the bases, and all the basics, and puts you through the Hello World wringer. Pay attention, stay on schedule, and turn in all your homework and you might just walk away with a Certificate in Rails for your Ego Wall.

If you're bookish, go get yourself a copy of The Rails Way, by Obie Fernandez. Kiss the cover. Sleep with it under your pillow and hope for osmosis. This book is awesome. Amazing. It will knock your socks off. And if you're wondering who this Obie guy is, he's serious. He's got a nice little company that walks in and builds production Rails apps from scratch in 3 days!

As strongly as I recommend TRW, I recommend avoiding Agile Web Development with Rails. This was my first Rails book. I thought it was pretty good, but that's only because I didn't know better. It misses many of the finer points of Rails completely, and although it does walk you through building a demo app, the implementation leaves much to be desired. Besides, the Depot App is included in NetBeans, for your study pleasure. In my opinion, covering SQL design in the MySQL console, instead of Migrations, is neither Agile nor Rails-ish.

(4) Continuous improvement requires continuous absorption.

Subscribe to blogs. And podcasts. Read wikis, and READMEs and newsgroup archives. Google 'Rails anything' and see what other people did. Someone smarter and more experienced than you probably wrote a tutorial on how to solve your Monolithic Problem with 3 lines of code.

In no particular order:
Also, when you're ready for some serious 'a-ha' moments, get yourself a copy of Design Patterns in Ruby by Russ Olsen. Imagine: you can learn design patterns in a OO language without having to wade through miles of C++ or Java code, and learn a few Ruby-only design patterns. Prepare to truly grok how Rails works for the first time.

(5) Teach your app cool tricks.

That problem that you're thinking about solving - the one you just filled the whiteboard sketching out - someone else solved three years ago. Yes, there's a plugin for that. Maybe a whole gem. Google 'Rails myproblem' and you'll find a million solutions. Afraid you're going to muck up your work? Copy the whole project to another folder, then install the goodies there.

(6) Get comfortable with a Revision System.

Subversion. Git. CVS. Mercurial (woot!). Whatever. Pick one. Use it. Again, if you're one of those 'living in the clouds' folks, you should have no problem finding a hosted revision system, especially if you're going to build an open-source app. Check out Github for Git, or Sourceforge or code.google.com for SVN.

(7) Deploy your app with robust resources.

Don't expect a $5/month hosting account to handle your app well, even if you're the only one using it. Starting up a Rails app is system-intensive. If you are using hosting, I'd recommend a VPS to start with. Or your own server if you've got one. Bandwidth is usually much less of an issue than available CPU cycles.

Slicehost offers solid VM hosting starting at $20/month, and it should do fine for your startup app. I default all my new app VMs to 256 megs of RAM and 1 CPU, and flex them up when there is demand.

If you're going to host yourself, check out Jumpbox's Ruby on Rails VM Appliance, configured excellently on a Ubuntu server.

If you decide to build from scratch, don't get hung up on old software, just because its there. I run all my production apps on mongrel, the same server I develop with. I use either pound (pure reverse proxy with an HTTPS wrapper) or nginx (if I need to serve a bunch of static content, and don't want to tie up my mongrel cluster doing it) as a reverse proxy, depending on the apps requirements. Both have super-low requirements, super-easy configs, active developers, and good behavior.

That's all, folks!

If I missed anything major, I'll do a follow-up. Feel free to add your own best practices in the comments!