Sunday, January 18, 2015

Cloud9, part 3.

More work with Cloud9. I did not intend to write multiple posts. Yet here I am.

I'm getting more impressed with Cloud9 (the proper spelling does not have a space) and I am getting more impressed with Python. (Cloud9 lets one use Python, Javascript, Ruby, or plain HTML/CSS.)

My project is in Python, and this weekend I was struggling with a problem in the webapp2 framework. The problem was not in the framework, but in my use of it. Having the source for the webapp2 framework and the Paste and WebOb packages made it possible for me to find my mistake and fix it. Such investigation would not have been possible with a language like C+ or Java.

Python's debugger was not helpful in tracking down this problem. It may be due to my unfamiliarity with 'pdb', or it may be caused by the use of multiple threads. I had to fall back to 'debug by printf()' to find my problem. Once I saw the actual values of certain variables, I knew the solution.

I'm getting familiar with Cloud9. It is an IDE that runs in the browser, which means I can access it from anywhere. That's a nice feature; I don't want to drag my files around with me. (It also allows for better collaboration among team members, a feature I have yet to try.)

Cloud9 copies a lot of the features from regular, PC-based IDEs, but it has its own style. I find it easier to use than Eclipse, which I have tried to use several times. Cloud9 sits on top of Linux, and it provides bash and terminal windows to your virtual machine. Anything you cannot do in the IDE you can do in a terminal -- but I've resorted to it only once or twice.

Saturday, January 10, 2015

Cloud 9, part 2

After several months of ignoring Cloud9 (the web-based collaborative IDE) I sat down today and did something with it. Today's task was to build a cloud app that was compatible with Google's App Engine. And after a few hours, I did just that.

Cloud 9 supports several languages: JavaScript, Python, Ruby, and PHP. I picked Python, as I have experience with Google's App Engine (GAE) and Python.

To build a Python app for GAE, one needs the webapp2 framework. Webapp2 handles the inbound and outbound web requests. Cloud9 supplies a number of libraries for Python, but webapp2 is not one of them. Not a problem, however, as one can quickly install it with the 'easy_install' utility, which *is* included. (The webapp2 website has the instructions, and a sample program.)

Getting the webapp2 sample to run took some doing. (In my opinion, their sample is almost correct byt not quite correct.. I had to import the 'os' module and enclose parameters to the 'getenv()' function in quotes.

I found the documentation for Cloud9 useful -- once I found the right page. The Cloud9 web site has poor indexing into their support pages. Finding the right page is difficult -- until you switch to Google.

Problems were not limited to the Cloud9 website. Google Chrome failed as well, often displaying its "aw, snap!" page, forcing me to re-load the Cloud9 website (not a small site, due to JavaScript).

Overall, my experience was a bit frustrating, yet successful. Cloud9 may not have perfect documentation, but the IDE itself seems workable.