Kevin's random thoughts :: tech

Doing the math, cont'd

Not sure if John Gruber noted this jackassery or not. Writing on ars technica, Joel Hruska manages to stop just short of a Jackass-of-the-Week award, but nonetheless veers deep into irrational anti-Artie-MacStrawman-ism.

Hruska's analysis of the fact that Apple's average selling prices are higher than the rest of the market starts off well enough:

Desktop PC average selling prices (ASPs) have scarcely changed in the past two years, while laptop ASPs have fallen 21 percent, probably in part thanks to rising demand and steeper competition among vendors. Mac desktop ASPs, on the other hand, have actually gone up by 7.7 percent, while laptop ASPs have dropped by just 3.8 percent. Apple, in other words, is bucking conventional wisdom, and selling computers that are significantly more expensive than the average unit shipped by the likes of Dell, HP, or Lenovo.

...and turns back from the brink for a moment of insight...

This would normally be the point at which any Mac vs. PC discussion veers off into a heated debate over hardware specs, manufacturer build quality, and acerbic commentary on the more dubious characters in one's family history. I'm rather explicitly not going there. Instead, I'd like to draw attention to a different facet of the situation. ... Apple is clearly picking up steam without significantly reducing its ASPs. It's even happening while PC ASPs, particularly notebook ASPs, are dropping.

The current situation implies that Apple may be drawing high-end notebook sales that would have otherwise gone to Dell, HP, Lenovo, or the other major players in this space.

...before veering off into warrantless-conclusion-land:

Apple has clearly created a value proposition that customers are willing to pay a substantial premium in order to possess. [emphasis added]

I think he's right that Apple is drawing higher-end (not just top-end, but mid-range too) notebook sales away from other makers, which makes his conclusion all the more senseless. As has been demonstrated already, comparably equipped Macs sell in the same price range as their Windows-preinstalled counterparts. If it's true that Apple's sales are coming from customers who would have otherwise bought $1000+ Dell or hp laptops, those buying Macs are not paying a premium.

Posted on August 21st | 3 comments | Filed Under: tech | #

No, really, everything is an expression

I just had a realization about Ruby that others coming from C, Perl, Javascript, PHP, etc. may not have quite grasped yet: In Ruby, since everything is an expression, semicolons are allowed within parentheses. That means parentheses effectively create a statement block (though not a new scope, and not a block in the Ruby sense of a first-class procedure object).

>> ("foo"; 42; :coolness)
=> :coolness

The above evaluates the values "foo" (a String), 42 (a Fixnum), and :final (a Symbol) in that order, and returns the last one. In Lisp, this would be a progn (Common Lisp) or begin (Scheme).

I've made use of this behavior before, I think, without really realizing the implications of it. In Perl, for example, you can use a bare block to group statements together. But you can't even apply a statement modifier to such a grouping. The following is a syntax error:

{             
  print "foo\n";
  exit(254);
} unless open(FOO, "foo.txt";

...leading to such idioms as:

print "foo\n" && exit(254) unless open(FOO, "foo.txt");

In Ruby, since everything is an expression, you can use statement modifiers on a parenthesized expression, like so:

>> (f = open("hello.c"); f.read) if File.exist? "hello.c"
=> # contents of hello.c

You could even use a compound expression as a conditional test (in a statement modifier!):

>> "non-empty file" if (f = open("hello.c"); !f.eof?)
=> "non-empty file"
Posted on August 19th | 0 comments | Filed Under: tech | #