Thursday, April 29, 2010

I think Apple's acquisition Siri has potential - in more ways than one

Siri is all over the Apple news sites today.

I heard that apple purchased this company, Siri, but didn't have a clue as to what it did until I watched this video.  Its a keynote from the Semantic Technology Conference.  It begins with Apple's own vision (from 20 years ago!) of a virtual personal assistant called the "Knowledge Navigator" (video here).  It goes on to describe the challenges of creating a "Virtual Personal Assistant", such as semantical searching, reasoning, speech recognition, NLP, etc. - and presents a method to reel in the problem domain by first filtering on the current context to narrow the domain.  The slides from the keynote are also available.  It seems a practical approach and I look forward to trying it out (I just downloaded it from the App Store).

And I could see where this would fit with Apple's strategy: the iTunes Store, App Store, etc. all provide content and services, like Siri's servers do - and like all of these services, Siri would collect information that's valuable to Apple (and advertisers using its new iAd service).  Siri uses services to make recommendations, and allow commerce based on those recommendations, and it seems reasonable that paid recommendations (ala Google) would make their way into Siri.  And Siri (optionally) has access to your credit cards making it all too easy to engage in a bit of impulse buying.

Interesting.

Defining the order in which fields are generated on GRAILS Edit and Create forms

In the past I've spent a lot of time re-ording the fields on the Edit and Create views (forms) after GRAILS scaffolds them.  Then I started to notice that if I defined constraints within the model, the ordering was affected.  This lead me to start creating constraints for everything - whether they needed them or not.  So  yesterday I happened to be reading the documentation when I came across confirmation of this behavior, and an explanation that the constraint didn't actually have to do anything (which should have been obvious).  So in the following example, the last three constraints exist only for the purpose of defining their order (example from grails.org):

def constraints = {
firstName(size:0..30)
lastName(size:0..30)
title()
email()
releaseDate()
}


By including this the scaffolding will produce the order specified.  I don't have to muck with the view code, and I can regenerate the views without having to change them over and over.

This may be old news to many - but I never saw it in any of the tutorials.

Friday, April 23, 2010

7 Reasons to Hate Your Code

I found this post to be a good, alternate way to look at the code we write.
However (as is stated in the author's update) it is not meant to imply that shoddy code should be written if it yields more features and faster releases.  In some systems (where the life expectancy is short) this might be acceptable.  But for long-lived systems (such as large enterprise applications), which have to be maintained for a significant period of time, the cost of maintaining code shoddy code, that is difficult to debug and extend, can be staggering.  This can easily outweigh any advantages gained in terms of features and "time to market".  So I don't believe there is a "one size fits all" approach.

Also, with today's tooling (IDEs with formatting, refactoring, etc.), is takes little or no effort to create well formatted, readable code that enhances maintainability.  You don't have to gild the lilly, but there is no excuse for slapdash work either.

So in my opinion, professional developers should be able to produce code with good craftsmanship in an efficient and cost effective manner.  This is true in most trades where the quality of workmanship is always balances against cost and schedule.

Thursday, April 22, 2010

Torn about Adobe's Flash cross-compiler for iPhone/iPad

I have mixed feelings about the Adobe "Packager" that would allow ActionScript applications to run on the iPhone OS.  As a developer who has worked on Flex and Flash applications, and who knows (and likes) ActionScript I can see the value in being able to leverage those skills to create iPhone OS applications.  But more importantly, it would be a great boot for our clients to be able to target the iPhone/iPad devices with the same code that is used on their existing Web applications.  Of course, that could be said of HTML 5 as well, but we haven't been writing HTML 5 apps for over half a decade - and the expense of converting the existing Flash apps to HTML 5 is a real barrier.

Conversely, I totally understand Apple's point of view: the Flash packager would create inferior applications that would also not be exclusive to the AppStore.  And customer satisfaction could suffer from users choosing applications (that might have a lower cost) that end up being unintuitive and/or have poor performance (although I'm not sure the latter is substantiated).  So, perhaps if these apps were allowed an attribute in the AppStore could indicate if the app was native or ported (much like how the Mac System Profiler tells if applications are Intel, Universal, or PowerPC).  While this would have the effect of making Flash derived apps second class citizens, it wouldn't shut developers out completely, and the market could then decide their worth.

So the bottom line for me is that while I wouldn't condone  allowing Flash apps to masquerade as native apps to the detriment of end users - and I wouldn't personally be interested in creating new iPhone/iPad applications with Flash - I can see the value in leveraging prior work (and skills) until HTML5 gels and solutions are produced for it. 


Wednesday, April 21, 2010

Introduction: My history with Macs (or how OS X hooked me)

Macs are hot right now. The hardware is well designed, sexy, and highly coveted. But while many new users are drawn to Macs because of image or status, I think they ultimately buy - and stay - with the platform because of a superior balance of functionality and ease of use. My story may be a bit different: it’s the new Mac operating system, OS X, that hooked me.


My history with the Mac and Mac OS X
Least anyone think me a Mac zealot, I am actually a relatively recent convert to the platform. I’ve been a Windows user from pretty much the beginning of Windows (and a DOS and even CP/M user before that) - so I have a lot of history with PCs. And I have experience with Linux, OS/2, BeOS and even the Commodore 64 BASIC OS.

My first exposure to Macs was not a positive one. Decades ago I helped a graphic artist friend buy his first Mac. He brought me along to the store because I was “a computer guy”. When I was test driving the machine at the store I found it hard to adjust to (coming from DOS/Windows). Back then there were no multi-button mouses, and the classic Mac OS worked much more differently from Windows than the current Mac OS does today - both because of changes in the Mac (like multi-button mouse support), but also changes in Windows that “borrowed” a lot from the Mac interface and experience. This old Mac experience - an experience like I had with the old Mac OS - is what most people (myself included until recently) think of when they hear about Macs. The think of all the differences that existed in the UI, file incompatibilities, etc. These no longer exist - but most people don’t know that. Interestingly, many Mac “old timers” still long for the classic OS and the different way it worked. Not me.

The classic OS always seemed strange to me. Not so much the UI, but basic things like the cryptic finder (the Mac equivalent of the Windows File Explorer) and the “extras” folder (a folder where drivers and system level things were put in order to be loaded at runtime), lack of preemptive multitasking - so that it often just didn’t feel, well, predictable. But even worse was the fact that I was a Windows (and before that DOS) programmer, and things at the system level (the architecture) were just too different on the Mac (both because of different, RISC-based hardware and the way the operating system was designed).

But in the early ‘90s I stumbled across NeXT computers, and dove into their architecture a bit because of the rave reviews it was getting from Object Oriented developers at the time. Its architecture and the developer resources were cutting edge. But the boxes were too expensive for most independent developers to buy, so they were relegated to niche industries were they did quite well for a period. So I watched NeXT with interest during that period, and when they decided to port the NeXT operating system to the PC platform, as a product named NeXTSTEP, I bought a copy in the hope of exploring this wonderful object-oriented, developer-friendly OS. But, as is the case with any OS running on PC hardware, the variety of motherboards and peripherals in different PCs (with their associated drivers, etc.) meant that only a few hardware combinations worked - a problem everything from Linux to Vista has faced on PCs - and so I never got a working system up and running. But the desire for an OS like that persisted.

So, when the NeXT venture finally failed to be profitable, and Steve Jobs was brought back to Apple (along with the NeXT technology), I watched with interest as the company made OS X from the NeXT OS’s bones. When OS X was released I knew it was time for me to take a peek. So I found a under-utilized Mac, loaded OS X 10.1 on it, and gave it a good going over by using it as the primary computer for doing my job for a few months. And it worked so well that I got a Mac for my exclusive machine for work, and them for home, and then replaced my wife’s computer at home, and so on.

And I haven’t looked back since.