Coding with Cloud9

An original article by author

image0It's been about a month since I've setup and coded with self-hosted cloud9 for TribeHired.

So let's see what have I learned so far.

Why code on the cloud

For TribeHired it's complicated, but let's just say it's a balancing act between business needs, learning curve and legacy code.

Legacy is such powerful word it really can override anything ain't it?

But seriously, being able to develop in browser per se has the benefit of getting started really quick. So your laptop got smoked? No problem, switch to a new one, load up cloud9 and start coding right away.

No more silly package management, dependency installation, and screwing around with Puppet just to make things easy. Besides, other colleagues are on Windows.

Down side obviously is you gotta be constantly online. I'll get to that later.

Self-hosted

I went with self-hosting the open source version, not the glamorous paid-for service in c9.io.

What that means is I got an excuse to learn to install node.js on Ubuntu 14.04 in order to run cloud9 on it. Getting it cloud9 running as a service was pretty dirty at first. The service kept dying, but that's my fault for not knowing to use nohup to keep it alive.

Going with the open source version has some clear limitations.

For one, we have to settle with having one code-base, as opposed to separate repo instance for each coder. So that makes git commits complicated, to say the least.

And there's no in-app chat or collaboration features. Well if you don't know those things ever existed, you won't know to complain.

The open source version is pretty much built for single user for a single instance of a project. For now we're collaborating on it with blissful ignorance.

Running commands

It's not SSH, but being able to run command on cloud9 is invaluable.

I dunno how it works behind the scene, but git runs (most importantly), running PHP composer works, and generally executing any runnable script in the project directory.

Editor

I'm talking about the part where code is written, not the entire IDE. It's absolutely sweet.

I didn't know what's possible with web-based editor until I used this. I expected it to feel handicapped being on a browser, but it feels as smooth as a native app.

Being able to bring up files quickly is awfully cool too.

Reliability

Here's where it goes beyond engineering.

Given unreliable internet connection, you may end up not knowing if a file you've open has been edited by another guy (which you should). The prompt to save or merge a file doesn't always show up.

Saving file is another pain. Despite my best effort, a file can be stuck in 'saving...' state and never get out of it. The IDE keeps blinking in orange, thinking it's saving the file but not knowing it's already saved. Re-opening the file doesn't help, I still see the old unsaved version.

Times like this I need to save the file locally, refresh the entire IDE and open up the particular file again. If the code is old, I replace it with my local file. Not to mention refreshing the IDE has the down side of seeing dozens of files opened by my co-workers.

Worst of all, albeit rarely, the entire cloud9 service can simply crash. I can't tell how the user end cause this, the error log ain't helpful to me either. I had no choice but to restart it via SSH.

Verdict

As a first experience, cloud9 didn't disappoint. I can only hope the open source version will get out of the single-user trap soon.