Thursday, October 25, 2012

Developing on the Chromebook

I love the concept of the Chromebook/ChromeOS and I think its concept is at the right place and right time. The internet seems omnipresent and having your stuff in the cloud makes it convenient and available to you whenever and wherever you are with any device. Having your stuff in a centralized place also makes sharing & collaboration so much easier. I can only imagine how much brainpower (& Schrödinger cats) it took for Google to nail this with Google Docs.

That said, it is still ahead of its time when it comes to my work, though it really doesn't need to be. My job is mostly web (Drupal, PHP and Perl) development and I primarily use 3 applications on the front-end (Eclipse, Terminal and Chrome) and 2 applications on the back-end (MySQL and Apache [with Perl & PHP support]). Nothing really CPU-intensive and in my opinion, it's a perfect fit for the ChromeOS environment. I thought I'd share my thoughts on how it could work...

Chrome

First, the easy one: Chrome. Check. It would be cool to have some way to test webpage rendering with other browser engines so we can do cross-browser testing on one machine, but that's probably a pipe-dream.

Eclipse

This is also an easy one, as there are multiple cloud-based IDE solutions out there. Cloud9 and ShiftEdit come to mind. Here are some must-have features as I see them:

  • Offline support: If I'm offline, I should still be able to open & edit my code. When I'm back online, my changes should sync up with the cloud. I don't think it's necessary to merge my changes with any cloud changes, as I'm usually working on my own repository branch anyway.
  • Git support: Yes, there are other repository systems, but Git is awesome and dare I say, the most popular one? This can also handle the dirty work of merging my changes with the rest of the team. Being able to hook up to multiple Git repositories, including SSH ones with keys, would be great.
  • Customizable language-specific options, such as syntactical color coding and formatting.

Terminal

I use Terminal mostly to look at error logs and open a MySQL console. This functionality could be incorporated into the interface for a backend system.

Backend System

This is (what we call in the South) a big'un (big one, for the rest of y'all ;)). One of the nice workflows that I have is when I make a change in my code, I save and then go to my browser to refresh. All of this is done locally so when I break something, it doesn't affect anyone else. So what I envision is some sort of app that has lots of knobs & dials to configure a local database and web server instance. Or it could be made simpler by creating a virtual machine instance and having a console window where the developer can do the configuration stuff manually. It could mount the filesystem that the code editor is using to run the code.

If someone nailed this, it would open ChromeOS as a web development platform, which would not only open the doors to millions of web developers, but allow for more people to become web developers, building a better Web. :)

NOTE: This is all high-level and I'm probably missing a few details ... feel free to comment below with your thoughts and suggestions.

Saturday, July 23, 2011

Go and Templates

I spent way too much time last night trying to figure out the template module and Go, which I admit, I'm still in the learning phase, so the syntax of stuff is still challenging.

Anyway, I was trying to get a simple webapp going last night and I want to separate the HTML code from the webapp code, so I wanted to use the template module. I was working on the guestbook example and I wanted to add a sign out URL. So the previous code looked something like this:


So how do you add a template variable for my sign out URL? The template data goes into Execute() in the 2nd parameter, so I can't just add a 3rd parameter. The 2nd parameter is already a neatly-packaged array from the datastore, so I can't affect that. So then I figure I need to create another data structure to include both the array and my URL string. This is when I stumble against the syntax as well as trying to find examples out there. I end up trying something like this:



That results in this error message:
line 19: name not exported: theGreetings in type *hello.RootTemplateParams
All of these problems were fixed by changing the field names in the struct to capitalized (along with getting some more sleep ;)). (I saw this note in the template documentationIf Field is a struct field or method name, it must be an exported (capitalized) name.) I'm not a fan of when a language dictates your coding style. I'm also not a fan of camelCase, but I also wasn't a fan of 2-space indention for Drupal coding styles, either, and I've gotten over that.

So anyway, all this to say that I'm finding Go difficult to pick up, much like any new language, I suppose. I already have an idea of a site I'd like to do, but these difficulties make me think I'm putting the cart before the horse, so to speak.

On a positive note, I do like the datastore and how easy it is to store & retrieve data from data structures. Really changes the concept of relational database systems.