Amazon Kindle Fire: Is what’s bad for Android Good for the User?
In a recent post, I suggested that the Kindle’s genius was the fact that the OS is unnoticeable – that, when I use a device that is designed for content, the OS is the last thing that I want to think about.
Well, I wrote that just before the Kindle line got very interesting because Amazon just launched the Kindle Fire, which supposedly runs a branched version of Android.
There’s been tons of analysis and opinions on this device in the last two days, but what’s struck me as interesting is how many are commenting on the lack of Android branding. A widespread opinion is that Amazon has “hijacked” Android with this device (In fact, searching “Amazon Kindle Fire” in Google results in this article first – before any Amazon.com pages are listed.)
I think this is a odd way to view the situation and here’s why: I shouldn’t have to care what OS I’m running. The wonder and genius of the older Kindle (now known as the Kindle Keyboard) was that all I saw was content – I wouldn’t have even thought about the Kindle running Linux if it weren’t that this fact was listed as a glorious, epic victory on Linux blogs.
In the light of Kindle’s invisible-OS-genius, what could be better than this news? Amazon has managed to switch to Android – an indisputably better system – but has also done so without bringing-along the obtrusive artifacts of the underlying system.
Alan Perlis once said:
A programming language is low level when its programs require attention to the irrelevant.
It seems like a sidetrack, but when I buy a device designed for content, the underlying system becomes irrelevant, and a device is low-level (with regard to its intended use) when I have to pay attention to the OS (or even notice it).
The fact that Amazon got this right shows that they’re approaching Apple’s iPad market-share with a high-level understanding of their goals. As far as I can tell, they’re the only non-Apple tablet producer to have done so.
On the Genius of Kindle
I’ve been extremely skeptical of ebooks. There are a lot of arguments against them, but for me, an important part of owning a book is the tangibility and permanence of the possession. The woman in this Wondermark comic embodies a lot of my feelings toward investing in real books, and I perceive ebooks to potentially conflict with them.
But, at the same time, I try to keep up with technology, so some months ago I bought an Amazon Kindle. It was reasonably priced, clearly the best device on the e-reader market, compatible with my PDF files and, most importantly, meant that I could spend far less money on college textbooks.
Fast forward to today. I suddenly realize that my Kindle has completely transformed my reading habits. It goes deeper than being able to haul all of my college textbooks with my on campus. I’m reading more. I’m reading more fiction, more non-fiction. I can even email technical journals to it over WiFi and skip the trouble of printing them out.
Unexpectedly, the Kindle has become one of the best purchases I’ve made. Unexpectedly, it’s transformed my skepticism against ebooks. How did it do this?
The Kindle is high quality hardware.
There is no way around this. It weighs next to nothing, yet it’s durable and solidly built. What’s more, it has battery life that is measured in astronomical time. It has ample file-capacity and even has WiFi and 3G modems. I can throw it into my bag before biking to work and know it’s there and safe when I need it.
The interface is unassuming.
This is a huge deal. I think this is the central genius of the Kindle. There is minimal Kindle operating-system interface between my eyes and the ebook I want to read.
The interface is so unassuming that, in my mind, the Kindle is the book I’m reading, not some mini-computer running Linux that displays PDF files (which it is).
This is how the Kindle meets the tangibility need I have for books. I can read my “book” and hold it in my hand. Or set it down and think, but know it’s still there. That’s not the sense I get when reading a PDF on my laptop (which is technologically very similar).
Ubuntu Linux
This realization reminded me of a scuffle surrounding Ubuntu’s default settings for the Evolution email client about a year ago in September of 2010. Ubuntu 10.10 started shipping with a default signature in Evolution that appended the text:
Sent from Ubuntu.
It was a tiny change, but it aroused significant anger in the Ubuntu community when a bug was filed. There were many well-formed opinions added to the bug comments, which argued over whether the signature should be kept as default or removed.
One comment stuck in my mind as the truest argument over how an operating system should behave.
[…] The best OS is an OS you don’t see and hear!
This is an age where operating system UIs are getting much more rich and modern all the time. The most striking example is the preview of Windows 8 that has just been released, but OSX and Unix graphical shells follow the same trend.
What I think OS’s are in danger of forgetting amid market competition, and what I think Amazon’s Kindle and Ubuntu’s greenhunter got right, is that the OS is a means to an end, but not the end.
In the case of Kindle, this means minimal interface around the ebooks I want to read. In an conventional OS, it means minimal shell around the programs I want to run.
Where is Windows 8 Coming From?
Yesterday, (September 13, 2011), Microsoft released an early build of Windows 8. So, I jumped right on it. What fun.
Years ago, when I was in high-school I snatched an early beta copy of Vista to see what was up and learn the new UI. Later, I got ahold of the alpha of Windows 7 from my boss who attended PDC. Then I played with the Windows 7 beta when Microsoft pushed their new UI. I love messing with early versions of Windows just to see where they’re going.
This Windows 8 release is new and interesting and, I have to say, rather different from the other pre-release Windows’s I’ve tried. It’s buggier, and far more confusing. Granted, I’ve been trying it out in Oracle VirtualBox. No doubt many bugs I encounter are a result of VirtualBox’s idiosyncrasies.
However, it seems to me, releases like this are primarily to communicate the direction Windows is taking. The goal is not to deliver a stable, finished product. So what can we gather about Windows’ direction from this release.
This is what I think Microsoft wants me to learn from this:
- It’s fully touch capapble. I don’t care about this. I’m not likely to own a touch computer (or tablet, whatever) for a while. I just couldn’t use one.
Does Windows 8 succeed here? I guess, probably. …Whatever.
- It embraces the cloud. This is something Microsoft has to do. It’s a necessity. They want to produce an OS that is viable in the future. Apple and various Linux distros have already made interesting offerings in this space. Microsoft needs to keep up. To all appearances Windows accomplishes this at some level.
- It’s friendlier. Microsoft still wants to attain the level of usability and friendliness for which Apple’s OSX is already famed. They still want to do this (somehow) without handing over all power to the designers. It’s an uphill battle for them. I don’t know if they’ll ever succeed.
Microsoft has done much better in this regard than most give them credit for. Windows 7 is relatively nice to look at and use. It doesn’t compare to the aesthetics of modern OSX, but Windows has got to the usability level it has without insulting my intelligence. That was something Apple gave-up on years ago.
- It’s competing with iOS or the iPad. Windows 8 doesn’t even remotely compete at this level. I dislike iOS as much as the next guy, but I see why it’s good and why it has devotees. Windows 8 isn’t anything like iOS.
A lot of people are willing to see iPad competition here, but they’re just wrong as can be. Microsoft wants to see themselves as competing with the iPad, but they don’t seem to understand what makes it good. They don’t seem to be willing to make the shift in thinking that made the iPad disruptive.
I have a completely different impression from this Windows 8 build. I don’t see iOS. I see Linux.
There are two things I found interesting in my Windows 8 experimentation.
- I logged in with a Live.com ID. I didn’t make an account. I didn’t have to change my profile picture or enter my real name. I signed in from Live.com; effectively, I signed in from the cloud.
Some people may think this is innovative, but I’ve seen this before and I’ve seen this done better.
Over a year ago I was surprised to get a Google ChromeOS notebook. Here’s how it happened. The delivery man handed me a box. I opened it to find a notebook and a battery. I placed the battery in the notebook and hit power. I was prompted for my Google account. I entered it and suddenly my Chrome browser theme, extensions, settings, auto-fill database, history and everything were right there, in a computer I had only first seen half a minute before.
That’s the sort of dream experience the cloud is all about. It’s done well very rarely. In Windows 8, Microsoft is doing it, but not nearly so well as Google did it in ChromeOS.
- The Metro interface; a cloud-ish app layer on-top of a normal computer. This is nothing new either. Where have I seen this exact thing?
JoliOS. It’s a Linux distro not enough people care about. ChromeOS did some things well, but JoliOS was triumphantly suited for the cloud. It got it right. Yes, I want cloud apps, but I want a computer too. JoliOS was an Ubuntu/Debian branch so I could just switch out of the JoliCloud UI and do all the stuff you do in Linux. (Like install vim and somehow damage the xorg.config file. Linux stuff.)
I’m not a big Linux fan, but I appreciate it’s good qualities and I really appreciate the cloud’s good qualities. To me, the Metro UI thing in Windows 8 utterly pales in comparison to JoliCloud, which is free and open-source and more attractive and integrates with Dropbox and easier to use, and has better social tools…
So where is Windows 8 coming from? Not the iPad. It’s coming from Linux.
It’s not competing with the iPad, and it’s not competing with Linux either. It can’t do either of those things. It’s competing with Windows 7.
Not to say that it’s not worthwhile. I love Windows and want it to be as good as it can be. But, let’s not kid ourselves about where these features are coming from.
Google Bearing Gifts
This last Thursday I was surprised and delighted to receive a Cr-48 ChromeOS notebook, and I’ve chosen to share my thoughts in this post.
I remember the day that Google Chrome came out, a little over two years ago. Numerous blogs speculated that Google was planning on entering the browser market and it was anyone’s guess what that would look like. Google suddenly confirmed the rumors, and, the next day, they released the beta. That was blazing fast for a world where the speediest browser development cycle was Mozilla. (Even now, Mozilla is still taking it’s sweet time with FireFox 4…)
This ChromeOS notebook was another wonderful episode of Google’s surprising speedyness. I had signed up for the test program on Wednesday morning (the 8th) and received the machine the following day without even being informed that I had been approved! I guess Google knows how to get me excited about a new product.
In this post I want to quickly review my thoughts of the machine and OS, but then go into what I think Google is up to with this.
The Hardware
The Cr-48 hardware is fairly robust for a test (also, free) system. There are a good deal of complaints about the trackpad, which is finicky and occasionally inconsistent. It’s conspicuously modeled after the trackpad found in newer MacBooks, notably with its two-fingered-scroll feature. While Apple hardware is a good inspiration to build from, the imitation included with the Cr-48 is not polished. Alt-clicking and scrolling are delicate and choppy, and accidentally brushing the pad with a third finger seems to send it into total confusion.
Aside from trackpad woes, the rest of the hardware is solid. It has a rubbery surface which is easy to grab and it’s fairly light. Battery life very nice too, although I haven’t pushed it.
The Software
The hardware is nice, but, of course, the really interesting thing about the Cr-48 is ChromeOS. The experience of ChromeOS is essentially the same as using the Google Chrome browser. I log into ChromeOS using my Google account. When I did so on first-boot my Chrome extensions, settings and bookmarks were automatically imported, making my very first experience with the new OS pretty much exactly the same as in the browser.
In a world where machine shareability is more important than ever, this Google login scheme is a genius stroke. It also means that none of my sensitive information is stored on the machine itself, so if it is stolen, my data is safe.
As long as you remember that ChromeOS is just a browser, I think the software is pretty cool. If you want a little more from your system, it’s not really powerful enough to run Hulu smoothly, and has extremely limited access to the underlying system.
As a programmer, however, using ChromeOS poses a certain challenge. John Resig made a great post on his blog about using ChromeOS’ weak terminal to SSH into a more-flexible system in order to program effectively. This is tricky because development is a lot of what I use a computer for. More on this issue later.
What I think Google is Up To
My lovely fiancée is forever suspicious of Google’s motives, so when I told her about the new machine she said
“Beware of Greeks bearing gifts.”
While I don’t always share her suspicions, I think this classical quote is highly appropriate — Google is up to something.
On the surface this is a test program and clearly I can help Google out with bug reports, testing and reviewing. However, I think the trouble developers (like myself and Resig) have using our Ch-48s as development machines is telling.
ChromeOS is supposed to be all about web apps, but web apps for development (such as Mozilla’s Bespin project) are still primitive. This restriction forces us to get creative and further evolve the idea of truly cloud-based development.
I think the popularity of netbooks didn’t end up pushing better cloud-based development. A developer with a traditional netbook still had a normal HDD and complete system-level control; the need for cloud still wasn’t there yet, even if the desire was.
This is why I think ChromeOS’s severe system-access restrictions, and the fact that the test models are being specifically shipped to developers is because Google trying to incite developers to solve this the problem of cloud-based development for Google… for free. They’re engineering a need for the cloud.
Developers are problem solvers. Even my developer friend who dislikes the Cr-48 is trying to solve the problem. Google is being very clever. Not that I mind.
The jQuery Templates API and JavaScript’s Future
On October 4th (two days ago) jQuery announced that they had promoted three Microsoft projects as official jQuery plugins: The jQuery Templates Plugin, the jQuery Data Link Plugin and the jQuery Globalization Plugin. See the announcement here. It’s definitely worth a read if you use jQuery at all.
Now, in my opinion the new Data Link and Globalization APIs have yet to prove themselves. They really seem like Microsoft steering jQuery-style JavaScript towards the way ASP.NET Web Forms works, and time will tell whether that ends up making sense in JavaScript’s evolution. What I’m really excited about is the jQuery Templates API, and that’s what I think makes this a significant milestone for how we’ll be doing JavaScript in the future.
For Context…
The jQuery Templates Plugin allows you to generate HTML to represent data stored in JavaScript objects, similarly to PHP or ASP. For example, if your page contains the following template…
<script id="resultsTemplate" type="text/x-jquery-tmpl">
<li>
<a href="${Url}" target="_none">
${Description}
</a>
</li>
</script>
…This template can be selected by jQuery, rendered with data and then appended to the page. For example…
// Data stored in an object:
var resultsData = [
{
Url:"http://www.google.com/",
Description:"Google Search"
},
{
Url:"http://blog.thatscaptaintoyou.com/",
Description:"Wyatt Allen's Blog"
}
];
// Select the template,
// render it with the data (making it a bunch of LIs),
// and stick it in the page:
$("#resultsTemplate")
.tmpl(resultsData)
.appendTo("#myDivId");
… Very easy and maintainable.
What This Means…
Part of the significance of this is that templates mean we can build more interface into the browser’s language. We won’t need the server to render all our HTML for us, and, with the weight of many Ajax applications, we shouldn’t have to. This API is a wonderfully clean and manageable way of accomplishing this.
The other half of the significance here is has to do with how we build GUI frameworks. Sometimes I compare building web interfaces to building native interfaces on something like Windows. Early on, we’d build Windows programs by talking directly to the Windows API – using something like “windows.h”. Progressively, however, frameworks were built to make this process a lot cleaner and reasonable such as the MFC library. This transition really signifies ironing away the hard parts of an API using an object-oriented abstraction; complete with inheritance, polymorphism and the whole collection of OOP ideas. It’s an age-old, tried-and-tested, Gang-of-Four design-pattern, and we love it.
The way I see JavaScript DOM programming and the current state of HTML is that it’s still in the early “windows.h” stage of evolution. A good, strong object-oriented abstraction for programming web interfaces would meaningfully improve the development process, maintenance, security and richness of the web. The reason that I feel nobody’s build something like this yet is because JavaScript’s OOP approach is so unusual. Tools like inheritance and polymorphism as they’re implemented in JavaScript simply don’t lend themselves well to frameworks.
I believe that this new jQuery Templates API is a BIG push in the right direction. It will allow us to deal with interface components with varying degrees of abstraction and join data to markup in a responsible, semantic fashion. I encourage every JavaScripter to try jQuery Templates out for themselves. I’m going to be using them and closely watching how they’re being used in expectation that it will lead to an emergent, more properly-abstracted approach to our web applications.
Haskell’s foldr in JavaScript
Most people who work with me know that I’m a great fan of the Haskell programming language. I believe (as do most fans of the language) that a firm grasp of Haskell will help you become a better programmer generally. I feel, furthermore, that one of the contexts where this benefit is most pronounced is in JavaScript programming.
foldr in JavaScript:
And so, for use in my scripts, I’ve implemented Haskell’s famous foldr function in JavaScript. Source below:
function foldr(fn, ult, xs) {
if (xs.length == 0) {
return ult;
}
if (xs.length == 1) {
return fn(
xs[0],
ult
);
}
else {
return fn(
xs.splice(0, 1)[0],
foldr(
fn,
ult,
xs
)
);
}
}
What, in Haskell we might write as:
foldr (\x y -> (x+y)/2) 54 [12,4,10,6] -- Output: 12.0
In JavaScript we can write:
foldr (function(x, y){ return (x+y)/2; }, 54, [12,4,10,6])
// Output: 12
So, there it is. I hope you like it.
Further Pondering:
But before I go, I want to write some philosophical thoughts on Haskell and JavaScript.
The similarities between the two are more than passing. They are both functional languages. As Douglas Crawford points out, JavaScript was the first popular “lambda-language”. Both languages have proven to be highly expressive tools for programmers despite being occasionally unforgiving in syntax.
Aside: Curiously, some of the most clever programs have be written in the most austere environments. I’m reminded of the quote:
“More good code has been written in languages denounced as bad than in languages proclaimed wonderful — much more.”
— Bjarne Stroustrup
End aside.
However, the differences between Haskell and JavaScript become conspicuous. Whereas Haskell is statically typed and strictly functional, JavaScript is quite dynamic and is generally written procedurally. These features lead to common pitfalls in JavaScript, where scripts can turn into “spaghetti-code” or soupy variable messes of “side-effects“. Haskell itself is sheltered from these dangers by virtue of strong typing and restriction to the functional paradigm.
For these reasons, it’s my belief that taking experiences from Haskell programming into JavaScript algorithms results in safer, more reliable, more verifiable code. In the realm of JavaScript and the problems particular to it, these qualities are of paramount value.
In this spirit, I may find myself porting more of the Haskell prelude functions in the future.
Big.js version 0.8.0 Released
Big.js is now in version 0.8.0! Support for addition and subtraction for positive and negative numbers is now included. There are also new methods for cloning and negating numbers.
Expect multiplication, division and more in the next release.
Example using v0.8.0:
var pi = new Big(
"3.14159265358979323846264338327950288" +
"4197169399375105820974944592307816406" +
"2862089986280348253421170679821480865"
);
var twicePi = pi.plus(pi);
twicePi.toString() // -> "6.2831853071795864769252867665590057683943387987502116419498..."
// Actual: "6.2831853071795864769252867665590057683943387987502116419498"
Blog CSS Update
The blog was long overdue for a style update, so I’ve overhauled the look and feel of everything. Credit, therefore is due. The WordPress theme is a modification of the Carrington Text theme, which is a great starting point-in my opinion. I’m also using Cufón for rendering some of the headers, and within that, I’m using the lovely AvantGarde ALT font by ~depression02 on deviantart.com.
Thanks to all and I hope you like the new look.
Introducing Big.js: Arbitrary Precision Math for JavaScript
Numbers in the JavaScript language are inherently limited to 64-bit floating-point precision. In most programming scenarios this is ample precision, but some applications need something more. For those applications, programmers typically make use of an arbitrary-precision math library. However, a complete library of this type for JavaScript does not exist.
The wonderful jsbin.js tool by Tom Wu is a step in the right direction. It is essentially a port of the BigInteger API included in the Sun Java programming language. However, it sadly does not have support for fractional numbers (only integers).
For me, in my development of jQuery.validity, it is necessary for me to be able to check the mathematical inequality of numbers of any length. Particularly as a result of this bug report, it became clear that parsing strings as floats was not a viable way of checking inequalities. The report provides the following example:
// The validation rule is that the number // represented by a string should not be // greater than twelve. So, if a string // housed the value... var str = "12.00000000000000005"; // ... I should be able to detect whether it is // less than or equal to the number 12. // But to do so, parsing as a float does not do. parseFloat(str) <= 12 // Evaluates to true, should be false. 12.00000000000000005 <= 12 // Also, true. // JavaScript is truncating the number. // In fact... 12.00000000000000005 // ...itself evaluates to 12.
In a client-side validation framework (such as validity), this is not acceptable, because the web-application may deal with numbers which have greater precision than JavaScript can process. (The server may be programmed with higher precision or an arbitrary-precision library.)
The conclusion is that an arbitrary-precision library, capable of processing fractional numbers, is needed in the client-side JavaScript code. For this, I’ve written Big.js.
At the moment, Big.js is only able to perform inequality operations on numbers (i.e. lessThan, lessThanOrEqualTo, greaterThan, greaterThanOrEqualTo and equals) on positive and negative numbers.
For example:
// Numbers in Big.js are called with the Big() constructor:
var number1 = new Big("12.00000000000000005");
var number2 = new Big("12");
number1.lessThanOrEqualTo(number2); // False, like it should be.
// To boot...
number1.lessThan(number2); // False
number1.greaterThan(number2); // True
number1.greaterThanOrEqualTo(number2); // True
number1.equals(number2); // False
Inequality is all that is needed, technically, for the library to be useful in validation. Big.js is therefore in version 0.7.* (beta) at the time of writing this article. Version 0.8.* will have addition and subtraction support, and 0.9.* will have support for other mathematical operators. Finally culminating in version 1.0.* which will be considered “out of beta”.
The 0.7.0 beta is available on Github now under an MIT licence. More operators to be implemented soon!