Computers, Open-source, Personal, Ruby, Software, Thoughts, Web

Another Helping of Abstraction, Please

Rails 3.1 is soon to be released, and with it comes two new abstraction libraries – CoffeeScript, and S(ass)CSS. These libraries are used to generate Javascript code, and CSS definitions respectively. While abstraction libraries are nothing new to Rails, the inclusion of two more got me thinking about the direction that Rails stack is heading.

CoffeeScript’s syntax seems to be to make Javascript as Ruby-ish as possible. It describes Javascript’s curly braces and semicolons as embarrassing.

SCSS aims to address some of the repetitive elements of CSS through the use of variables, nesting, and mixins. This feels more acceptable to me than CoffeeScript, but my first encounter left me burned.

A few other abstraction libraries of relevance: Haml aims to generate HTML without the use of HTML tags. Additionally, Squeel‘s (MetaWhere 2.0) aim is to remove all SQL from your projects.

So what am I bitching about? Abstraction is a good thing right? I see two categories of abstraction. The first being the “good” kind, that allow you to be completely ignorant of the underpinnings. For example, Ruby converting down into machine code.

The “bad” kind of abstraction are the substitution of a language with a DSL. This creates a lot of issues starting with development and debugging. In the case of CoffeeScript and SASS, you have to compile the DSL files into Javascript, and CSS files. I feel like this compile step is a step back from what we gain working with dynamic languages like Ruby, and Javascript to begin with.

Development in these libraries also requires that you understand both the DSL of the library, as well as being familiar with the language of the generated code. This additional skill requirement adds time to a project, and raises the entry bar for new developers. Its difficult to be proficient at a language, and a DSL that generates that language at the same time. A Ruby developer told me yesterday that he was surprised at how rusty his knowledge of SQL had gotten. Its shocking to me that a web developer would struggle with SQL, but I think its an accurate sentiment on which many Rails developers would agree.

Another casualty of abstraction is performance. Not only is the generated code sub-optimized relative to coding it by hand, it is also being run through through more system calls to get there. You can either compile up front (CoffeeScript, SASS), or you can incur this penalty on-the-fly (Haml, Squeel).

While none of the libraries are a requirement of web development, when working on a team that uses these technologies you are expected to produce consistent code. Even though these libraries let you execute “native” code, doing so is discouraged because of the availability of the DSL. The syntax for embedding native code (if its even allowed) is often cumbersome, and loses editor functionality such as syntax highlighting and parsing.

Since when did Ruby on Rails web developers stop working with SQL, CSS, HTML, and Javascript? I am beginning to feel like the Ruby camp is becoming the far left extremists of the web development world. The web is built on these core technologies, and the benefits of abstracting them doesn’t seem to outweigh the costs.

Events, Family, Games, Personal, Thoughts, Vacations

Who’s Gonna Work for the Working Man?

What an exciting last few weeks. I am falling into a routine that means a lot fewer depressing couch and beer marathon weekends.

I sold my old POS Chrysler Sebring convertible (aka Big Red). After owning both an American car, and a Japanese car its pretty clear to me why we lost that race. Its also clear to me why the Chrysler company is just treading water. They are going to have to start subletting the Chrysler building at this rate. In my experiences, there is just very little quality in their products. Next we are selling the wifes truck, and getting a nice compact SUV. We have already been sneaking peaks at the Mazda CX9, and the Toyota RAV4 and 4Runner, and surprisingly the Scion. What a beautiful bastard that car is.

On a related note, we are ditching State Farm. I think their new slogan should be “Like a good neighbor, State Farm is there…to collect your premiums”. Then its back into the darkness. Insurance is getting out out of control. My accident has been resolved, and the strongest statement I can make is to drop them.

Kristin has gotten me hooked on the Harry Potter series – which has become my reading of choice on the Red Line. Like many other things including Legos and video games, I don’t feel like I should be enjoying these books as much as I do as an adult. I am almost finished with the “Goblet of Fire“, and it definitely has taken a darker turn. Kristin says that the book series was meant to mature with the kids that were reading them. True or not, its an entertaining read for anyone sitting on the fence about it. No one has even beaten me up, or given me an atomic wedgie for reading it on the train!

When I am not reading, I am putting some time in on the PS3. I just beat Drakes Uncharted (the first one), and it was excellent. I enjoyed it as much as Uncharted 2. I popped in God of War 2 next, and I was immediately sucked in by the epicness of it all. Once I finish this, then I can see what the world is talking about with God of War 3. Final Fantasy XI?? is on its way. Some Uncharted 2 co-op with Mr. Templeman to be announced, and some Alien Breed with my brother should satisfy my gaming needs. One of my co-workers has given me a tough decision of whether to buy a PSP for $50. There are some really cool games on it, and it would be a nice train companion. The question is do I really need to play more games?

Fall semester resumes with my enrollment in four more classes at Clayton State. The graduation countdown should begin next semester. I was on track to graduate in the Fall until the move to Boston happened. That’s life I guess. You can either give up, or you can get back up. Economics with LaBreque should be awesome. Our textbook is “Freakonomics“. He really does have a lot to contribute to teaching. Why can’t he teach all our courses? It sure would have made Biology more fun.

Speaking of Clayton State, I will be joining some folks from the ol’ HUB in Las Vegas to celebrate with them what is sure to be an awesome bachelor party. You only live once, but my budget for the trip is $1000. Let’s see how much fun I can have with that. Also from Clayton State’s world-renowned help desk, Brian Hursey is coming up to Boston for some job training. He will be one of the few to see our new house in Braintree. Knowing his photography skills, perhaps he can share with folks some of the beautiful sites from our new home. Look forward to seeing you Brian!

Work continues to improve. I have been allocated to another project on a different contract. This means a big change in the work. I am working with different people, and I get a wider range of things to contribute to. I get to put my CSS hat back on for a while, and do some design work. Its a fun challenge to take a composition and turn it into a mirror image in HTML/CSS – its an art to do it in Internet Explorer (die, die die!). This new project is also a lot less mature than the project I was working on. It is nice to see the projects evolve from the lessons learned on the older codebases. I  strong-armed some of my co-workers to take a nice lunch this Friday instead of inhaling our food over our nasty keyboards in silence. We went to Pizza Dough’s in Harvard Square. Its always fun to go up there and hipster-watch.

Kristin and I went to the Gillette stadium last night and watch Bon Jovi through the bars of the venue gates. The view wasn’t bad considering we didn’t pay anything for it. I revisited my arch nemesis “Red Robin” and got the burger burned to hell this time. It was decent, but not as good as I remember. Its hard to ignore the fries, and skip the beers because of the diet. I have lost a few pounds, but nothing major yet. I seem to be hovering at 186, despite religiously sticking to my 1600 calories / day diet plan. I suppose I need to just work out harder and keep that cardio up to burn the love handles I am holding onto. I have also “tweaked” my left shoulder and am unable to look over my left shoulder without some pain. I guess I am getting old.

Finally, I am looking for a new DNS name for my blog. Ideas welcome.

Apple, Computers, Linux, Open-source, Software, Thoughts, Web, Windows

The Rich-Internet-Application Bubble

It doesn’t seem to be a question of if, but when we will see the Rich-Internet Application (RIA) bubble burst. Adobe’s Flex platform, and Microsoft’s Silverlight platform promise the world, but their implementation seems to be flawed. The entire discussion seems to always remind me of the story of Java. Consider the following advantages and disadvantages of an RIA system over traditional HTML / Javascript / CSS:

Advantages:

  • RIA platforms promise “rapid application development” (so cliche in the development world). A developer can create a visually rich and interactive application inside the comfort and power of an IDE.
  • RIA platforms can consume data at a level that is not currently possible with current existing web technologies. SOAP, XML and other services can be consumed in a stateless web application.
  • Web applications are treated like traditional applications, offering added benefits like running offline

Disadvantages:

  • RIA platforms are specific to an IDE – in short controlled. Adobe’s Flex promises to be open source, but only on the client end. The “black box” will probably remain just that.
  • If open-source specifications are achieved (unlikely with Microsoft Silverlight) It will take years for alternate IDEs, and editors to support its functionality on a level comparible to what is currently offered
  • RIA platforms add another layer of complexity to an increasingly growing software stack with the need for web services to interact with database sources as the RIAs ironically are not able to.
  • HTML, Javascript and CSS are all free, standardized, open-source, cross platform, and ubiquitous. Microsoft’s Silverlight and Adobe’s Flex are both controlled and shaped by a single company.
  • RIA platforms require a browser plugin, since the technologies generate data that is not directly consumed by any current browser.

Hopefully we remember the failed promises of Sun’s Java VM. The marketing term “write once, deploy everywhere” has become something of an inside joke in the technology industry, as this is hardly ever the case. It should be more appropriately named “write once, deploy anywhere that supports platform ‘x’. This is made worse by the fact that as closed-spec platforms, the RIA browser plugin development is left to the companies pushing the platform. How well do you think Microsoft will support a Silverlight client on Linux, or iPhone?

Performance in RIA platforms has also historically been a sore subject. Java code runs by creating a host-specific virtual machine that abstracts all of an operating system’s details. This works against performance, as the virtual machine will always be the limiting factor – there is simply too much overhead involved.

What each of these companies are pitching to developers is the idea that HTML, Javascript, and CSS are old, and cumbersome to work with. Further, browser inconsistencies make truly agnostic client-side scripting, or styling very limited in implementation. Solutions like Prototype.js, or the CSS browser reset are needed to write agnostic code.

I just don’t buy into it.

First, HTML, Javascript, and CSS are made cumbersome by the fact that no browser (except possibly Safari) adhere to the standards agreed upon by the W3C consortium. Microsoft in particular is selling a tool to abstract browser development, while their browser consistently remains one of the least compliant available.

Second, I think that the success (undeniable when looking at their ubiquity) of HTML, Javascript, and CSS are due to the fact they are free, accessible, open-source, and standardized. Anyone who wants to be a web developer can start right now without ever spending a penny. Developers wishing to use RIA platforms must purchase a developer license to use the IDEs to generate the code.

I hope that the developers of the Internet don’t fall prey to the seduction of RIA offerings. RIA is simply a product being pushed soley on the basis of profit – not with the promise to make the web a better place tomorrow. Instead, I encourage everyone to ride out this wave, and let the technology’s bubble burst.