May 08

JavaScript Ruminations

I have used JavaScript of and on for many years but in the last three years I have used it seri­ous­ly for build­ing a large client-​side web appli­ca­tion. During that time I have push many of the bound­aries of JavaScript and uncov­ered some fun­da­men­tal issues with the language.

One of the most com­mon com­plaints about JavaScript is that its object sys­tem is bro­ken. This is almost always becuase of a mis­un­der­stand­ing of what the lan­guage is. JavaScript is not an object-​oriented lan­guage, it is a pro­to­type lan­guage. What does this mean? It means that I can change the “object hier­ar­chy” of an exist­ing object at run­time by chang­ing the objec­t’s pro­to­type. This is by design and isn’t one of the real problems–it just requires a dif­fer­ent way of thinking.

Continue read­ing

May 07

New Job

I guess that I’m now start­ing up this blog again I should state that I have a new job since the last time.

Because of the volatil­i­ty of the tech indus­try my pri­or com­pa­ny, RockYou let go about half of their staff and being one of the last ones hired I end­ed up being one of the ones laid off. I end­ed up with my new com­pa­ny VMware short­ly after. I’ve been here for a lit­tle over three years work­ing in the Cloud Automation Engineering group.

The spe­cif­ic group that I work for works on a prod­uct that basi­cal­ly installs appli­ca­tions into a cloud. Seems sim­ple but when you con­sid­er that most cloud appli­ca­tions are run­ning mul­ti­ple parts in mul­ti­ple vir­tu­al machines and that each one needs to be con­nect­ed to the oth­ers, instal­la­tion quick­ly gets com­pli­cat­ed. It may require installing one part up to a cer­tain point to get its con­nec­tion infor­ma­tion, paus­ing it, installing anoth­er part giv­ing it the con­nec­tion infor­ma­tion of the fist part, and then resum­ing the first part again with more infor­ma­tion. Multiply that sce­nario by 10 dif­fer­ent parts and things get tricky fast. But if it were easy then I would­n’t have a job. 😉

The prod­uct is vCloud Automation Center or vCAC.

May 05

Back Again

A while back my blog died. I had no idea what went wrong and I had no wish to spend what would most like­ly be days of time fig­ur­ing it out. Instead, I just let it lan­guish. Over the years I tried half-​heartedly to fix it but to no avail.

Things in my life have changed and I thought that I would at least try to extract the old posts and maybe move to anoth­er sys­tem. So I start­ed the long process of get­ting into the data­base that holds the blog and after reset­ting sev­er­al pass­words and installing a new SSL cer­tifi­cate man­aged to get into the data­base. I found the right table and man­aged to extract the post data into an XML file. Now that I had the old posts I could start to cre­ate a new blog.

However, while I was there I fig­ured I would try one more time to fix the exist­ing one. I start­ed by try­ing to update WordPress but that failed because of a pass­word prob­lem. I fig­ured out how to get past that one and was able to upgrade to ver­sion 3.9 and then sud­den­ly every­thing start­ed work­ing again. I still have no idea what went wrong or what upgrad­ing did to fix it but at least I don’t have to start over.

Everything appears to be back the way it was and I was even able to acti­vate some of the new­er fea­tures that WordPress has added. The look-​and-​feel of the pages may change over the next cou­ple of weeks as I adjust those new fea­tures and even play with a new theme (the one I’m using was called Classic sev­er­al years ago).

At this point I do not real­ly no where I’m going to go with this blog and I may give it up again–we’ll just have to see.

Jul 08

PHP Reflections

In my (rel­a­tive­ly) new job we use PHP for the back­end. This is the first time that I’ve used PHP for doing any real work and now that I’m using it for real I have found it to be an inter­est­ing lan­guage. I am still on the fence about whether I actu­al­ly like it or not but is does have some nice fea­tures. Given that I’ve only been using is seri­ous­ly for 3 months now I can’t claim to be an expert and I know that I’m just scratch­ing the sur­face at this point.

One of its best fea­tures is that dynam­i­cal­ly com­piled which real­ly short­ens the edit-​compile-​test cycle. I like being able to make small changes and see the (near­ly) imme­di­ate result with­out hav­ing to go through a build phase. It’s also nice that there is a large library of func­tion­al­i­ty avail­able as well as a large com­mu­ni­ty of third-​party solu­tions. I’m just now start­ing to look at some of the frame­works built on PHP and many look real­ly good. I do real­ly like the asso­cia­tive arrays, espe­cial­ly the abil­i­ty to eas­i­ly nest them, how­ev­er, I don’t like the way that PHP merges them with indexed arrays. I know that oth­er lan­guages do this as well, but I don’t like it.

I think my biggest prob­lem with PHP is just how easy it is to com­bine the out­put (view) with the log­ic (con­troller) and even mix in some data (mod­el) into one file. This is the same prob­lem that JSP had. This basi­cal­ly neces­si­tates a frame­work of some kind in any large project. The syn­tax is also prob­lem­at­ic for me. I find it messy and full of unnec­es­sary items like dol­lar signs ($) which I believe come from the Perl past. Perl had a rea­son for using a dol­lar sign for vari­ables: it indi­cates a “sim­ple” val­ue that is not an array (@) nor a hash (%). Given that PHP merges all of these into one pre­fix ($) it would be nice to get rid of it entirely.

Basically I think that PHP does a bet­ter job of fill­ing the “dynam­ic, script­ing lan­guage for gen­er­at­ing web pages” than JSP does, but I feel that it could be cleaned up a bit and a lit­tle more struc­ture added to make it eas­i­er to work with.

Jun 14

Time Waits for no One

Joda Time is a library that improves the func­tion­al­i­ty and usabil­i­ty of dates and times in the Java envi­ron­ment. The built-​in Java class­es are hard to use, miss­ing com­mon func­tion­al­i­ty, and do the wrong thing in many cas­es. Thus was born Joda Time. It has been so suc­cess­ful that it was made the basis of JSR-​310, a pro­pos­al for adding the Joda Time func­tion­al­i­ty to the base Java libraries. This post is not about Joda Time. At least not directly.

In November of last year (2009) I joined with Jon Skeet and oth­ers in start­ing the Noda Time Open Source project. The goal of this project is to port the Joda Time library from Java to .NET. The built-​in class­es in the .NET run­time are woe­ful­ly incom­plete, inad­e­quate, and inel­e­gant. The orig­i­nal plan was to do a straight port with as lit­tle changed as pos­si­ble to make it work with .NET but as time went on (about 2 days) we real­ized that the Joda Time way was just too Java-​centric and would look too out-​of-​place in a .NET sys­tem. So after much wail­ing and gnash­ing of teeth we decid­ed to diverge.

As my first set of posts in this blog’s reboot I thought it would be fun to cov­er this process and along the way maybe talk a lit­tle about the issues that came up—both in inter­fac­ing with .NET and with time itself.