Archive for June, 2007

The Apple approach (aka first impressions of the MacBook Pro)

Antonio Cangiano June 27th, 2007

All the best hackers I know are gradually switching to Macs. – Paul Graham

A week has gone by since I received my 15” MacBook Pro from Apple. In this post I’ll share my first impressions about the whole experience especially for those who are considering the switch.

Ordering the Mac

I placed my order online through the Canadian Apple store, selecting the available 2 day shipping option. The ordering process was quick and smooth, without many attempts to sell me add-ons or other products (I dislike GoDaddy and Dell for this reason alone). I received the first confirmation email regarding my order, and eventually, after a few hours a second email arrived which reported a higher sale price. It turns out that Apple didn’t show me the taxes when I checked out. I was not impressed by this, as the checkout should have reported the exact amount that I was going to be billed for, including taxes.

The shipment

During the ordering process I picked a standard configuration (15”, 2×2.2GHz, 2 GB), except for a larger hard drive. Despite this, my order shipped in 4 days, while the website officially predicted it would ship within 24 hours. Depending on how you view this, the extra charge for a fast delivery can be seen as pointless, if the bottleneck happens before the product is actually shipped.

Furthermore, providing more accurate expectations may cause one to consider a retail store purchase instead. But let’s not be too impatient, and accept this as an OK turnaround time. What surprised me the most was that a transaction which was handled entirely in Canada (Canadian store, address, credit card, etc…) was shipped all the way from Shangai.

I’m not naive, I was expecting the laptop to be manufactured in China, but not actually ship directly to my house from there. To make a long story short, the 24 hours for the shipment and 2 days for delivery, magically became 4 days + 4 days. It took 8 days to arrive here. If you are considering a purchase online, keep in mind that 8 days may not seem like a lot now, but when you are waiting for your (expensive) cool new toy, they can seem like an agonizingly long time.

According to the Apple website, it looks like they are running low on stock and the newest laptops are taking longer and longer to ship. I’ve also read a few threads about how many Macs arrived in suboptimal condition. Common issues are dead and stuck pixels (considered normal by Apple, unless there are 7 or more pixels affected within an area of 1 inch), light bleeding monitors, uneven backlight, a strong yellow tint in the lower third of the screen, warped cases, stuck or misaligned keys… you get the idea. I would advise you to buy in store if you can, I was lucky enough to obtain a model that appears to be in perfect shape, but you may want to double check your model at the point of purchase rather than risking it.

The packaging

Apple is miles ahead of basically all of the PC manufactures in this department. Their packaging is sexy, efficient and trustworthy. My MacBook Pro arrived from China to Toronto without a single scratch, and taking it out of the box, felt like undressing a beautiful woman (giggity giggity). This may not matter to you, but I’m a sucker for good design, and small details that show a certain level of attention to quality. Even the protective foam had MacBook Pro written on it and the keyboard had a protective cloth to prevent it from scratching the screen during transportation.



A fast and beautiful product

Apple redeems a so-so ordering and shipping process, by creating a product that is remarkable.



I’ve reinstalled the OS, in order to remove unwanted software and extra languages. Boy, this machine is fast. Reinstalling Mac OS X took very little time, and now it boots up in a matter of seconds (even though I rarely restart it).

Mac OS X doesn’t fall short of my expectations. It is awesome out of the box, because it allows me to focus on what I want to do with it (and without it getting in the way). In a couple of hours I had everything needed to develop in Ruby, Python and Haskell, and to use it for general productivity. It’s very intuitive to learn and I feel that I’ve grasped the essentials pretty quickly (it’s a BSD in the end).

The Apple approach

Most Ruby developers that I know use Mac OS X, Ruby on Rails and TextMate. Heck, that’s the configuration used by the whole Rails core team. But ask yourself, what do Mac, Rails and TextMate have in common? They share a common approach, they all just work out of the box. They can be extended, further customized and configured, but they ship “production ready”, adhering to good design choices and conventions.

Try to guess what the first question many of my friends asked me about the new Mac was? “Have you purchased TextMate?”. When I answer that those were the best sixty bucks I’ve spent in a long time, many of them dropped “the Emacs bomb”. Oh yes, Emacs. They just don’t get it.

Virtually everything that can be accomplished on a Mac with TextMate, when programming in Rails, can also be accomplished with a different OS (e.g. Linux), a different editor (Emacs, Vim, JEdit, etc…) or web technology (e.g. ASP.NET, J2EE, etc…). The problem is “how” you accomplish the end result, and what sort of effort, knowledge and time are required to do so.

I don’t feel my time is best spent excessively configuring and fiddling with the tools that are supposed to make me more productive. “Emacs can be made as productive as TextMate”, but even so, who cares? If it takes me a day or two to configure it, in order to obtain similar functionalities to those of TextMate, Emacs ends up costing me a much higher amount of money than the mere 39 Euro I gave Allan Odgaard.

The same thing goes for Rails. You could tell me that there is no need for Rails when I can use the whole J2EE stack, and many people actually believe this. Sure, go ahead and good luck with writing lines upon lines of XML just to barely configure your application.

It’s a matter of your personal mind-frame. Correlation doesn’t imply causation but I don’t think it’s a coincidence if at RailsConf, most developers showcased Macs.

To quote Dave Thomas:

The tools are not necessarily better, but they don’t have to be sharpened or maintained as often, which lets you concentrate on just using them.

This is how software should be written, and ultimately what the “Apple approach” is all about.

On Ruby and Rails Criticism

Antonio Cangiano June 19th, 2007

If there is one thing that politics teaches us, it is that humans have different views on how to approach and solve problems. In politics no party has the solution for all problems that affect society. Some ideas are objectively more promising than others and have a track record of being implemented with success, greatly benefiting the general population. But typically it’s not possible to state that party X offers the perfect solution for each problem, nor that any single ideology is the panacea for society. Granted that this holds true, the humanist imprint of modern society and centuries of history show us that an ideology like democracy appears to be a much better choice for most people than, say, a totalitarian regime where communism or fascism is in power.

In the programming world things are not that different after all. There are more “liberal” philosophies such as dynamic typing, Open Source, and Agile development – just to name a few. And more “conservative” ones like static typing, proprietary software, software patents, and languages entirely promoted by big corporations. Just like in politics, none of us holds the absolute truth. It’s a matter of applying the more appropriate philosophies (or in practice, methods and tools) to the art of solving complex software development tasks and problems.

Warren Henning wrote an article titled If Ruby is so great and opportunely filed it in the “Politics” category. He asks a few rhetorical questions – nothing terribly new to be fair – in order to somehow question the value of Ruby. Articles like that always cause me to smile, and I’m often tempted to just move on. But I feel compelled to use it as inspiration for a broader topic, the handling of criticism in the Ruby and Ruby on Rails communities.

The Ruby and Ruby on Rails communities have a lot of passion. We love our language, created by a very cool guy (and maestro of humbleness) in Japan. We love our framework authored by a Danish GAP model :-P, and we really enjoy the spirit in the community which grants refugee status to all PHP and Java developers out there. We have the best non-paid marketing department in the world. We started the revolution which is powering most of the new social websites out there. All these points may cause some people to consider us Ruby and Rails developers as being “religious” about our tools of choice. Religious as I intend it, implies a dogmatic acceptance of a supposed truth. A religious attitude can be seen as blind acceptance without questioning, and Ruby and Rails developers are definitely not “religious” according to this perspective.

Most of us have experimented a lot with other languages and technologies before declaring that we love programming in Ruby, and quite a few of us don’t merely settle and continue to explore the world of possibilities offered up by the software development field. It may sound pretentious, but most Ruby developers know what they’re talking about and are just “passionate” about it, not “religious”.

A passionate community is emotionally easy to attack and may produce inopportune responses in defense of whatever has been questioned. Over the past three years I’ve heard a few bad things about Ruby and I’ve seen all sorts of responses, which in some cases were simply overreactions. After a while you start always hearing the same complaints or excuses for not adopting Ruby or Rails. My bottom line is: let me show you something cool, but feel free to use whatever you like. I think that it’s important to promote valuable technical solutions, languages and tools for software problems; but the acceptance of these is not a passive process. We can encourage and show the benefits of a given technology, but we can’t force it down the throats of developers whose primary language preference is different than ours.

Sometimes the accusations towards Ruby or Rails are just ridiculous and are factually inaccurate. It is important that as a community we debunk these myths and unjustified criticisms. But it’s just as wrong to react with denial towards genuine criticism. For example if a blog states for the nth time that the Ruby interpreter is slow, there is no point in saying that’s not true, and that the benchmarks on the language shootout are bogus. Sure they may be considered worthless or not too representative of real world performance by some, but let’s be honest, we know that Ruby is slower than many other languages, why deny it? I’ve no problem with recognizing that Haskell is much faster than Python and that Python is faster than Ruby in most scenarios. There is nothing to hide or get upset about; Ruby is a wonderfully designed language whose main implementation is currently suboptimal.

Generally speaking, Ruby’s shortcomings aren’t sufficient enough grounds to discredit the language as a whole. Pointing this out in an argument is a better strategy than denying the problem a priori. As a matter of fact, I find Ruby to be fast enough for most tasks (on modern architectures), while still recognizing that an equivalent program in C would most likely be much faster. An even better road to take would be to provide examples of how computationally complex problems can be dealt with efficiently in Ruby, highlighting the best practices and the existing workarounds to deal with Ruby’s current weaker points.

My favorite approach is the one taken by brilliant people like Ola Bini and Koichi Sasada, which provides concrete answers to Ruby’s main criticism by working on optimizing Ruby (at this point you can consider it a language with multiple implementations). We should listen carefully to valid criticisms because they are a reminder of where we should focus our attention in order to improve what is an already capable language. With the expansion of the Ruby and Ruby on Rails communities, I’d love to see a trend towards the adoption of a compromise between the excellent marketing of DHH, and the humble and objective nature of Matz (it’d be dangerous if you got it the other way around ;-)).

The short post “If Ruby is so great” is not conceptually far from a hypothetical and rhetorical post entitled, “If Democracy is so great”, in which the validity of democracy as a political basis for society is questioned. In such a post one could point out the defects, drawbacks or even limits of democracy, but democracy wouldn’t be any less important and valuable. I sincerely believe that democracy is a great achievement for humanity and the cornerstone of a more equal and fair society, but there is no implication that it’s perfect and that it’s the final solution for all of the world’s problems. Ruby, in the field of general purpose programming, and Rails in the Web development arena, are no different.

Switching to Mac

Antonio Cangiano June 12th, 2007

Despite the somewhat disappointing announcements (from a hardware standpoint), I appreciated Steve Jobs’ focus on the new features of the Mac OS X Leopard during yesterday’s keynotes at WWDC. I’ve been using Windows Vista for a few months now (albeit Ubuntu is my main OS) and the impression that I’ve gotten really hasn’t been wildly positive. Microsoft failed to be innovative, instead they mostly just copied features that had already existed in Mac OS X for years. By doing so they came out with an operating system which ended up being sold in 5 different versions , 4 of which are crippled due to margin optimization reasons.

In my opinion Vista is still at a beta quality level. It doesn’t feel solid, it crashed several times over the few last months, and applications tend to freeze often. Based on a few informal benchmarks that I ran, applications appear to be significantly faster on XP SP 2. That said, yes it’s shiny and nice looking (a tad tacky perhaps?), but is this really the best they could come up with in 5 years? From what I’ve seen, Mac OS X Leopard – which is in beta now and will be sold in October – is years ahead of Windows Vista Ultimate, and yet it costs only $129. That’s the best measure against piracy, a very fair price for an excellent product.

In my last post I stated how much I’d like to have Mac OS X (truly the best OS out there right now in my opinion), but how I wasn’t totally convinced by the Mac Book Pro. I thank everyone who commented with insightful considerations and reminders, I weighed all of your input and it definitely aided me in making my final choice. I carefully excluded low profile laptops in favor of high quality brands and components. In the end I was able to scale down my choice to a very nice looking Lenovo Thinkpad T61 and the Mac Book Pro 15.4”. It was a tough call because I actually happen to get special discounts for the Lenovo (due to where I work), and in my mind the Thinkpad is an absolutely fine machine, no doubt about it. But I knew that if I passed up the chance to get a Mac while still spending a comparable amount of money, I would eventually regret it. So I decided to give the Mac Book Pro a second look, this time more in-depth and on an actual desk without the Best Buy security cables in the way. The screen size seemed good enough and from an ergonomic stand point it was surprisingly comfortable. Yes, we finally clicked!

Considering that it is very portable for being a relatively compact laptop, but when connected to a 22” Widescreen LCD in dual screen, it becomes comparable to the thrilling experience that the iMac 24” offers up (only much faster). The Mac Book Pro became suddenly very tempting. Too tempting in fact…

Yesterday night I finally ordered it online. It cost an insane amount of money, but I believe it is going to be worth it. I’m now obviously looking forward to the package arriving through Fedex and hope that the machine is in peak condition and free of any issues right out of the box. There is so much that I need to learn in regards to the Mac world, but I’m willing to give it my best shot. I believe Mac’s market share will skyrocket and become very significant, therefore it’s a good idea to become well versed in it, even from a development viewpoint (RubyCocoa anyone?).

So yeah, I’m yet another Rubyist switching to Mac. ;-)

Next »