Have the terrorists won?

I was wasting time looking at today’s
poll
about frequency of air
travel on slashdot when I came across this
comment
.

Bah, I say. Bah. The terrorists have truely won the fight to cause permanent
annoyance everywhere. And our politicians, all of them, went with it
wholesale. Strike one up for that moral panic. Now, any takers on bets how
long it’ll take us to clean that mess up? 20 years? 40?

Thinking of politicians brought to mind the following lines from
Ballad
by New Model Army

Not foolish and brave, these leaders of ours Just stupid and petty, unworthy
of power

Unfortunately, I reckon that sums up modern British politicians perfectly.

iPhone - It's the user interface

I finally got around to buying an iPhone 3G about a month ago. I thought about
writing a review but didn’t because there is not exactly a shortage of iPhone
reviews out there. However, I do feel that one of the central lessons of the
iPhone’s success has not been learnt by Apple’s competitors.

When the iPhone was first launched there were people queuing up to announce
that it would be a flop because:

  • it was over priced
  • it didn’t have 3G
  • it didn’t have GPS
  • other phones had better cameras
  • etc

Basically you could sum most of the arguments up as “my
Nokia/Motorola/Blackberry does all this and more and was cheaper.” The now
obvious rejoinder is “yes, but you don’t use most of those features because
the user interface sucks.”

Many other people have pointed out the problems with comparing lists of
features. The most important feature “a user interface that does not suck”
never appears on iPhone detractors lists of features.

Once it became obvious that the iPhone was a success you might naively have
thought that other manufacturers would pick up on this but they didn’t really.
Instead we got a spate of phones with touch sensitive screens such as the
Blackberry Storm and the Samsung Tocco. I’ve never used a Blackberry Storm so
I won’t say any more except that I’ve yet to read a positive review of it.
Anyway, you can see the thought process going on chez Samsung et al
“multitouch screen equals success; therefore we must build a multitouch
phone.”

Now I would like to contend that a multitouch screen is not necessarily
essential. Imagine for a moment that Apple had not gifted the iPhone with a
multitouch screen. It might be very little like the iPhone we know but, and
here’s the important point : would Apple have thought any less about the user
experience? No, of course not. I think it’s possible to conceive of Apple
producing a great phone without multitouch because they would focus just as
hard on producing a “user interface that does not suck.” That is the lesson
that other phone manufacturers should have learned instead they were
distracted by the shiny new technology.

On Friday, I had the chance to use a Samsung Tocco when the husband of one of
my colleagues asked me how to turn of the annoying key sound. Now, a key click
does not sound like a bad idea - lots of devices have this, including the
iPhone. Now imagine a key sound [2] that is:

  • an annoying jingle,
  • long in duration (I didn’t time it but it seemed like a second at least),
  • LOUD,
  • accompanied by aggressive use of the phone’s vibrator,
  • not obviously disabled.
  • happens every time you touch a key on the phone.

Does this sound like a good user experience to you? Does it seem like a
sensible default. The poor guy was so desperate that he would put the phone
into silent mode when he wanted to do something because it was the only way
he’d found to get rid of the key sound. Now, we did manage to sort this out
but only after googling. You see there are phone settings that are easily
accessible but they don’t give you the option of turning of the key sound -
instead there is an unlabelled button next to each phone profile which
contains more settings and once you’ve pressed that button, and selected the
right sub-menu you can turn the volume down and make the phone usable.

Now, while I was messing about with the Tocco trying to turn off the key sound
I necessarily got to see a bit of it’s user interface. The Tocco has both a
keypad and a touch screen and they’ve copied some of the iPhone’s user
interface gestures such as the “flick to scroll.” However, rather than
learning the real lesson of the iPhone’s success they’ve just attached these
new features to the existing krappy interface and stirred some dumb defaults
(ie truly obnoxious key sound) into the mix to produce truly awesome levels of
suckage.

Based on my experience with the Tocco I would say that Apple’s biggest concern
with the iPhone should be not shooting itself in the foot and sorting out the
lunacy that is the app store approvals process.

View the discussion
thread.

Review: The Twilight of Atheism: The Rise and Fall of Disbelief in the Modern World by Alister McGrath

I read this book shortly after finishing “God is not great” by Christopher
Hitchens
and the two books
make an interesting pair. I found it fascinating to compare each’s arguments
and also the respective styles in which the books are written.

Whereas “God is not great” is quite confrontational and rabid in its dislike
of relion “The twlight of atheism” is much more moderate in its tone. McGrath,
a Christian, was formerly an atheist and presents quite an even-handed
description of how atheism came to be popular and why he believes it is now
less popular.

In a nutshell, the problem with atheism according to McGrath is that atheism
rose in popularly because of defects in the Christian Church. However, now the
church has reformed and changed the behaviour and some of the attitudes that
drove people away (again according to McGrath) there is no longer the
compelling reason for people to turn to atheism.

McGrath spends a lot of time describing the rise of the popularist pentecostal
church as an example of how Christianity has changed and adapted to the modern
world thereby rendering atheism obsolete.

I have a number of problems with this part of the book in particular: Firstly,
while it may be true that the Christian church has become more moderate than
in ages past surely this does not affect the truth or falsity of its beliefs.
Surely people who think on these issues will find religion as unconvincing (or
as convincing) as they might have at any time in history.

Secondly, McGrath seems to confuse popularity with being right - the
pentecostal church may have reached out to the disenfranchised and gained a
lot of support but that does not make its message any more true or false.

In summary, I enjoyed reading the book and I would recommend it to anyone
interested in religion or atheism but I finished it feeling unconvinced by the
central argument that atheism is doomed.

Links

View the discussion
thread.

Review: God is Not Great by Christopher Hitchens

I enjoyed reading this book - Hitchens does reasonable job of debunking some
of the major tenets of the major religions such as Christianity, Judaism,
Islam and Buddhism. He is pretty even handed they all get a pounding.

However, the book does come across as somewhat mean-spirited: figures such as
Mother Theresa and the Dalai Llama who most people would consider highly
moral, peaceful and caring irrespective of their religion get their share of
abuse too. On one hand you can’t accuse Hitchens of pulling his punches on the
other I wonder if such an approach is likely to alienate people.

Like Richard Dawkins appears to have become, Hitchens seems just as rabid in
his hatred of religion as any of the worst sort of religious fanatic - in my
opinion he’s not doing himself any favours in this regard.

Links
- Amazon.co.uk:
Hardback
Paperback

Review: Princess by Jean P. Sasson

Update: 30/5/2010 There appears to be further evidence that the story in
the book is a forgery. See
here and
here.


I actually read the French version of this book (the French version is titled
“Sultana”) but I guess the English version should be pretty much the same - in
any case I’ve put French and English links below.

If bigotry, racism, cruelty, hypocrisy and shear human stupidity make you
angry then this book is likely to leave you feeling furious that such
injustice is allowed to exist in the world. Saudi Arabian society, as
described in this book, seems to have cruelty and misogyny as its founding
principles.

Towards the end of the book Sultana meets a Lebanese woman who’s daughter was
abducted by a wealthy Saudi in order to forcibly remove a kidney. After
telling Sultana her story the woman finishes with “It’s true that the need for
money attracts foreigners to Saudi Arabia, but those who have known you will
hate you forever” (I’ve translated this from French so the words may not be
exact but I think the meaning is correct). I’m getting ahead of myself though,
let’s go back to the beginning.

This book, the author tells us, is a true story as told to her by her friend :
a Saudi princess who we only know as “Sultana” - all names have been changed
in order to protect her from reprisals. So have on one hand a fairly
horrifying story but one which we can’t easily verify except by visiting Saudi
Arabia ourselves or finding people we trust who’ve lived there. Although I’ve
no first-hand experience of Saudi Arabia through my wife I’ve met and heard of
Filipinos who’ve worked in the Arab world (including Saudi Arabia) and what
I’ve heard from them gives some support to this book. Read the reviews on
Amazon though and there are a number of dissenting voices from people claiming
to have spent time in Saudi Arabia. I’m going to continue as if the events
described in the book are true, but take the following with a pinch of salt.

Sultana shares the story of her life from the age of three until her thirties
by which time she is married and has given birth to a son and two daughters.

Sultana is the youngest daughter in a family with many daughters but only two
sons. Her brother, only three years her elder but for many years the only son
is given anything he wants and doted on by his mother and father. Sultana is
barely noticed by her father except when he hits her for speaking out of turn
or not showing “proper” respect.

The books contains a litany of horrifying events, including:

A Filipino friend of Sultana’s (Filipino) maid arriving to work for an
employer as a maid only to find she’s expected to provide sexual services for
the family’s teenage sons. However, the husband decides she’s too pretty for
them and keeps her for himself, raping her every night for the length of her
two year contract.

A teenage Saudi girl is raped by her brother’s friends after they get drunk at
her house one night. Her brothers deny that they were drinking and claim she
flaunted herself before them rendering them unable to resist having sex with
her. The boys are believed. Since the girl is pregnant as a result of the
rape, she is confined in hospital until the birth and then stoned to death.
Sultana doesn’t witness the stoning but apparently the family’s chauffeur
enjoys attending a good stoning and later on Sultana describes another stoning
to death as recounted to her by the chauffeur - it’s about as horrifying as
you could imagine with the woman being treated fairly brutally generally, then
whipped and then finally stoned to death by a crowd with the actually
punishment taking two ours before a doctor finally pronounces that the woman
is dead.

We hear about an unmarried girl friend of Sultana’s being drowned by her own
father after having sexual relations with a man.

Sultana also describes a family holiday to Egypt in which she returns to the
rented villa one day to find her brother raping an 8 year-old girl. When she
complains to her aunt & uncle (the adults taking the teenagers on holiday)
they treat the event as a bit of harmless boyish fun.

There is more but I don’t feel like describing it.

Throughout the book both Sultana herself and the author (Jean Sasson) describe
how courageous Sultana is and how much she works for the rights of women.
However, I didn’t really see any evidence of this - as far as I could see
Sultana was driven by her selfish self-interest and nothing else. In fact she
comes across as a selfish and not very pleasant person.

Anyone reading this book would need to make their own minds up about whether
there is any truth in it or whether it’s an invention of the author.
Personally, I would have thought that the events described within the book
would be enough to identify Sultana and so on balance I’m somewhat doubtful
although unfortunately I can still believe that events similar to those
described could happen in Saudi-Arabia.

Amazon.co.uk
Amazon.fr

View the discussion
thread.

The news at duh! -- Woe is wii

I came across this blog
entry
entitled “Woe is
Wii
“ a couple of days
ago and can’t resist commenting any longer.

Apparently the Wii is still the best selling console and supposedly, unlike
Sony or Microsoft, Nintendo makes a profit on hardware sales so you’d think
there would be nothing to complain about, right?

Newsflash: Casual gamers spend less time playing games!

Yes, that’s right the Wii is doomed because people spend less time playing it
than the other next gen consoles. Surely the point about casual gamers is that
they are, well, casual, and so probably spend less time obsessively trying to
complete a game (not that there’s anything wrong about playing a game
obsessively) - so information from Nielsen showing that people tend to play
the Wii less than any other console shouldn’t really be a surprise should it?

Links:

View the discussion
thread.

"Creating a language on the JVM" a talk by Ola Bini

I was lucky enough to be able to attend a talk organised by London Geek
nights
at the
Thoughtworks London office entitled “Creating
a language on the JVM” by Ola Bini. Ola is a committer
for JRuby and is also working on his own language
Ioke.

The following are rough notes that I made during the talk. They’ve been tidied
up a little and I’ve added links where appropriate but I have not put any
effort into making a coherent narrative. Phrases in “double quotes” are
quotations from Ola himself. Ola’s slides are now published on
here on his
blog.

The first issue Ola addressed was why target the JVM when producing a new
language.

  • memory management is robust and efficient
  • hotspot compiler gives high performance
  • support for concurrency
  • open source, many implementations
  • mature code loading
  • highlevel abstraction
  • platform independent
  • reflective access to classes and objects
  • good debugging tools
  • many mature libraries

Ola was asked to comment on the JVM as a platform compared to the CLR. He said
that the JVM is five years older, currently has better optimisation and so
tends to be faster. The CLR has some bytecodes that the JVM lacks but Ola
didn’t seem to think that they were particularly important.

Most of the talk covered general language design with some mention of how some
of these issues related to the JVM with concrete examples from JRuby and Ioke.

JRuby is now almost at version 1.2 “best implementation of ruby for many
purposes.” Ioke is an experiment to see how expressive a language can be. Has
a prototype based object system.

Decisions when designing a language

  • General purpose or special purpose
  • Paradigm: object-oriented (what kind, eg prototype vs classes)
  • syntax
  • type system: static vs dynamic, weak vs strong
  • other features

One advantage of the JVM is the ability to use Java languages - however you
might find that the java languages are not a good match for your new language.
For example Java does not support closures and so the Java libraries are not
designed with closures in mind they would not feel therefore natural for a
language such as ruby. In contrast the ruby libraries are designed to take
advantage of closures.

Syntax - often separated into lexing and parsing with both the lexer and
parser being auto- generated from some form of grammar. Jruby uses a hand-
coded lexer and a parser generated by
jacc Ioke uses a lexer/parser generated
by antlr.

The JRuby lexer is complicated (approx 2400LOC) both because of the nature of
ruby itself and also because in JRuby it’s possible to turn individual ruby
1.9 features on & off.

Type checking - what kind nominal or structural?

  • System F
  • typed lambda calculus
  • parametric polymorphism
  • variance

Scala & Haskell are currently the state of the art in type checking.

An issue to consider is the notion of bottom types - types that are a subtype
of every type, for example null in Java and C#. Note that nil in dynamic
languages is not the same thing. It’s been proven (apparently) that if you
have bottom types then you can’t avoid runtime errors. Several languages go
for option or maybe types instead.

Scoping - dynamic, object or lexical - emacs lisp is the only currently
used dynamically scoped language.

Control structures expressions vs statements

  • precedence , associativity
  • initialisation
  • assignment, not all languages have it, for example in erlang what looks
    like assignment is actually unification
  • ordering within expressions
  • short circuiting

control flow

  • goto style vs continuations
  • iteration
  • recursion

What about operations such as ruby’s conditional assignment operator ||= (only
assign a value to a variable if it is not already bound)?

How about the trinary if statement - useful if everything is not an expression
(but ruby has a trinary if anyway since it’s more compact than the standard if
form).

Notions of truth - what is counts as true and false?

data types - do you have primitive versions of types for efficiency? What
constitutes equality?

Parameter passing - call by value, by reference, by name?

can you return multiple values from functions? - difficult to do in JVM and
not every efficient since all return values have to be wrapped Optional
arguments? Default values?

The closer the language is to java the easier it is to make the language
efficient at run-time.

Evaluation - how to evaluate your language? interpreter, internal byte
code, java byte code, continuation passing.

Java memory leak issue - need to create new classloader in order to reload
code for a class - this does not get garbage collected (anonymous classes
don’t have this problem?). CLR is better than java in this respect.

Internal representation - JRbuy wraps all objects so that all JRuby
objects inherit from a common type. however this means that Java objects
cannot inherit from jruby objects. They are in the process of removing this
wrapping.

Visitor pattern is obvious way to implement AST interpreter, however this
prevents hotspot from optimising so they use a large switch statement.

Final methods can be much faster in java so worth seeing if you can make use
of them.

“write bad code to get good performance” but “write good code first” (use
profiling).

Error handling

  • exceptions
  • conditions (“a formalised agreement on how to handle
    errors”), can be built using exceptions.

Ola briefly talked about error handling using
conditions and how they allow more flexibilty than
exceptions. A condition consists of code for signalling the exception, code
for handling it and code for restarting the normal program flow. Ola showed us
how conditions work in Ioke by intentionally introducing errors in some code
and showing how they could be recovered from interactively using conditions.
Whereas exceoptions are only for errors, conditions are can also be used for
warnings.

Java integration - Can be hard to get right. Calling java methods
including static ones. Choosing between overloaded implementations. Need to
implement java types in host language. How to implement interfaces? Can use a
dynamic proxy but this approach does not work for extending classes. What
about calling methods using super?

Need to really understand bytecode. Ola uses ASM

Can use code annotations to get sensible output from java debugger.

Limitations of java bytecode

  • statically typed bytecode
  • primitive types but not tagged values
  • no continuations
  • no tail call optimisiton

Ioke

Ioke sounds like it has inherited some ideas from
self

Entire language written test first - rspec cases for entire language, rspec
tests then converted to ispec tests.

ruby concurrency support is not too good - Ola plans to implement transparent
futures in Ioke.

Review: Watchmen

It was thanks to the film that I
discovered the graphic novel. I’m not
normally into graphic novels and so I hadn’t heard of Watchmen until I saw the
trailer a few months ago. I first looked at the official film website but that
site commits the heinous crime of resizing the browser window (I really
hate it when web designers think they know better than me what size I want my
browser windows). I turned instead to a Wikipedia
article
which intrigued me enough that
I bought the graphic novel itself.

Suffice it to say that I feel that the graphic novel lives up to the hype -
there is so much going on so many levels. So, does the film do it justice?

Given the complexity of Watchmen it was inevitable that the film was going to
have to make compromises and for the most part they make sense. For example
the plot by Veidt is changed to remove a whole host of minor characters.
“Tales of the Black Freighter” is also gone completely and the kid reading it
and the news seller appear very briefly. Other changes are stranger: why is it
Dreiberg and not Rorschach who goes to warn Veidt about the threat against
masked vigilantes for example? An environmental theme is also present in the
film that I don’t remember from the graphic novel - Veidt sets out to produce
free energy to make fossil fuels obsolete - this does not advance the plot and
is a distraction from the main concern: the threat of imminent nuclear war.

For the most part the dialogue is relatively close to the original but the
screenwriters (David Hayter & Alex
Tse
) don’t have Alan Moore’s talent and
the modified dialogue doesn’t live up to the original.

The main trouble with the film though was the action scenes - part of the
point of Watchmen is that, with the exception of Dr. Manhattan, none of the
characters have super powers. The graphic novel gets away with cartoon
violence because it’s a cartoon but, IMHO, it does not work at all well in a
live action film. We accept exceptional strength or speed in a Spiderman or
X-men film because the point of those films is that the characters have
exceptional powers and we can still suspend disbelief. Unfortunately, I don’t
think this works at well for Watchmen and seeing ordinary people punching
through walls, for example, just doesn’t work.

Watchmen the movie is not a bad film, but it’s not a great one either. As
entertainment it’s not bad, as an attempt to bring the graphic novel to the
screen it’s a disappointment. Given the complexity of Watchmen it was
obviously going to be a challenge and, unfortunately, it seems to be a given
that great books often result in mediocre films. There have been exceptions -
Peter Jackson’s Lord of the Rings trilogy for example - sadly Watchmen the
film is not one of them.

View the discussion
thread.

Too many people?

When discussing global warming and the environment there seems to be a huge
elephant in the room that nobody wants to talk about - that no matter how much
we cut down on personal consumption it won’t make a difference if the global
population keeps expanding. Take this recent
article
the New
Scientist
which discusses how bad things could
get and yet still imagines a world with a few billion more people than at
present.

Now the New Scientist
article
is probably just being realistic and
assuming that no politician is going to be brave enough to raise the subject
of global population control.

I’m not prepared to go as far as Steven Kotler and say that people should be
criminalised for having large families
but we are clearly not suffering from a shortage of people
and something does need to be done. For example, in the UK after World War II
the government introduced child benefit to encourage people to have more
children in order to rebuild the population - shortage of people is no longer
a concern but we still have child benefit. Why? Probably because no politician
has been brave enough to suggest cutting it.

I’m not going argue about the right of people to have some children but
surely there is also a commensurate responsibility to find the means to
raise them. I don’t see why other people should pay to help me raise my two
children and I don’t see why I should pay just because someone else decides
they want a large family.

In the past discussion of birth control has focussed on the developing world -
I say it should focus on the west since, unfortunately, it’s currently the
developed world has has both a high density of population and the worst per-
capita impact on the environment.

Read the New Scientist article - doesn’t sound very appealing does it? Reading
it made me think of people living like battery hens - I don’t think anyone
would like their children to live like that. The solution is simple - have
fewer children.

Links

View the discussion
thread.