Apr 01

CoffeeScript, Whitespace, and Coffee

JavaScript, Tech 2 Comments »

I enjoy learning new languages. I am not on the yearly diet as the Pragmatic folks would desire, but when I can…. I enjoy expanding my mind as I have definitely experienced the fact that learning a new language makes me program differently in all of my other languages.

Clojure and Scala are interesting to me in the land of Java, but that isn’t where I have been spending time (until recently). I have been very much enjoying Jeremy Ashkenas’s CoffeeScript. What’s not to like? Jeremy has managed to create a language that cleans up many of the issues in JavaScript, and codifies much of the Good Parts into source form. Ruby is my favorite language, and this gets really close to my ideal mental model.

When talking to Brendan Eich about the language, he very much appreciates it, and also the fact that it maps nicely to the JavaScript model (versus something like GWT and Java mapping on top of JavaScript say).

In some ways it feels bizarre to write in a high level language which gets converted to another high level language. One thing that has been enjoyable though is learning this language. The killer features for me are:

  • Jeremy takes care of things like documentation. The main site is the best introduction and documentation for any language.
  • Source code as byte code. I don’t enjoy reading byte code. I do enjoy reading JavaScript code (a language I know well) though. It is fantastic to be able to play with a new language and instantly be able to see the JavaScript output, whether it be small things via the inline site, or via -w / cake watch.

Try CoffeeScript

One feature that I am not a huge fan of is the pythonic importance on significant whitespace. Notice the image above, and how the ordering of elements made a difference to the output.

It is very cool that Firefox is going to “natively” support loading up CoffeeScript, and I think that someone needs to create Coffee and do to Java what CoffeeScript has done to JavaScript.

You could argue that this has already been done….. Groovy? Oh and thanks to the great work of Charles, Tom, Ola, and friends…. I can even use JRuby over there…..

Mar 17

Give me a REST, I just want to get my Message across

Tech 2 Comments »

messagesgami

2011. HTML5^H. JavaScript everywhere. Cross platform mobile. The “Post-Java malaise”. The user experience bar.

It is an exciting time to be developing software. We have multiple stacks that make building the server side easier, and we are on the precipice of pushing into real Ajax. Real modern clients. We are going beyond the world of sprinklin’ some JavaScript into an HTML page.

Progressive enhancement used to be the only viable option because most (by percentage) of the browsers hitting your site kinda sucked. Thus, it made sense to give them an experience of some sorts but enhance that experience for those that could deal with it.

Now, we even have a decent browser from the IE family. It feels like the days of IE5 :)

Since the tables have turned, we then get this crazy idea that we can build for the rich majority…. and regressively degrade for the poor buggers who aren’t able to up their browser due to crazy IT departments or illegal Windows versions. Lord of the shims and polyfills. We have been doing some fun work to make this work in an automated fashion, but that is for another time.

When you start building applications on top of WebSockets (and degrading) you also start to think about different architectures. WebSockets gives us a rich, fast, bi-directional pipe between the client and server. Whether you are a Socket.IO lover with Node++, or an Enterprise sort on Kaazing, you can start to deal with a very simple messaging API (that degrades).

Suddenly, you are building with a rich client MVC framework (enjoying Backbone and the like) but instead of mapping back to REST (which Backbone makes easy) why not deal with publishing and subscribe to topics?

No more polling. Instant real-time. These messages can piggy back and even go straight to the land of MOMs (JMS, Stomp-iness, etc). Now on the server you have loosely coupled processes that consume messages and do their work. Scaling out with a loosely coupled messaging infrastructure is so much easier to deal with that RPC madness.

I am having some fun with this type of infrastructure, and I am curious indeed to see where it leads. You?

Mar 07

The balance of UI elegance; Learning from the Dickbar

Tech, UI / UX 2 Comments »

The iOS Twitterati came out in full force once once they had upgraded to the latest 3.3 version. The new version has a ton of great features, such as autocompletion of @usernames and hashtags, better photo uploading, and some UI cleanup. This has all been over shadowed by the addition of a “trending topics” bar that appears at the top of your view.

I am sure that some users love the feature (the quiet ones) but a vocal community quickly came about and:

  • a) complained
  • b) reverted to 3.2 or even to try other clients (e.g. Echofon)
  • c) built and installed software to “fix” the issue (e.g. Twizzler).

Those who are vocal wanted a way to turn this off. An option. Even if it is buried in the settings (a few taps into the app).

To this, Dick Costello (CEO) responded:

dickcquote

This is very interesting, and where we can learn. I have found that one key art in software development is when and how to abstract your code. I have seen developers go down a common path:

  • Phase 1) Minimal abstractions. Spaghetti code ensues. Everything is coupled to everything else
  • Phase 2) Crazy abstractions. Ravioli code ensures. Everything is wrapped as one method with an abstract class and an Interface (picking on Java here!)
  • Phase 3) The balance. Working hard to make the right balance, enabling readable and modular code without losing the ability to see how it all fits together.

ASIDE: I tend to enjoy the like of Ruby (and even JavaScript and CoffeeScript) as I always feel like every line of code is doing something.

There is a similar balance in the world of UX. You want to offer just enough knobs and switches to get people working in a beautiful way, but not too many (so they can’t work out how to do a darn thing [e.g. original desktop linux days]) or too few (so they feel like they can’t get anything done!).

I find it fascinating to watch this balance. As a power user, I find it interesting to know what I personally want to be able to tweak about a system. For example, going back to Twitter. I switched to Echofon from Tweetie back in the day. I loved much about it:

  • The way that you click on something and a gutter shows you more, but you don’t lose your context
  • It was an early consumer of the streaming API so data showed up sharply
  • It showed when people interacted with my tweets (other RT, favorites, etc).

One feature that people will scoff at as minor, is the fact that it has no way to display the real name of the tweet author, and instead I am stuck with a username. Now, I happen to have a bunch of folk who I follow who have fun handles. However, I don’t have the full mental map to remember that @monkeyape23 is my old mate Bob from England. I just want to see his name. Please. This silly little feature lead me away from Echofon believe it or not (please add it guys!).

I liken my Twitter client to my Email client. Some people love their stock Gmail/Mail.app/Outlook experience, but many very much like to tweak it. Some may want a three-pane view (I use “Multiple inboxes” on Gmail for this), some want to change the number of lines in the preview, and others trick the hell out of their system with scripts and extensions. You are in this software daily, and some folks like to sharpen their tools.

pinstripes

Now, I get that the official Twitter client is a “base level experience”, but that doesn’t mean it has to be simplistic and rigid. I also find it hilarious that, although there isn’t an option to hide the Trendbar, there IS an option to turn pinstripes on and off :)

You can easily go too far with “options” as Alex Faaborg (Firefox UX…. highly respected) mentions:

Screen shot 2011-03-07 at Mar 7 @ 12.48.24 AM

Now, I mentioned extensions above. This is another important thing to think about as a release valve for your users. Firefox took something that “had too many options” (Mozilla Suite) and stripped it to something much more bare bones, but XUL/XPCOM were still there (and even about:config was good in that extensions could target it). Developers could create fantastic additional experiences that users could enjoy. To me, this was one of the key items of Firefox that made it #winning in the old days. IE actually had add-ons too, but they were painful to write and the platform was nowhere near as approachable and available. We got amazing functionality such as Firebug and Greasemonkey.

Ah, Greasemonkey! The Web turns out to be a fantastic extension platform. When I load up twitter.com itself, a few Greasemonkey scripts kick in for me to customize the experience, and I get things how I want them. You can mine for great user scripts out there, and now that browser such as Safari and Chrome also not only offer extension support, but do so in a very HTML (and Greasemonkey) friendly way, you will find them packaged there too. Chrome and Safari had to create extension systems to compete. How many of you waited for that one extension to full switch from Firefox to Chrome?

In my ideal world, Twitter would not only add an option to get rid of the #dickbar, but would also offer an extension API that would enable folks to build extensions that flow from their awesome communication ESB in the cloud, all the way to the client platforms that access it.

Our users are human and have different needs. It is fine and dandy to want to “do a Steve Jobs” and create something that is so perfect that you can hand it down to the fellows, but how about a one-two punch. A fantastic default experience, with hooks to enable developers to offer up fantastic experiences to your end users.

I couldn’t move to Chrome without Adblock and ….

I can’t move to Sparrow until Rapportive is supported.

If you create a great plugin system, there will be no reason not to move on. #thewebrocksatthat #firstworldproblems

Jan 20

HTML5^H: What it means to developers, standardistas, and browser vendors

HTML, Open Web, Tech 7 Comments »

html5logo525

As soon as you read HTML is the new HTML5 from Hixie, you knew that it would be fertile ground for people to discuss, argue, tease, and ridicule various sides… especially with this coming from WHATWG days after the HTML5 logo was unleashed by the W3C.

On one side you have people looking at the notion of a standard being alive as bizarre. Isn’t the point of standards to be able to say that multiple implementations support something in the same way?

On the other side you have people that say that the notion of a versioned standard on the Web doesn’t make any sense. How many browser implemented CSS 2.1 to the letter of the law?

What do developers want to see? The ability to know what capabilities they have at hand.

How do they work together? How can they be polyfilled? How uniform are the implementations?

This is a massive pain point right now. What does it mean to write an HTML5 experience? Some parts of HTML/CSS/JS are very well baked. Others aren’t. Developers have to work a lot of this out, and the community has built sites like html5readiness and tools like Modernizr.

In practice, to do something truly cutting edge, you have to do a ton of testing on various browsers. You want to just use CSS3 hardware transforms, but you find out that there are drastically different implications on desktop browsers, and when you get to mobile browsers the game that much more. Then there is hardware acceleration of Canvas on some browser/platforms. This goes on and on and on.

Cutting edge alpha developers can maybe keep up with some of this stuff, but Joe the App Developer may not be able too, and nor should he.

Wouldn’t he rather use a platform like iOS that has a very clearly versioned SDK that he can develop to? Surely that is much less painful.

There are trade offs though. In iOS, you have to wait for a beta SDK to play and find bugs. You are much further down the process that the Web, where you can step up and be much more active. And Web developers need to step up to be much more active. We need to be talking to browser vendors about what we need in the Web platform for it to compete, and for us to be able to deliver the experiences that we envision. We have the ability to influence our platform, so let’s make that trade-off worthwhile and not just sit and see what a particular standards group or browser vendors shows us.

I very much want to give developers a great way to see what they realistically build against on the Web platform. However, although the world took up the “HTML5″ mantle as the next “Ajax”, the HTML5 isn’t the right standard for this to play out. It has never been natural, because the Web platform is much more than “HTML”.

In fact, isn’t it ironic that “HTML5″ has become “a platform to build amazing Web applications” when much of the HTML5 spec started out by adding new tags that deal with document structure and not applications at all! sections. authors. navigation. headers.

Hixie mentions the Web Applications 1.0 specification. Something like this is more appropriate as a specification that can say “these are the things that the Web platform will give us”. Allow the HTML group to iterate in a way that they see fit, but out of that chaos we need something that can give an ordered solution to developers. And, if we have the “living standard”, we need the “living tests” that we can be continuously running on browsers. The tests will arm us with knowledge on a) how to use the APIs in many use cases, and b) tell us when regressions kick in.

So, we need to give developers a set of capabilities in the Web platform that they can rely on. What about the marketing angle?

HTML5 was laughed at by many practitioners, but it has traction with execs. They see HTML5 as a way to deliver cross platform solutions, as a way to get new disruptive experiences out to their users. The term is useful in many ways. Authors can write books on HTML5, but how do they write them on “HTML”?

In short, maybe we need some changes:

  • We need a clear vision on where the Web platform is going, and how everyone can be involved.
  • We need some notion of documenting what the platform as a-whole can do (thus: we need versions). Just as an iOS developer can see what 4.3 beta, we should have something similar. This will be an umbrella of smaller specs and versions, but we need something.
  • We need rich tests that we can run against Web platform runtimes so we know what they have implemented from the platform standard
  • We need to acknowledge the needs of multiple parties that keep the Web moving

Whether or not the HTML spec in the WHATWG is called HTML5 doesn’t really mean that much in the big picture. We need to solve the bigger problems. I hope that we don’t spend our time arguing over the politics of this or that, but on where we should go from here.

Jan 20

JavaScript Harmony: The JS Train Is Moving

JavaScript, Tech 1 Comment »

harmony

Brendan Eich just spelled out the Harmony of his dreams. A state of the union from the language creator timed for when the ECMA TC39 group gathers to hopefully move the ball forward.

This post made me very happy indeed. Over the years I have gotten to the place where I actually really like JavaScript. There are other languages that I may prefer, but I am at peace with JavaScript and its frustrations.

Variable hoisting and this.foo all over? Crazy, but I am fine.

var self = this; or .bind(this)? Whatever.

Module system is tied to script tags? Worked around.

I was right there with ES4 back in the day, hoping to see a bunch of improvements finally getting in to more than Firefox’s type=”". Then the wheels on the bus came off. There were great additions / changes / clarifications, but the typing and namespaces/programing units/packages features? It went just too far.

JavaScript put its tail between its legs and we had to cheer for the small wins of bind() and create(). Fortunately there were huge wins at the VM level. Modern VMs are fantastic, and paved the way for server side JavaScript with Node…. after all of these years.

We need more. There is a responsibility to backwards compatibility that is always brought up. That is important, but there is also a responsibility to moving the Web stack forward. JavaScript has become the glue and power tool of the Web. In theory you can use that type=”" to do more, but getting all of the browsers to implement a language isn’t going to really happen, so we are stuck with JavaScript for good and ill, for the foreseeable future. Let’s make it great.

So, this is why I am so excited to see Brendan talking about how to do just that. There are some classic lines in his post:

You can do anything with function in JS, but you shouldn’t have to — it over-taxes JS programmers and VM implementors to learn and optimize all the idiomatic patterns. Too much like writing with only one-syllable words.

I agree with Doug that tail calls would be a win, especially with evented code. The # function syntax allows us to give tail calls a boost and save you seven (14 total: function + return_ – #) keystrokes.

Why not bind this to the same value as in the code enclosing the hash-func? Doing so will greatly reduce the need for var self=this or Function.prototype.bind, especially with the Array extras. It’s great that ES5 added bind as a standard method, but why should you have to call it all over the place? If Harmony does not address this issue, I will count that a failure.

A hot-button issue with ES5: Object.freeze. Whose side are you on, Batman’s or Mr. Freeze’s? Simplistic to say the least, since even in one’s own small-world codebase, making some things immutable protects against mistakes. Never mind single- and multi-threaded data sharing and other upside.

The simple modules proposal, along with its module loaders adjunct, is the likely Harmony module system solution. Note that there is no left-hand side example written in current JS below — you’d need a preprocessor, not part of the language.

Closing Remarks

This is a long post. If you made it this far and take away anything, I hope it is Guy’s “Growing a Language” meta-point. JS will be around for a very long time, and it has a chance to evolve until its users can replace TC39 as stewards of its growth. The promised land would be macros, for syntactic abstraction and extensibility. I am not holding my breath, but even without macros, the Harmony-of-my-dreams sketched here would be enough for me.

We aim to do more than dream. Narcissus is coming along nicely since it moved to github and got a shot in the arm from our excellent Mozilla Research interns last summer. We are prototyping Harmony in Narcissus (invoked via njs -H), so you can run it as an alternate <script> engine via the Zaphod Firefox add-on.

@andreasgal has a JS code generator for Narcissus in the works, which promises huge speedups compared to the old metacircular interpreter I wrote for fun in 2004. With good performance, we can actually do some usability studies of Harmony proposals, and avoid Harmony-of-our-nightmares: untested, hard-to-use committee designs.

A code-generating Narcissus has other advantages than performance. Migrating code into Harmony, what with the removal of the global object as top scope (never mind the other changes I’m proposing — here’s another one: let’s fix typeof), needs automated checking and even code rewriting. DoctorJS uses a static analysis built on top of Narcissus, which could be used to find flaws, not just migration changes. Self-hosted parsing, JS-to-JS code generation, and powerful static analysis come together to make a pretty handy Harmonizer tool. So we’re going to build that, too.

More on Narcissus and Zaphod as they develop. When the time is right, we will need users — lots of them. As always, your comments are welcome.

I am sure some programmers will feel like they just read Crock’s good parts and finally get JS…. and now it will change? I remember the days where my() seemed so foreign as I put on Perl5 (and it took me a bit to really grok my vs. local [and we have var vs. let now]). There are so many times where I dislike change, but then in time the changes become habit and I wonder how I lived on the other side.

It is time to re-tool.

I am finding that I really enjoy CoffeeScript. I find it fun to use. I am happy when using it. If core JavaScript can give me much of that, I will be very happy indeed.

I may disagree with some of the TC39 decisions, but I just hope that they make a big push to do bold things at this time. The time is now, and it is great to see signs of hope:

Good news everyone! typeof null == ‘null’ might actually happen.

Jan 19

Comparing the performance attributes of iOS browsers

Mobile, Tech, Web Browsing with tags: No Comments »

browserscope

I recently talked about the attack of the mobile browsers.

Then, Steve shared bookmarklets for mobile performance work.

He and Jesse hosted a fantastic Velocity Summit in the city today with the best and brightest in the realms of web ops and browser land combined. It was an honor learning from them, and it was just fantastic to see top notch folks from Chrome, Firefox, IE participating and sharing ideas.

With all of the performance talk, I started to play with Steve’s work, and was reminded how much of a pain it is to work with bookmarklets on iOS. There are some solutions, from Dropbox, to syncing bookmarks (from iTunes as well as Firefox Home), but in general it can be a pain.

Some of the new iOS browsers have extension support though… such as the 360 Browser. I wondered if it would be more efficient to great extensions (they call them plugins, but that confuses the world with Flash etc) that are quickly actionable from within the browser. Ideally, I could tell the browser to always run the extension so I could collect data throughout a session.

One concern though was the fact that most users on iOS are coming at you from Mobile Safari, and although these new browsers are using the iOS WebKit APIs (as Apple won’t let them do anything else) how different are the browsers themselves?

BrowserScope to the rescue. I fired up and ran all of the tests in each browser application and compared the results. They were incredibly consistent. All of the numbers were the same when run on: Mobile Safari, Sleipnir, 360 Browser, and Skyfire except for the “Cache Redirects” test in the Network section. In that case, two of the browsers passed the test and the other two didn’t. All in all that is pretty friggin’ consistent though. The network connections were all the same for example….. so this makes me feel like there is room for a nice developer oriented iOS browser. Sure, it can’t get access to a lot of the low level data, but there is much that can be done, especially if you pair it with a remote session ability so you can power the beast from a desktop rather than the dinky device itself!

Jan 13

Sometimes it is how you say it; Google and H.264

HTML, Tech, Web Browsing with tags: 1 Comment »

There has been a ton of fire on the Internet around the news from Google that it is dropping support for H.264 from the Chromium project. I think that this is a great example of how the way it was messaged could have really hurt Google.

A core issue that Google has is that now it is large, people read many things into its actions. In the case of video on the Web, who rules the roost at Google? There are many parties that have skin in the game in some way:

  • YouTube delivers a fair amount of video on the Web
  • Google Chrome (browser, OS, etc)
  • Android
  • Google TV
  • Google Voice
  • GChat
  • … and the list keeps going and going!

I love it when people editorialize only one of these heads. For example, this piece on how the whole thing is actually just about YouTube and their costs. YouTube is only one player.

The key problem is that Web video is friggin’ messy. The Web loves openness. Users love functionality. We are in a period of time where the two aren’t always aligned, which ends up with many people having to double encode and support multiple formats.

Also, both sides of the argument love to talk to extremes, but the lines can be a little grey.

For example:

  • Some people wrote about how Firefox is doing great in Europe which is a huge market, and thus everyone will be doing WebM. Erm, there are lots of other markets with millions of people where that isn’t supported.
  • Others say that WebM handled as part of a standards group, and thus “it isn’t an open standard! H.264 is!” WebM is licensed very liberally indeed, and is in a position to be very much an open standard. To put the nail in this coffin, it would have been fantastic for Google to have come out with a message that talks about plans for standardization and what they are thinking.
  • “Google should stop delivering Flash!” On one side people say, “Come on. Flash is ubiquitous enough that Chrome needs it to be a competitive browser. The battle here should be to move the Web fast enough and add capability which means that plugins aren’t as needed for certain situations.” If you care about DRM and other items in video, you may wish that you can use <video> but you can’t yet. The other side will say “Google is being disingenuous with their use of the ‘open’ word 8 times in their post.” Again, I do think that the communication could have been clearer from them, and they could have explained much more why they are doing this.

In general, that post comes from “Mike Jazayeri, Product Manager.” Who is that cat? Where are these thoughts really coming from? Is it from an On2 guy looking to fight the fight? from a policy person? from YouTube?

Sometimes it is how you say it, and I think Google could have done a much better job getting their partners briefed and unified proactively, and a better job in explaining what they are really doing. A group like Mozilla can make a much more respectable argument based on the grounds of openness and the long term. Asa is out there fighting the good fight right now in fact (commenting on this great post by Haavard@Opera):

In 6 months time, of the HTML5 capable browsers, Firefox, Opera, Chrome, IE9, Safari, more 2/3rds (by usage stats) will support WebM exclusively and less than 1/3rd will support H.264 exclusively.

H.264 is not winning when it comes to HTML5 video support. WebM is winning. Actually, it’s more than just winning; it’s kicking ass.

Now. Back to an incredibly messy world of video. It isn’t about the number of HTML5 capable browsers. There are a few phones that support H.264…. and although hardware support is coming soon for WebM, it aint here yet, and the majority of content isn’t encoded in WebM. This is all great news for companies such as Brightcove who get to leverage the pain that we all have in the (hopefully) transitional phase to an open world for Web video.

Updated Google saw the commotion and I am glad to see that they joined the conversation and gave more information in this clarification.

Dec 29

Attack of the Mobile Browsers

Mobile, Tech, Web Browsing 3 Comments »

It has been exciting to see the increase in mobile browsers available for various platforms. Some platforms have allowed this freedom (e.g. a “full” Firefox experience on Android). Others like iOS restrict applications to the realm of WebKit and the APIs available:

“2.17 Apps that browse the web must use the iOS WebKit framework and WebKit Javascript”

Even with that handicap, we have seen some very interesting experiments, each with their own take.

I have been playing with some of the new iPhone browser apps recently. What jumps out at me?

browser360

My favorite is probably the 360 Browser from Saloni Srivastava. It packs a lot of fun features into a small device sized package, even if the UI feels a little foreign sometimes:

  • The pie menu approach brought a smile (we experimented with a pie menu in Bespin). There are two modes: drag and tap. With the default drag mode you end up holding a digit down on the screen and moving around. In practice I found this approach wanting because I would either hide the menu that I was aiming for, or I would move off and the menu would disappear. I prefer the tap approach, but actually wish for a solution that mixed the two… specifically, in tap mode I want to be able to hold down on a menu item and have a tooltip tell me what I am dealing with…. important as you learn the system.
  • Firefox Sync support is fantastic. I wish that I could tie in syncing from other browsers too and unify things.
  • In the top left of the toolbar you can quickly tap to make the current tab private…… something that many users will enjoy ;)
  • Tab support in general is good, and you can quickly show and hide them
  • Which leads into full screen support
  • The plugin system allows you to bring in a lot more to the experience. It feels a bit clunky, going into the plugins area and tapping on the item even though it has an [x] on it etc, but it great to be able to extend your browsing.

browsersleipnir

Sleipnir Mobile innovates nicely with tabs and somewhat with tagging and bookmarking. Being able to setup various “workspaces” for your tabs is very useful. I find myself wanting to keep a copy of sites like TechMeme, Hacker News, and others, and being able to put them in one tab group is fantastic.

browserskyfire

Skyfire has both an iPhone and iPad version of their browser. Most talk about their support for Flash video, but they also have other interesting features such as their “quick views” which give you a taste of Twitter or Facebook without having to jump away from your current browsing stream. I am not the kind of chap who is looking for “related” exploration, but others probably are. It is also interesting to see how browsers get around limitations of the app-centric model. For example, Skyfire is aware of the clipboard and sucks in URLs, since you can’t send a URL to open that browser, or have a system-wide setting for “default browser”. We have similar issues with bookmarks. I want one central store that they can all use (others would like separation).

In general, features such as private browsing, better tab management, and also caching itself can be huge. It drives me bonkers to hit the back button and have to wait for a page to be reloaded when I just came from there. I would happily give up a lot more hard drive space on my device to the browser. The feel of the browser is important too. If the scrolling is off, or the gestures? Ugh. I had that experience with Opera when it first came out. By default pages were zoomed so far out that it was unreadable and the pinch/zoom felt wrong.

I really hope that the exploration that is happening in the mobile browser space (and the money that some folks are making off of it!) keeps going, and that Apple opens up their terms to allow for a full Firefox experience and others.

What would you like to see on a mobile browser?

Dec 15

Chrome Frame for iPhone; Taking your HTML5 renderer with you

Mobile, Open Source, Open Web, Tech, Web Browsing 2 Comments »

I love the Web, but a couple of things have gotten me thinking.

#1: Netflix on PlayStation 3 via HTML5

I got to meet some of the awesome engineers behind the HTML5-fication of Netflix experiences, specifically folks in the TV group. They showed us various UI experiments and it was beautiful to see. The UI is slick and modern, and every effect is using CSS transition goodness, nicely hardware accelerated thanks to the PS3’s GPU.

At first it may seem a bit crazy that the team took Qt/WebKit with them as the rendering platform, but when you think about the huge number of devices that Netflix needs to support, it makes “wanting an iPhone and Android app” seem like laughable fragmentation.

#2: Trusting the implementations to catch up?

We have amazing browsers in modern devices. But as we push the Web forward, we are still facing buggy implementations and varying support. Although WebKit lives within Mobile Safari, that doesn’t mean that Mobile Safari has open sourced everything to WebKit. The touch support isn’t there. We can’t all use the same scrolling effects and the like. That has to be built up by everyone.

Ideally, with position:fixed (now in Android), you could use that and even flexbox to use the core scrolling of the browser itself so you don’t have to resort in the mimicry that frameworks have had to do until now.

Even the magical escape chute to the GPU via CSS3D isn’t a silver bullet.

matthew farag

Matthew Farag has a lovely portfolio site that uses the power of this modern goodness (using Scripty2 for auto hardware acceleration!). Works great on a desktop WebKit, but how about the iPad? It does pretty well, but you start to see some of the buggy issues where the GPU seems to run out of memory and you get weird artifacts.

So, when you put these two together, you realize that it could be nice to carry a great consistent Web runtime with you to allow you to get great experiences, especially while we are transitioning and getting everything flushed out. It would also enable us not to be beholden to the likes of Android and Apple to make sure that their Web runtimes are fantastic.

I may want Chrome Frame for devices more than I care about it on the desktop as it turns out. Hmm. Alex? ;)

Dec 02

Native apps are always better than Web apps; Psst, the new way has an escape chute

HTML, JavaScript, Mobile, Open Web, Tech, UI / UX, iPhone 3 Comments »

When we talk about the mobile Web being a good candidate to be a unifying platform for mobile and beyond, we often get nay-sayers telling us that there is no chance of this happening.

Their claims often chanted include:

  • Cross platform never works (case in point: Swing)
  • You can’t create a great experience without going native (and Apple raised the bar on the experience!)

There is some validity to some of this, but I also wanted to discuss the other side too.

Cross Platform Did Work

Swing gets bashed because a) it didn’t take off, and b) people always saw Swing apps as ugly and great examples of the uncanny valley. That team worked tirelessly for many years to try to get the look and feels to be as exacting to their hosts as possible. A pixel off here and there…. and it felt wrong.

It turns out that this probably wasn’t the right approach, and either a) Use SWT to use the real OS components or b) create a great looking l&f that is different to any one host, but natural and fantastic to use. Ben, Jasper Potts, and others fought for such a look and feel in Nimbus but a lot of time had gone by.

We have all seen many platforms on top of hosts that don’t feel right and don’t look good. That doesn’t mean that cross platform can’t work. Flash is an example that is very much cross platform and that community very much went the “every app will have its own UI”…. probably TOO far in the other direction ;)

In fact, the Web itself is a fantastic cross platform success. We have argued that if it wasn’t for the massive Web revolution, would non-Microsoft vendors (read: Mac OS X) be in the situation there are now? Or would they have followed in the wake of Atari, Amiga and BeOS? When the Web happened, suddenly the interesting actions that people wanted to do on a computer were dominated by the global scale of the Web (Google, Amazon, Yahoo!, eBay, etc). The Microsoft Office lock-in was gone (aside: it also DID help a lot that Microsoft gave Apple money, got Office over there, and solutions like VMWare enabled those few Windows apps that you still wanted to come with you).

The Web was a great cross platform success, even though its rich capabilities in the areas of graphics were laughable…. as I mentioned in an earlier post:

Apple - old and new

When you look back at many of the earlier designs of the top website brands, they are comical by todays standards. However, at this same time, technology such as WPF was being touted on the desktop. Why would people visit Web sites when they could experience amazing native Windows and Macintosh experiences?

So, I don’t think you can discount the Web on the merits of “cross platform can’t win” as it already did win once, and at a time when the capability gap was much wider than we now have with HTML5.

Compare this native app to their Web site!

delta-casestudy1

I teased about the Delta mobile Web application before. If you compare their iPhone application to what you get if you go through a mobile browser, the difference is huge.

But, is the reason they are so different due to capability? I think not. I think the reason is much more about structure, legacy, politics, and history reasons.

I remember seeing an early viewing of an Adobe AIR eBay client. The thing was so rich, so much better than the awful eBay site in almost every way. It made you want to cry looking at the website afterwards. Why or why would eBay have this fantastic client and not spend time on the website where all their customers were! It wasn’t that they were baffoons, it was because they had no legacy in this new world!

The designers had free rein with a blank sheet of paper. They had core concepts and some design language, but total creative freedom. Compare that to the website. If they changed the color one hex value users would go nuts! Every time Facebook changes their site there is a massive campaign to change it back for the first 2 weeks.

They also didn’t have to run the gauntlet of the massive codebase that had been built over years to make any of these changes. And the QA. Ugh.

In fact, an entirely new team could be formed to do this work.

This is exactly what I am seeing in mobile. In many companies, if there is a mobile group, they are just that…. a very separate group. In a non-mobile-thinking company they are like the old “Mac” group in a Windows heavy shop that hangs in the corner and is very different.

Other companies are still getting into the world of mobile and realizing that usage patterns are going in that direction. They are bringing in consultants to help out. They are forming new crack teams to take on the challenge. They are realizing that they need to re-think the entire experience, and hopefully realizing that they need to create software as-a-whole in a very different manner.

The bar on the quality of experiences on some of the mobile platforms is very high indeed (and very low on others!) which has the (great) effect of pushing the bar forward.

Will this leave the Web versions behind? Maybe in the short term. Kinda like how the old Twitter website was simple compared to Tweetie and other clients, but #newtwitter is much richer and borrows some of the concepts where they make sense.

I am definitely seeing people swing back to their web experiences. As multiple platforms foster in touch and cross device, they are starting to feel the increasing tax of building totally different applications across the fragmentation, and then trying to keep them in sync once the 1.0 is complete. Outsourcing the 1.0 is one thing, but the syncing part is hard.

Back to Delta. You will notice that the screenshots on the web side get increasingly poor as you go deeper into the experience. Contrast that with the iPhone version above that is always at a high quality. It is time for them to go back to the web side and sync up.

In fact, just before a recent talk, we coded up some of the simple transitions and feel just so show how easy it is to get some of this stuff working via the mobile Web. You can see the simple example here.

In our Palm Developer Day keynote we shared some of the high level pieces on how to put this all together, the major piece being that you have to really re-think the way that you architect your applications (think: Gmail not server generated HTML, Backbone.js, and more).

Here are some of the slides:

delta-casestudy2

delta-casestudy3

delta-casestudy4

delta-casestudy5

aside: Dave Balmer goes into some depth in his Rockstar apps with HTML5 talks.

Of course, it isn’t all hunky dory. There are still edge cases on getting things performing just right using the Web on the various devices. You have to think “cross platform” again. It may have been nice to ignore that and hack on a native application for awhile. But, would you rather be porting between proprietary SDKs and languages all day long? Or re-use as much of your code as possible.

And, if for some valid reason you really DO need a bit of native for something, you can break out of jail and do just that. The escape chute is waiting for you.

We have a long way to go on giving developers better access to native capabilities and tools to make building the next generation of apps more of a breeze, but it is doable right now (another aside: webOS kinda proves that right now as the native apps ARE Web apps!)

I will finish with the interesting take from Venture Beat the other day on how
the iPhone app is the Flash homepage of 2010. They say:

In the late 1990s, it was common for companies to spend $50,000 to $150,000 for a Flash homepage that looked like a beautiful brochure. However, they soon learned that Flash was cumbersome, slow to load, expensive to build, and hard to update, and moved on to HTML. Now only specialized, high-end sites are Flash only.
The exact same thing has replayed itself on the iPhone. Companies have paid $50,000, $100,000, and more for an iPhone app. Now they have to keep the iPhone app in sync with their regular web site, and have to add additional native apps, each at a high price point, due to the hypergrowth of Android and newly viable platforms like Windows Phone 7