Monthly Archive for June, 2006

CFEclipse 1.3 Beta

So I went to download the CFEclipse 1.3 beta today, and much to my chagrin, it requires Eclipse 3.2, which isn't even an official Eclipse release yet.  I really wanted the dynamic autocompletion stuff, but having to rebuilt my entire Eclipse installation is hardly worth it.  Maybe once it goes gold, but not for a beta.  I believe that also makes CFEclipse 1.3 incompatible with Flex2, so if you want to run both, you have to use separate Eclipse installs (which means duplicating all your projects, all your configuration and settings, and being unable to easily work on CF/Flex projects).

I'm a huge fan of CFEclipse, but this this seems like a really silly decision that's going to strand a lot of people on version 1.2 for quite a while.

Mike's 6:45am Phone Call

If your name is Mike, you called me at 6:45 am Pacific time and said something about queries of queries and then gave me your phone number, please call me back.  In my sleepy stupor failed to write down the number correctly, and calling it just says "the call cannot be completed as dialed".

All Hail Java 5

If you do any Java development and are stuck with Java 1.4, my condolences.  Java 5 is so amazingly better, and in relatively inconspicious ways.  For those of you not in the know, here's a highlight:

  • Generics: I've been waiting for these in Java since my undergraduate days down at the University of Arizona.  Roughly analogous to templates in C++, they let you define classes and methods as operating on a dynamic type.  For example, the Collections framework used to operate entirely on java.lang.Objects, but now you can create dynamic collections for any type, and avoid the casting hell that plagued pre 5.0 Java code.
  • Autoboxing: Java, like many other OO languages differentiates objects from primatives.  With 5.0, the line got very blurry, because the compiler/VM will take care of converting primitives to and from their corresponding object types.  Very handy if, for example, you need a java.util.Set of ints, and don't want to have to fill your otherwise clean code with a bunch superfluous java.lang.Integer objects.  Much nicer to let the compiler/VM handle the legwork.
  • Annotations: Also called metadata, they're a language construct that allows embedding non-code information directly in your source.  Think Javadocs, but on steriods.  JUnit uses annotations extensively in the latest version, as does Hibernate (a la EJB 3), Spring, and a whole host of other Java frameworks.  Storing metadata directly in your source had it's downsides (harder for non-technical people to edit), but the benefits are huge because that data is available at all points from development, through testing, and at runtime to help tools make your job easier.
  • Real enumerations: Until Java 5, if you wanted enumerated constants (thing suits of a deck of cards), you had to manually declare constants for each one that were totally independant.  With Java 5 you can declare an enum (which is a type just like a class or interface), that encapsulates your constants in a single cohesive package with automatic value differentiation (i.e. no chance of accidentally assigning the same value to multiple constants), an actual type (rather than piggybacking on int or String), and perhaps most interestingly of all, behaviour.  There are also some high-performance collections available just for enums that leverage implementation details in the VM, but shield the details from the developer.
  • New for loop: Java 5 now has a "for in" loop like many other languages possess.  In Java, it only works with java.lang.Iterable instances, which all the collections are, and you can create your custom classes as.  The "for in" syntax is nothing special, but it hides the iterator, and best of all, since java.lang.Iterable is generic, you get to skip iteration details AND casting.

There are a couple other features (importing static members and variable argument lists), but those are of generally less interest.  One thing that I found interesting was the massive focus on more readable and maintainable source code at the expense of both compile-time and runtime performance.  One more (substantial) argument that readable code is better than fast code, though having both is obviously ideal.

The one thing they missed that I really would have liked to see is implict accessor methods.  Actionscript 3 and C# both have these (as ECMAScript-y langauges).  The reduction of boilerplate code is huge, because you can just throw all your properties public and only encapsulate the ones that need it.  Most importantly, you get to make that encapsulation decision at any time without affecting your object's interface.  Hopefully in whatever the heck the next version of Java is (Java2 5.0 5.1 or something).

So if you're still doing Java 1.4 (or older) development, it's definitely worth your time to upgrade ASAP.

An Apple a Day…

Round N in the Barney vs. Apple battle played out this evening.  Far less significant than my unending PowerBook issues (grey screens, refusal to accept RAM, etc.), but annoying none the less.

I "won" an iPod shuffle down at the Wild Kingdom exhibit the Rose Festival last week, and installed iTunes on my PC (which is my at-home jukebox) so I could sync it up.  I've been a die-hard Winamp fan since last century, but this was one spot where it simply wasn't going to cut it.  An iPod is pretty useless if you can't move music onto it.

So to install the iPod software, you have to supply the serial number of the iPod.  Logical enough.  When you plug the iPod in, iTuns asks you to register it, and the first think it asks for is, guess what, the serial number.  I mean, c'mon.

Then there's ye olde iTunes itself.  You can reorder columns in the display (like any other program), but you can't move the 'name' column anywhere except leftmost.  WTF?

And there's focus.  Keep in mind that I'm running iTunes on a PC, where a click to a non-focused application both focuses the application, and passes the click to the application to process.  OSX, on the other hand only does one or the other, with focusing being higher priority.  iTunes, however, goes with the OSX paradigm, even though it's a native Windows application, which means Apple's engineers went out of their way to ensure iTunes behaves in an unexpected way to all PC users - "the UI is everything" indeed.

They also had the good grace to implement their own custom maximization behaviour that prevents a maximized window, when minimized and restored to the system tray, from being able to be restored with the buttons.  Basic functionality that the Windows environment provides for free, reimplemented to work inconsistently.

And don't even get me started on the stark removal of all adherence to system UI preferences, forcing users to learn a whole new set of visual cues in order to effectively use the software.