July 29 2008
I always enjoy reading interviews and discussions with Larry Wall - a brilliant language designer whose unconventional wisdom and humor makes his explanations of complex and chaotic issues seem strangely cohesive. Perhaps he is the one true opinionated programmer. Ruby, as an opinionated language certainly owes a lot to Perl, but there are some things Larry Wall believes Ruby has not got right:
I think it's a violation of the Beginner's Principle of Least Surprise to make everything an object.
I disagree with this sentiment as I think the tendency to 'primitivize' types in an otherwise object oriented language leads to a far greater cognitive dissonance than just having a consistent model to start with. As long as there's a shorthand syntax for expressing literals, is it really that hard to understand?
The problem is that beginners are only beginners for a short period of time. Once they start to understand the language space better, then the cognitive dissonance of a split between primitive types and objects starts to kick in. Maybe this is only a problem in languages like Java where the behavior of primitives (eg: int) and fully fledged objects (eg: Integer) can be completely different.
One of the reasons why Flash ActionScript has been so successful with designers and traditional 'creative types' is precisely because its "everything is an object" philosophy makes logical sense and is easy to work with, in comparison to the way we explain and model the everyday world around us.
This Note
Asides