By Antonio Cangiano, Software Engineer & Technical Evangelist at IBM
Currently Browsing: Mac

This Week in Ruby (May 29, 2008)

This is the 9th episode of This Week in Ruby, please consider subscribing to my feed so as to not miss any weekly installments.

Ruby

Two days ago JRuby 1.1.2 was released. Amongst several bug fixes and improvements, this release is characterized by a focus on performances. Startup time, threading, method calling and YAML symbol parsing have all been drastically improved.

Huw Collingbourne of SapphireSteel, has announced that he’ll be releasing a complete book on Ruby, chapter by chapter, free of charge online. After reading the first chapter, I can attest that it’s excellent. Keep an eye on it, as new chapters get added.

The Pragmatic Programmers put out a series of screencasts for sale. The most relevant series for Ruby programmers is Everyday Active Record. The first two episodes (a half an hour long, each) are out and can be purchased for just $5 a piece. The preview — and Ryan Bates’s reputation — lead me to believe that they are entirely worth their very reasonable sticker price. Speaking of screencasts, a new one about merb-slices was released on Merbunity, check it out if you’re into Merb.

There were two important releases last week, Mack 0.5.5 — which features a new rendering engine with support for Haml and Markaby — and DataMapper 0.9, a major reworking of the ORM. A third release, which is perhaps just as welcomed, was launched by _Why who included a few graphical improvements for Shoes, his GUI application toolkit. Definitely neat stuff, which I invite you to take a look at if you’re working on a Mac.

Peter Cooper published 21 Ruby Tricks You Should Be Using In Your Own Code. You probably know already most of the common ones at least, but they’re quick and fun, so if you haven’t checked out the post yet take a moment and do so. Other must-read tutorials and articles were Ruby && DTrace! (really neat results), Ruby EventMachine – The Speed Demon by one of my favorite Ruby bloggers, and Will’s Guide to Mashing-up Remote Databases using Page Scraping.

In a post made a couple of days ago, Robert Fischer opened up a can of worms by bringing up the issue of Ruby and XML libraries. As most of you know REXML is far from being issue-free (performance in primis), and in The Status of Ruby’s libxml Robert uncovers that the author of LibXml Ruby is unable to actively pursue the development of his extension. This issue concerns me, but if I’m working with databases, I prefer to take advantage of DB2 Express-C ’s fantastic pureXML features, which give me the sort of speed, flexibility and stability that I won’t find in a Ruby library anytime soon.

Before highlighting some of the news from Rails-land, I wanted to inform you that a new version of The Great Ruby Shootout will surface in June, as I intend to test a couple of special new entries.

Rails

Today, RailsConf 2008 started and it certainly stands a great chance of being dubbed an exhilarating event. A few people enquired to see if they could meet me there, but unfortunately I couldn’t make it. Chances are that you’re reading this post from RailsConf. If that’s the case, say hi for me and don’t forget to visit the nice fellas from Engine Yard, Morph (my sponsor), Phusion and GemStone. Oh and also, feel free to pass around the url of this entry. ;)

Rails 2.1 RC1 is out, so you’ll find this article on upgrading to Rails 2.1.0_RC1 useful. Fabio Akita released a new version of his popular tutorials, Rolling with Rails 2.1 (part 1 and part 2). And if you are looking for an advanced authentication/authorization system for Rails 2, take a gander at Lockdown on RubyForge.

My friends at SeeSaw implemented a series of Rails Widgets which can easily be installed as a Rails plugin. Feel free to use them and/or contribute, in order to add further support for simplifying and reusing common UI elements. Speaking of shiny things, check out this Ruby on Rails icon pack; very pleasing to the eye, in my opinion.

RubyInside published a list of 28 mod_rails / Passenger Resources To Help You Deploy Rails Applications Faster. As DHH forecasted, “this could definitely become very popular, very fast ;) ”.

New Relic released their RPM solution for monitoring and improving the performances of Rails applications to the general public. You can get it here.

And finally, some great news just came in, IronRuby is running unmodified Rails. “Excellent” (said in Montgomery Burns’ voice, complete with characteristic hand gesture).


This Week in Ruby (April 7, 2008)

The first edition of This Week in Ruby received a warm welcome from the community. A week later, here we are with a second installment of the series. I’ll attempt to repeat these posts approximately every week, so feel free to follow along by subscribing to my feed.

The Ruby community is a tremendously active one. In only seven days, there have been so many noteworthy items popping up, that it would take me hours just to mention them all. I’ll try to pretend that you, the reader, have been on a week-long vacation in a remote place without internet access, and on your return you asked me, “Hey, Antonio what happened in Ruby and Rails land while I was away?”

Some fun on April Fools’ Day

We kicked off the week on a lighthearted note, by fully embracing the endless opportunities offered by April Fools’ Day. Most of the spoofs and jokes were aimed at making fun of Ruby on Rails, one way or another. Testimony to the self-irony that we, as a community, certainly have. I personally announced the soon-to-arrive release of a fictitious (of course) framework called Ruby on Crack. Which was supposedly much faster and productive than Rails. At the heart of the joke were the fake endorsements, chocked full of double-meanings (with apologies to Matz, David Heinemeier Hansson, Dave Thomas, Ezra Zygmuntowicz, Obie Fernandez, Zed Shaw, Tim O’Reilly, Guido van Rossum and Paul Graham). I found the SQL on Rails April Fools’ gag very funny and extremely elaborate. Their screencast is comedic genius and their site a spoof in every minute detail. In my book, on that day, they took the cake. The joke itself was from two years ago (as pointed out by a commenter below) but it resurfaced again this year. The hilarious trend continued with Cobol on Cogs and for the ASP.NET and PHP nostalgic, with Acts as ASP.NET and RHAP (Ruby Ain’t Hypertext Preprocessor). Avdi Grimm even found the final solution to the whole Monkey-patching diatribe: Ninja-Patching, “When you really want to catch a coder by surprise, a monkey doesn’t cut it. What you need is a Ninja.”. :)

mod_rails

Last week I mentioned Passenger (aka mod_rails). This week Hongli Lai published some interesting benchmarks that compared it against Mongrel and Thin for three Rails applications (Typo, Petstore and El Dorado). While still synthetic benchmarks, the results where very encouraging and showed how Passenger was on average faster than Mongrel and roughly on par with Thin. Even just the perspective of having performances that are somewhat comparable with those of Mongrel, would be great news, given that it’d highly simplify the deployment process of Rails applications with Apache. Ninh Bui has announced that the official release date for the project is expected sometime this week and that meanwhile they are working with companies like Twitter and Dreamhost to ensure that the module is fully tested. Speed is only one of the project’s aims in fact, with a lot of focus put on stability and robustness, too. They also caught the attention of Engine Yard who is interested in discussing a possible partnership and contributions to the Rubinius project.

Git

By now you should be aware that the Rails community is fully embracing Git, and github.com is only part of the reason. Michael Bleigh has even created a small library called ruby-github to simplify access to the GitHub API. David has announced that Rails is moving to Git and the ticket tracking system is being switched over to Lighthouse. As David pointed out, this means that both the tracking system and version control are to be run by Rails applications, which is a good bonus if you subscribe to the philosophy of “eating your own dog food”. For those who are still git-challenged, Kurt Schrader has a collection of helpful links to get you started. And if you need a simple issue tracker for git, version 0.1.2 of Ditz has just been released, too.

Conferences

Confreaks has now published the remaining videos from MountainWest RubyConf 2008. They’re very interesting and highly recommended. All of them.

In case you missed the Ruby Fools conference, held on April 1st and 2nd in Copenhagen, you can read an interesting personal account by 41Concepts. The conference also took place on April 3rd and 4th in Oslo.

Speaking of conferences, Sam Ruby will be presenting on Ruby 1.9 at this year’s OSCON. In a recent short post, he mentioned his plans for his talk and really nailed one of the problems that will hinder Ruby 1.9′s adoption, in his own words:

My tentative conclusion at this point based on observations of efforts to get products like Rails working on Ruby 1.9: the biggest obstacle to Ruby 1.9’s adoption is the sheer number of mostly working but essentially unmaintained gems that virtually everybody in the Ruby community depends on. — Sam Ruby

Rails

Amazon has an article on Using SimpleDB and Rails in No Time with ActiveResource. Another interesting article which surfaced this week was a post called simple pages for easily creating “boiler-plate” pages in Rails.

Three interesting plugins where released. You can read about them in Introducing Action Messager: Dead simple IM notifications for your app!, Better Partials Plugin for Rails and A Rails 2.0 Message Forum Plugin.

The Rails Jedi posted about two Mac OS X applications for accessing Rails docs in the most efficient way possible. Nookkit.app and RailsBrain are real timesavers, and I highly recommend them to Mac users.

SapphireSteel has announced the Public Beta of their Visual Rails Workbench. With the release of Ruby in Steel 1.2 Beta 3, they have in fact included their drag-and-drop visual environment for Rails. I didn’t have a chance to try it out, but if you are on Windows you may want to give it a shot, starting with reading their online articles.

The ink for printing Ruby and Rails books never runs dry, as I pointed out in my post 7 soon to be released Ruby and Rails books. It turns out that in the months of April and May alone, there will be 8 new Ruby/Rails titles. Check them out, especially if you are looking for updated material relating to Rails 2 or, in the case of the pickaxe 3, to Ruby 1.9.

The guys from Rails Envy, published episode 25 of their Rails podcast. If you are not familiar with their fun podcast, I recommend that you listen to a few episodes by subscribing to it through iTunes.

Ruby

There were countless interesting Ruby articles in the last week, but I’d like to point out the following:

Ruby VMs

In Rubinius for the Layman, Part 1: Rubies All the Way Down, Mathieu Martin has a nice, gentle introduction to Rubinius with some reveling benchmarks too. For those interested in learning more about the current status of Rubinius, InfoQ has a short article with a few pointers.

More remarkably, in the land of alternative Ruby VMs, Jruby 1.1 has finally been released, after months of hard work. The authors are already thinking about what lies ahead for the project. If the subject interests you, feel free to grab a few slides from various presentations on the topic.


RailsConf, Arc, Apple and other Zenbits

Zenbits are posts which include a variety of interesting subjects that I’d like to talk about briefly, without writing a post for each of them.



Ruby and Rails Videos

Blip.TV is now hosting the videos of RailsConf 2007. The audio and video quality is very good even though no slides are shown (but you can always google them). While on the subject, you can also watch the videos for RubyConf 2007 (including slides), Mountain West Ruby Conference, Ruby Hoedown last August, and the fourth edition of RejectConf. If you are in the mood for video learning, also check out Railscasts, RubyPlus, and Rails Envy.



RailsConf ’08

David has announced that the registration for RailsConf ’08 is now open. The conference will be in Portland, Oregon from May 26th till June 1st. It’s going to sell out very quickly, so book your spot while they last. I’m almost sure I won’t be able to participate since I’m still dealing with the process of getting my Canadian permanent residency (but we are finally getting really close, and then I’ll be able to travel freely).



Qtrax is a disaster

I’ve been following the (mis)adventures of Qtrax closely. It’s a disaster, the perfect example of how not to launch a product even if they had amazing PR skills and where able to get coverage in the MSM worldwide. The premise was good: share the ad revenue with the artist, and allow users to get music for free. Something that SpiralFrog has been doing for a while. The problem is that SpiralFrog’s catalog is rather limited as far as mainstream music goes. Qtrax claimed to have an agreement with the four major recording labels and a catalog of more than 25 million songs. That was what set them apart and what made the announcement attention worthy. The reality was much harsher. They didn’t have any agreement in place (they essentially lied), they didn’t make the download available when they declared it would be, and the site was unreachable or intermittent all the time. Not only this, but their software is nothing more than a skin on top of Songbird. Downloading songs is basically impossible and the software is unusable at this stage. Don’t even bother getting it. It’s a festival of connection timeouts, 404s and “welcome to Oracle Application Server 10g” messages. A real shame.



Arc: too little, too late?

Paul Graham has finally announced the release of Arc. Graham and Morris have made a forum, a tutorial and installation instructions available on their official ArcLanguage.org site. While Paul clearly states that Arc is still incomplete and requires a lot of refinement, at least it’s out and people can start using it (Paul’s Hacker News has already been adopting it for a while). It’s not vaporware anymore, it’s here. However, amongst the enthusiasm that met this release from curious and early adopters, there are also a great number of people disappointed by Arc’s first (pre)alpha. Keep in mind that many people talked about Arc for several years and had great expectations, perhaps even something close to the mythical hundred year language. What they found is that Arc is currently a skin on top of MzScheme (but not the latest version) that adopts a more concise syntax compared to Scheme or Common Lisp. There isn’t anything too revolutionary, it doesn’t support packages or modules, or Unicode. It uses tables for HTML libraries, and so on and so forth. Paul Graham has a strong influence on the community and I’ve no doubt that many people will put time and effort into learning Arc and will in turn improve it. Heck, even I’m going to give it a shot for fun. However right now it’s not really convincing as an alternative to CL or Scheme itself. Don’t construe this as a harsh criticism towards Arc, it is not. We are talking about a language that it’s in its infancy and that as I said, I plan to experiment with myself. I hope to see it grow rapidly and I congratulate Graham and his team for finally making it available. That said, right now I think it’s a weak release and therefore, in my opinion, the disappointment of many is justified. In any case, good luck Paul, we’ll watch this one closely.



Share your DB2 success stories

ChannelDB2 is looking for DB2 success stories. If you appreciated that great piece of software that is DB2, please share your experience here. If your story gets published, you will receive one of the tokens available in the loot bag: DB2 “paraphernalia”, books, Amazon.com certificates, and so on. If you have a company or a startup, it’s also a good way to get your name out there.



Apple’s quote for $1348.09

A while ago (a couple of months, perhaps) my MacBook Pro was accidentally dropped. It was an accident due to there being far too many cables in my room. It upset me of course, but it’s not the end of the world. It could happen to anyone. Thank Science, the screen is intact and the computer works perfectly. I was lucky. There are a couple of things that bug me though. Aside from a tiny dent in a corner of the top case, when closed down on the base the lid has a slightly wider gap on the left side, than it does on the right side. Also, the the latch on the bottom case must be somewhat damaged because when touched even minimally the lid pops open. These things in no way affect my usage of the laptop, and that’s part of the reason why I didn’t even bother trying to fix it for a long time.

Then a few days ago, for unrelated reasons, I began to question my choice of getting a Mac instead of just buying a top of the line Lenovo T series to be run with Ubuntu. I love Ubuntu and it’s becoming increasingly better with each release. With the exception of Textmate, I started to think that Ubuntu (that I currently use a lot) could easily replace Mac OS X for me. Also, the ergonomic qualities of Lenovo’s notebooks is so nice and as an IBM employee I get a decent discount on them. Okay, perhaps I made a mistake when I reached my purchase decision 7 months ago. I’d never owned a Mac before and I really wanted to. Truth be told, I think that Mac OS X is a very polished operating system and I can’t emphasize my appreciation for it enough. It’s eye-candy on top of Unix. But there are other factors to be considered, especially as a developer, and I feel that Ubuntu could have been just as good as my end choice.

Not only that, but I must also say that my old T42p was a much more comfortable laptop, despite costing half the price. Anyways, it came to my mind that I could either run Ubuntu as my main operating system on the MacBook Pro, or fix the cosmetic issues on the laptop and sell it to buy a nice Lenovo T61p. Cosmetic issues can usually be ignored or easily fixed, but on the second hand market they often impede the possibility of selling it for a good price.

Just out of curiosity I decided to call Apple and ask how much it would cost to get it fixed. The laptop is still under warranty (only 7 months old), but I caused the damage, so I pay, no issues there. The agent on the phone understood the problem very well and quoted me about $200. I specifically asked him if the lid could be replaced independently from the screen (which is in perfect shape) and he confirmed this. So Apple booked an appointment at the Genius Bar at an Apple Store downtown Toronto. I went there on Saturday, by public transportation it took me almost two hours each way. The “genius” confirmed that the latch on the base is somewhat broken and that the upper lid may or may not be slightly warped (hard to tell with the latch issue in place). After a long wait he came back with a quote… $1,348.09. I kid you not. It turns out that the lid is sold as one piece with the screen and the whole display assembly can be replaced for $809. The guy at the genius bar agreed that it’s probably only the base that needs to be replaced. But it’s still $214 dollars for the part, $170 for labour plus taxes. A whopping $437 for a little latch that is not behaving. I wasn’t too happy with being quoted $1350 given the price of the laptop and the fact that I was previously quoted an all-inclusive $200 on the phone. I wasted 4 hours of my Saturday. I’m not repairing an Aston-Martin here for Darwin’s sake.

If you drop an Apple laptop and you break the screen (not my case) you may as well just get a new laptop because it’s going to be cheaper. This is sort of true for any laptop, but I feel that just like Apple makes you pay a premium to get their hardware, they still charge you plenty for any minimal repair. To change the lid they wanted to replace the whole screen. To change a broken latch, they needed to replace the entire base. And $170 plus tax for carrying out the repair!? I’m aware of sites that sell parts and instructions on how to perform the replacement myself and may consider it in the future (changing only the base assembly). For now I’m fine, given that the latch issue doesn’t cause too many problems for me. I must say though that my experience at the yuppie Apple Store made me even more convinced that my choice of getting a Mac in the first place may have been the wrong one. I wonder how long it will take before I’ll follow Mark and Cory and switch back to Ubuntu full-time. The thought both excites and saddens me. Time will tell.


How to install Django with MySQL on Mac OS X

Installing Django on Mac OS X Leopard is supposed to be very straightforward, but if you are new to it, you may encounter a few puzzling questions and, in the case of MySQL, even a couple of headaches. I’m writing about this for the benefit of those of you who may attempt and struggle with this feat. MacPorts is not required for this how-to.

First and foremost, we are going to install Django from its svn repository, as opposed to obtaining the 0.96 release archive. The reason for this is that the trunk version implements a few new features. The development code is also rather stable and used by most people in production mode, even for sites like the Washington Post.

Checkout Django

svn co http://code.djangoproject.com/svn/django/trunk django_trunk

Tell Python where Django is

Mac OS X 10.5 already ships with Python 2.5.1, thus you won’t have to install it. You can verify this by running python in the Terminal (use exit() to get out of the python shell). What you need to do is inform Python about the location of your django_trunk directory. To do this create the following file:

/Library/Python/2.5/site-packages/django.pth

Within this file, place only one line containing the path to your django_trunk folder. In my case, this is:

/Users/Antonio/Code/django_trunk

Of course, change it to the full path location of the directory on your filesystem.

Add django-admin.py to your PATH

The bin directory within the django folder (which is inside django_trunk itself) contains several management utilities. We need therefore to add the following to the PATH (again, change it to your own location):

/Users/Antonio/Code/django_trunk/django/bin

How you go about doing this, depends on the shell you are using, and I’m assuming you are able to export a shell variable on your own. In case you are using the bash shell (as I do) then you should have a .profile file in your home directory. Alternatively, you could just create a symlink to the utility django-admin.py in /usr/bin, but I recommend the former approach.

Grab and install MySQL

I would normally recommend PostgreSQL, at least until we have DB2 on Mac, but I realize that many of you use and prefer MySQL, which also seems to be the only one that requires special instructions due to a few installation issues when trying to get MySQL and Python to work together. You can install MySQL by grabbing and running one of the packages that are available on the official site. Choose the one for x86 and Mac OS X 10.4.

Install the MySQLdb driver

Get MySQL-python-1.2.2.tar.gz from SourceForge. Please follow these exact instructions because the source code won’t compile out of the box and will give you the following error when trying to build it:

/usr/include/sys/types.h:92: error: duplicate 'unsigned'
/usr/include/sys/types.h:92: error: two or more data types
in declaration specifiers
error: Setup script exited with error: command 'gcc' failed

Run the following:

tar xvfz MySQL-python-1.2.2.tar.gz
cd MySQL-python-1.2.2

At this point, edit the _mysql.c file and comment out lines 37, 38 and 39 as follows:

//#ifndef uint
//#define uint unsigned int
//#endif

Now, from the MySQL-python-1.2.2 folder run:

python setup.py build
sudo python setup.py install

If you still get an error (and only in that case) you’ll need to edit the site.cfg file within the same folder and set threadsafe = False, before running the two commands above once again.
If instead, you don’t receive an error but you see warnings about files not required on this architecture, don’t be concerned about them. The last step required is to create a symbolic link with the following command:

sudo ln -s /usr/local/mysql/lib/ /usr/local/mysql/lib/mysql

All these adjustments are required because we are building and installing the driver on Mac and not on Linux.

Verify the installation

You should be all set now, but let’s verify this right away. Open Terminal and run the following commands in the python shell (start this with the python command).

Verify that MySQLdb is correctly installed:

>>> import MySQLdb
>>> MySQLdb.apilevel
'2.0'

Now, verify that Django is working:

>>> import django
>>> print django.VERSION
(0, 97, 'pre')

By running exit() get out of the python shell, and verify that django-admin.py is in your path:

django-admin.py
Type 'django-admin.py help' for usage.

If you obtain a similar output for all three of them, you are really set to write the next YouTube.

Where to go from here

Now that Django is installed, you can go read the Django Book 1.0 that’s available for free online. Something equally well done and useful is really missing from the Rails community. Above all, experiment, Django (and programming in general) is learnt by doing. The Definitive Guide to Django: Web Development Done Right is also available for purchase in its deadtree version, which just came out. It’s cheap and it’s already a best seller on Amazon. Despite the availably of a free version online, I like having paper versions of tech books so that I can read without staring at the monitor. Furthermore, I feel like rewarding the authors (who are also the framework creators), while encouraging publishing companies that are willing to allow authors to make their books available for free on the web. Well done guys!


TextMate is the king of Rails editors

Tim Bray has published the results of his nice survey about Ruby and Rails editors. In Bray’s piece we see that TextMate is the tool of choice for the Rails focused group, while Vi leads the way in terms of the Ruby one (albeit TextMate is very close):
 

Rails tools 

Ruby tools 

One thing is clear, TextMate IS the editor of choice when it comes to the Ruby and Rails communities, and since it runs only on Mac, it is also obvious that Mac is the platform of choice too (this shouldn’t come as a surprise when you look at the sea of MacBook Pros at RailsConf). If we don’t consider the large group of people who use both Ruby and Rails, we could speculate that the Ruby community is more hackerish than the Rails one. While I believe this to be the case, I think that Vi coming out ahead of TextMate for Ruby, but not even close by a long shot for Rails, has more to do with the many useful features implemented by TextMate and the limited number of extra ones provided by Vi, when developing for the web with Rails.


DB2 on Mac

Python and DB2

We now have a working Python driver for DB2 which is currently undergoing internal testing. The driver is similar to the Ruby and PHP ones, which means that you get an advanced and very easy to use API. It also means that if you are confident with the Ruby driver, you will be able to use the Python one in no time.

Ruby:

require 'ibm_db'

conn = IBM_DB::connect(database, user, password)

if conn
  puts "Connection succeded."
  IBM_DB::close(conn)
else
  puts "Connection failed."
  puts IBM_DB::conn_errormsg
end



Python:

import ibm_db

conn = ibm_db.connect(database, user, password)

if conn:
    print "Connection succeeded."
    ibm_db.close(conn)
else:
    print "Connection failed."
    print ibm_db.conn_errormsg


We made it so that if you know one, you already know the other. These drivers are CLI wrappers that provide you with performance and stability. Also they don’t limit you to user data and are able to retrieve a good deal of metadata about your database. We’ll also provide a thin wrapper for those of you who intend to use a PEP 249 API. The next step, working on SQLAlchemy, has already started.

DB2 on Mac (no, really!)

macpro.pngWhen I first posted about our interest in Python/Django and DB2, the comment thread got hijacked by many people who asked for a Mac client in order to develop on Mac and deploy on Linux. Ask and you shall receive. I’ve promoted the idea of Django/SQLAlchemy/Python in IBM for a while now, and we are finally close to delivering the driver (with the adapter progressing at the same time too). Well, don’t take this as an official announcement, but Python wasn’t the only thing that I’ve been promoting for months within IBM. With the ever growing community of Ruby/Python hackers adopting Mac as their development platform of choice, I strongly believe that an investment in porting the great free version of DB2 to Mac is a very valid one.

I couldn’t talk about this for weeks, and it must be viewed as a rumor until IBM makes an official announcement, but we have been working on porting DB2 to Intel Mac. Not just the client, the whole package. This makes me a happy panda, no longer will a virtual machine be required to develop with DB2 on Rails on my Mac Book Pro. It’s a joy to see DB2 Express-C run on a Mac Pro (shown in picture) next to the other black boxes in the lab. Work is still in progress, but we should have a beta out there relatively soon (before winter kicks in). DB2 Express-C on Mac is intended for development purposes rather than production, this means that we expect you to develop on your shiny Mac but deploy on Linux or Windows. DB2 on Mac will be a beta product, but again it won’t just be a client runtime, it will be the full product and there is no reason why it shouldn’t be just as stable and efficient as the Linux and Windows versions.

Time to employee some of the newly acquired Cocoa-fu. I’m starting to feel that I could even learn Wasabi and IBM would still be able to let me use that skill in my day job. Awesome.


A preliminary review of three Cocoa and Objective-C related books

As announced before, I got interested in Mac development, bought a bunch of books and spent a few nights reading and coding. Here are my first impressions on those books which thus far I’ve picked up.

I only had time to read 3 chapters from Stephen Kochan’s book and I must say that I’m not impressed! The pace is extremely slow and experienced programmers who read it will be bored to tears. An example of this, is the fact that he spends 15 pages on teaching how to use if/else statements. I’m afraid it’s not working for me; by nature it’s far too basic, and slow paced books are irritating. I don’t blame the author, I’m just not the right target for such a book – and I find the title to be inappropriate, or rather, inaccurate. It should be renamed ‘Learn to Program with Objective-C’ or ‘Introduction to Objective-C’ not ‘Programming in Objective-C’. Readers who don’t know how to program in C or any other programming language, will find this book to be a very good explanation and thorough introduction to programming though. The book “Learn Objective-C on the Macintosh” is basic too, but it’s often recommended as an alternative to Kochan’s book. According to what I’ve seen from the sample chapter, this is still a very gentle introduction to the language, but it carries more insight and it’s not a boring read. Plus one of the authors is Mark Dalrymple who is very active in the online community as well.

Hillegass’ book is a whole different story. He is clearly a great teacher and, while I’ve read only half of this book so far, I can already conclude that this book rocks. Most of what I’m learning is coming straight from this book. Cocoa is not that easy but I feel that this tutorial sufficiently covers the subject matter at hand in-depth and gives a good deal of clarity to the fundamental concepts of this topic. I won’t be an expert by the time I’ve finished this book, no (this is never the case with any one book), though I will have a far better grasp of Cocoa. I’d say that at this time, it’s most likely the best book I could be reading on the subject. I highly recommend it to those of you out there who’d like to follow similar steps (if you buy only one book to get started with Cocoa, this is definitely the one I’d go for).

I read three chapters from Advanced Mac OS X Programmingso far, and I’m really glad I bought this book. If Cocoa Programming for Mac OS X (2nd Edition) is the the best tutorial to learn the basics and get started with, this advanced book appears to be what I’m really aiming for eventually and there is no doubt in my mind that it’s going to become my reference of choice along with the official Apple documentation. It covers difficult topics in detail and gives you insights that I’ve not found elsewhere on the Web. If I’m aiming to get serious about Mac development, I have to study this tome as best I can. I’m holding off on reading it for the moment, as I believe this book is the perfect continuation of the one I’m currently reading. From the chapters that I’ve read up until now, I’m wowed by this book. Mac OS X is a Unix OS, and this book covers that aspect by not leaving many details out. So far it looks like the perfect match up between theory (you will get a lot of college flashbacks when they talk about multi-threading and networking) and practice (the chapters on Memory management and Subversion are worth the price alone). Mark Dalrymple and Aaron Hillegass nail it again with a must-have book for serious developers.

Not bad, I bought three books and it turns out that two of them are great. I’m tempted to return the Objective-C one, but ultimately I don’t think that I’ll end up doing so.

I’ll suggest a fourth book, in case you are approaching Objective-C without any knowledge of C (but with at least some knowledge of other programming languages). I’m using it myself to brush up my C skills, which are certainly there, but in need of a quick refresher course.

Objective-C (aka ObjC) is a superset of ANSI C in fact. As such, any C program is also a valid Objective-C program. It provides you with a relatively easy and straightforward way of doing Object Oriented programming, while simplifying memory management. From what I’ve seen though, unless you are willing to become well versed in C, you won’t become an overly advanced Objective-C developer. Knowing C already (albeit I’m not a Guru), I must say that Objective-C is very easy and can be picked up in a matter of days. The real power and learning curve comes from the Cocoa framework itself, and that’s where I’m going to focus my efforts.


Cocoa is my Cup of Tea

Writing the article “Desktop Applications are not dead!” was an interesting experience that led to vivid discussions about the business of software for desktop applications, including the current limits and options available in this field. In the last comment by Eugueny Kontsevoy (the person I was responding to with my article in the first place), he expressed once again his frustration regarding Windows development:

“Seriously: I am an engineer for the sake of it: I love what I do and spending 20% of my time planning the deployment and dealing with failing Microsoft OS components is NOT something I want to do anymore. Period.” — Eugueny Kontsevoy

Before you dismiss his comment as an over exaggeration or peg him as having too picky an attitude, I would suggest thinking twice. The guy has a point, and if you’ve done Windows desktop application development before, you know this is often the case. My article proposed possible (partial) solutions for making Windows a more enjoyable and viable deployment platform for software startups. Of course, the easy way out is to leave the desktop market and move exclusively to the Web application arena. Hey, that’s what everyone else is doing, that’s the future, it’s buzz compliant, etc… But I want to take my own advice, and put my money where my mouth is.

Taking the red pill

I felt more at ease with my Mac after 5 weeks of using it, than I had with Windows after a dozen years. We feel like old friends, like Hemingway’s old man and the sea. I absolutely love Mac. I love its culture, the quest and appreciation for beauty. Quality over quantity, simplicity over complexity, beautiful design over crowded ugly interfaces. Mac is productive; Mac is zen-like, inspiring, and enlightening. Mac makes me happy to be a computer geek, and in my mind, Mac OS X is simply the best operating system available today.

I’m taking the red pill: I’ve decided to get serious about developing applications for Mac OS X. I can’t refrain from programming with this beauty.

Oh boy, where do I start?

I’m writing this as a quick guide for whoever decides to follow a similar path as mine. Consider that I’m just starting out, so I don’t know anything beyond what I’ve researched from reading other peoples’ opinions. I think it’s a sensible plan though. There is a wealth of good information on Apple’s site and many guides all over the web. Here is a list of resources that I am using or which I plan to use. They refer to Objective-C and Cocoa, which are respectively the favored language and framework for developing Mac applications.

First Step: Let’s get excited

  • Let’s get motivated with these slides from one of the most successful Mac developers out there and his associated podcast (whose genre is ‘religious’, according to iTunes, hahaha);
  • Beginning Mac Development: A good guide on how to get started by MacZealots.com;
  • Subscribe to CocoaRadio, an awesome podcast including interviews with the most popular and successful Mac developers around.

Second Step: Let’s read some documents

Third Step: Let’s get serious, with some books

I actually ordered the three books below yesterday night. The second one is already here, while the other two should arrive soon enough. All three of them have stellar reviews.

  • This should teach the language in depth and serve as a decent reference to have on hand.
  • This is, I believe, *the* crucial book. I plan to read this cover to cover and work through it.
  • This book should provide some advanced techniques.

Fourth Step: Join the discussion

  • Join the irc.freenode.net channels #macdev and #macsb, respectively about Mac development and the business side of Mac programming;
  • Subscribe to the Cocoa-Dev and the MacSB mailing lists.

Fifth Step: Keep Reading

Apple Developer Connection (ADC) has a huge amount of information about developing applications and guidelines for delivering high quality products. Bookmark http://developer.apple.com/ and come back to it often. I know I will.

What about Ruby and Python?

RubyCocoa is a nice bridge that allows you to develop in Ruby and Cocoa. Yes, I’m super interested in this project, but I want to learn first the traditional way of using Objective-C and only then consider when and if Ruby and Python can be beneficial for my Mac development needs.

And what about DB2?

Do I miss DB2 when I am on my Mac? Hell yes. DB2 Express-C is just plain awesome and it’s the only software that I really miss on my Mac. It runs fine in a virtual machine, but wouldn’t it be great to see it run natively in Mac OS X? Well, this won’t happen tomorrow, but I’ll tell you something… sooner or later, we’ll get there!

I already know that the biggest challenge is going to be finding the time to study all this stuff, and above all, finding time to code (the only way to really learn). But it’s going to be awesome. What are your thoughts about this strategy for learning Mac development? I especially welcome comments from experienced Mac developers and people who, like me, have decided to give Cocoa a serious go.


Desktop Applications are not dead!

In his article, ”Desktop Applications are Dead”, Eugueny Kontsevoy – a Windows developer – argues sarcastically about the demise of Desktop applications. His article has real merit though and focuses almost exclusively on the problems which are introduced by Vista’s aggressive security policies. The annoying aspect of Windows Vista’s “cancel or allow” is undeniable, especially if seen through the eyes of an Independent Software Vendor (ISV, or in the case of a one man show, a Micro-ISV) who needs to convince the customer to download his program and install it in order to try it before buying. Every customer who gives up on installing your program is a possible lost sale. In a world where Windows users are already afraid to compromise their operating systems, the ability to make a sale needs to be preserved and defended; any extra barrier is harmful for multitudes of software vendors. Here Kontsevoy is damn right about this factor.

From DLL Hell to .NET Framework Hell

Eugueny even has a point in regards to applications which are developed with the .NET Framework. It is a necessary requirement of C#, VB.NET and managed VC++ .NET apps that you install the .NET Framework. You can’t just pick an arbitrary framework version either, depending on what language and framework features you employ, you may be targeting .NET 1.0, 1.1, 2.0, 3.0 or the currently in beta, .NET 3.5. Windows Vista ships with the redistributable version of .NET 3.0, therefore it is safe to assume that a developer will be able to run their applications on Vista if they target .NET 3.0 (Visual Studio .NET 2008 Beta2 allows you to define a target for you project, from 2.0, 3.0 and 3.5). .NET 3.0 incorporates Windows Presentation Foundation and with some design skills and the most colorful .NET book around (Windows Presentation Foundation Unleashed- easily the most eye pleasing book I own) you should be able to create attractive User Interfaces and be happy, right? Not exactly. I don’t have any hard numbers, but I would guess that the majority of users are still running Windows XP. The SP2 of Windows XP has an optional .NET 2.0 framework installation (not 3.0 though) so you’d be out of luck even if the user did install the optional component. From a business perspective you have to remove any possible barriers between your product and the customer. You absolutely need to maximize the number of people who successfully try your program in the hopes that they’ll love it enough to shell out their hard earned cash and actually purchase a copy of your product.

It would make sense then to target the .NET 1.1 Framework, as it is the most widespread version, plus applications written for 1.1 will work on .NET 2.0, 3.0 and all subsequent versions. But programming for 1.1 means not using any of the cool features that Microsoft introduced in C# 2.0, it means using Windows Forms 1.1 and being stuck with a rather primitive version of VS.NET (2003). It also means that you won’t be able to take advantage of many commercial and free third party components whose minimum requirement is Microsoft .NET 2.0. C# 3.0 and LINQ (both available only in .NET 3.5 require .NET 2.0) make for great blog posts and can raise a hell of a buzz, but they won’t help you too much when it comes to maximizing your profits – at least in the commercial/shareware sector at this time. This cycle will be repeated when newer version of .NET come out and new innovations (be they copied or original) are introduced by Microsoft. Vico was definitely right, history does repeat itself. There are attempts like ClickOnce deployment to solve these problems, but they raise other issues, and as far as I can see it, there is no definitive solution right now.

.NET is not the only option

Microsoft produces the most popular operating system in the World. It is natural then for developers to embrace the development solutions proposed by the maker of the OS that they are going to develop for. The marketing division of Microsoft is particularly good at attracting millions of developers, especially if we consider that they can afford to produce highly productive and decently innovative tools which are available for free or at fairly reasonable price tags. We all laughed when Ballmer shouted, “Developers, developers, developers…”, but when you think of Windows development nowadays, you are inevitably thinking about .NET. However, whether you view this as a pro or a con, ultimately it doesn’t need to be the only case.

If .NET imposes too many constraints on Independent Software Vendors, then we must not forget that .NET is not the only available option. It’s a personal choice, each company or developer can decide which way to go, but it is important to raise awareness about the potential alternatives. Sure, Microsoft produces Windows and should know better (in theory). Sure, they have a market cap of $271.65 Billion versus the few hundred million or less that most of their competitors reel in, but in the end, if .NET clashes with your business model, you have to consider looking over at the other side of the fence in order to find alternatives that fit you better. Let me make this clear, I’m not dismissing .NET for Desktop applications, I know full well that there are companies out there making millions in this market, while still using .NET.

A few potential alternatives to .NET

If you are aiming to develop commercial applications for Windows, be it the next Adobe Photoshop or a $15 utility, Microsoft .NET’s mainstream presence may give you an advantage. How so, you may ask. We’ve already exposed possible issues with .NET and this portion of the business of software, but the main problem in the end, is an inconvenient runtime which weighs you down as the right version of the framework has to be installed somehow before your application is able to work. A winning alternative would have to provide you with a stable environment which is affordable, as productive as its Microsoft counterpart, has a decently sized community and so on. But its main selling point would have to be that it needs to produce native Win32 executables. Doing so will be the secret advantage that an ISV holds over the majority of their competitors who use .NET. When you ship a really fast application in a single non-bloated .EXE file, you are embracing a meaningful percentage of the Windows market. The application will run on older versions of Windows, from Windows 95 up to Windows Vista, it will most likely feel more responsive and the lack of an extra layer which needs to be installed is going to enable it to be easier to install on your customer’s PC. The aim of maximizing your customer base will have been achieved from a technical standpoint.

Delphi

Wait a second, didn’t Delphi die out many years ago? Not quite. What do the following applications have in common? Skype, MySQL Administrator, SQL Backup, Macromedia Captivate, Inno Setup, Borland Developer Studio itself, TOAD, Beyond Compare, Macromedia HomeSite, etc… You bet, they’re all written in Delphi. Delphi (the IDE) and Object Pascal (the language) have always been much more popular in Europe than in the States, but despite this, what almost killed Delphi was its management. Borland made a few crucial mistakes that cost Delphi a lot in terms of its popularity. It’s a typical scenario really, were a technically superior product (think of Betamax vs VHS, etc…) ended up being much less successful than a better marketed, but less valid alternative (e.g. VB6). The press has long spread word of Delphi’s imminent (or present, depending on where you’re sourcing your info from) death for almost a decade now, but Delphi is still alive and kicking. Sure, since .NET came along market percentage that Delphi covers has dwindled, but Delphi may be the right answer for the sorts of development needs outlined above.

If you speak to the majority of Delphi developers, you will notice that they are passionate and very convinced about the product they use. They may be a small group at this point, but it’s a good, endearing community. The other positive news is that Borland has separated their Developer Tool Group into a company called Code Gear. This company makes up 25% of Borland’s total income and they’re 100% focused on the promotion and improvement of Delphi and their other development tools. Delphi’s Product Manager, Nick Hodges, is very active in promoting the product and responding to people online. The buzz is slowly growing, and Delphi’s future is looking far more positive now than it has for quite some time. Code Gear may be the best thing to happen to Delphi in ages.

Code Gear Delphi 2007 for Win32 is a development solution for ISVs that doesn’t fall short of Microsoft .NET. The professional version sells for less than $900 (US). There are also two other editions that you can use for commercial products: Turbo Delphi Explorer (entirely free) and Turbo Delphi (for Win32) Pro which costs less than half the price of Code Gear Delphi 2007 Professional. The free version is mostly limited by the fact that you can’t add third party components, and Delphi’s market is full of these kinds of high quality components. I really think that for ISVs it is worth investing in the Delphi 2007 Pro version. Code Gear produces a version of Delphi which targets .NET as well, and while this may be good for interoperability (Borland Development Studio 2006 even includes C# Builder), I believe that Code Gear should really focus on Delphi for Win32 as that is the crucial element which distinguishes it the most from Microsoft’s offering. They should also work on support for Win64, Cross Platform development, and Unicode. All of these things are lined up and they’ll take care of them in future releases, but I’d say that even having to spend time developing further ASP.NET support in Delphi is somewhat wasteful. The idea of writing code once and then being able to compile it for both Win32 and .NET is nice, however most software developers who decide to go for .NET, would rather go directly with Microsoft rather than use Delphi. So instead just opt to do one thing, but do it right.

Within the market we defined above, Delphi 2007 for Win32 offers up speed which is comparable to C++, but with an ease of programming similar to that of Basic. And yes, the executables are “Vista enabled”. My number one choice, if you’re not adopting .NET, is to go with Delphi. If you decide to do so, you can start by watching introductory videos here. And if you’re skeptical about Delphi’s future, consider the open source Lazarus project which can produce Win64 executables and cross platform executables through Free Pascal. It’s not as polished as Delphi, so for Windows Delphi is definitely the way to go. Yet you could always port your projects to Lazarus in order to target Mac OS X and Linux when required. This also guarantees that your code won’t go to waste, should Delphi disappear in the future (very unlikely).

Unmanaged C++

C++ with MCF or WCL or whatever toolkit you prefer is an option as well. You can even use Visual Studio .NET 2005 for this. So what’s to question about C++, you may ask. Well, C++ is not for the faint of heart and I think that it is a few time slower to develop with than Delphi. But you get the same benefit of native programs and there is nothing wrong with this option – if you know what you’re doing.

Cross platform solutions

Beside Delphi and VC++ there are a few cross platform options available. The bad news is that none of them is as productive or polished as Visual Studio and Delphi are. Furthermore, cross platform applications have a tendency to look good but “not quite right”. Possible options in this category are Real Basic, Trolltech QT, wxPython and even Java. Keep in mind that Java has two big issues. It doesn’t really solve the problem of runtime (though it makes it much more manageable), and while UIs can look good, they are usually clearly not native in any operating system.

An important cross platform solution for both Windows and Mac, is the uber-popular pairing of Flex and Adobe Air. Again, you still have runtime issues and, on top of that, you don’t have native widgets on either Windows or Mac. However applications can look very sleek and sexy, and I think it was worth mentioning this possibility.

Windows is not the only option

I can hear you thinking that this doesn’t solve Windows’ Vista issues. We have shown alternative solutions that simplify the process of delivering software over the Web, but we haven’t addressed the main concern in Eugueny’s post. We simply can’t change Vista; its issues remain. Should we then conclude that Desktop applications are dead? I don’t think so. Most customers will eventually learn to work around Vista’s nagging (or annoying, depending on how you look at it) features and will end up installing the software that they really want one way or another.

Providing a solution that doesn’t require a runtime install on top of the application would be a way to make good headway, as we (the developers) have done all that we can at this point. But let’s assume, as absurd as it might seem, that Vista really does block the majority of customers from installing software. Don’t you think that Microsoft will be forced to do something to address such a worrisome problem? If they don’t, it could practically be called suicide. And let’s move forward, let’s assume that Microsoft ignores the problem and only 5% of the Windows user base will install Internet commercial software from an ISV. Does this imply that Desktop applications are dead? I don’t think so either, because what Eugueny failed to consider was that Windows is not the only operating system available. Sure, it’s hugely popular, but that alone is not a good enough reason to ignore the other possible markets. There are emerging markets for the development of Desktop applications on Mac and Linux. Especially on Mac, where there’re plenty of companies making a lot of money by producing native Objective C and Cocoa applications. And there are plenty of users paying for these applications. Heck, even for Linux it’s possible (albeit harder) to create and market commercial software. As long as there are millions of customers out there who’re willing to pay for Desktop applications which scratch a particular proverbial itch that they happen to have, the Desktop application market is not dead. Luckily.

Did Web 2.0 kill the desktop star? What if the average quality of the software for Windows is so low that users don’t even bother to go through the annoying Vista installation process? Even in a pessimistic scenario where Windows Desktop applications are no longer in fashion, the claim that ‘Desktop applications are dead’ is not supported. Why? Because all this doesn’t affect Mac OS X. Mac users enjoy good applications, they appreciate the effort it took to create well designed software, and many are ready to spend money for valuable tools that solve a specific problem. One could argue that even if the catastrophic situation forecasted in the article mentioned above was to come to fruition, we could only state that Windows Desktop applications are dead. And honestly, I don’t think this is ever going to be the case, because Windows users are not too different from Mac users in regards to purchasing software that they value (or pirating it). Most likely, Desktop applications will be redefined and they’ll continue to evolve as a consequence (or positive side effect) of the endless stream of ubiquitous Web applications. Many applications will be moved onto the Web, sure, but many others are here to stay. I wouldn’t declare a whole broad category of applications to be dead with such ease.

Desktop applications or Web Applications

Web Applications offer several advantages over ‘fat clients’, but a “Web aware”, well written and properly designed Desktop application can provide an experience that is in my opinion, superior to that which you can experience through your browser. I love many of the so called “Web 2.0″ websites, but I also love several Desktop applications that I would never want to see end up being moved to the Web. Integrated with the Web or synchronized on the Web, perhaps, but not entirely replaced by a Web Application. Highly interactive and responsive sites are cool, but let’s not make of Web 2.0 a hammer which is eagerly ready to consider each and every problem as a nail.

Google Reader is a good Web Application for example, but it’s not a replacement for NetNewsWire on Mac OS X. If the Desktop app is practically dead, how come this product got downloaded more than a million times in a niche market such as that of Mac? We need less crapware and more high quality Desktop applications on Windows. Users will be ready to click a couple of scary “allow” buttons if we produce software that is genuinely worth installing. It’s inconvenient that Windows developers have to deal with poor OS choices that may lead them to lose significant amounts of customers in the long run, but the market is big enough to economically justify this in many cases.

Feel free to port your applications to the Web, if there are concrete advantages to doing so, but despite the look of it, Desktop applications (perhaps as smart clients or any other evolution of them) are here to stay. I don’t want a Photoshop, a Visual Studio, an OmniGraffle on the Web, even if it’s technically possible to do so. Let’s not forget that the Web was born for sharing hypertexts. And while it’s fine and dandy that it’s evolved since then to a point where we’re now able to run applications through a browser, let’s not lose sight of what is better suited to a browser and what’s not. Desktop applications are not dead. Even if in ten years there may be a convergence of web applications that look like Desktop applications, and Desktop applications with many of the advantages of Web applications, Desktop applications will still have a florid market, so long as we aim for quality, usability and web integration.


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

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.


Switching to Mac

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. ;-)


Looking for a good laptop for Ruby development

A few days ago I received a new laptop from work, it’s a nice IBM Thinkpad X60 tablet, an ultra-portable 12” that offers up an honest performance.

It is a fine machine, and when hooked up to a large widescreen monitor it can be used for development in most environments. If I’m on the go, speaking at conferences for example, its weight and size make it ideal for carrying around. I’ve already installed Ubuntu 7.04 in dual boot and pretty much everything ran fine from the get-go (the swivel monitor functions need to be manually configured though). In other words, I really like this new tablet PC, and am very happy with it.

The lack of a touchpad and the small screen render it unsuitable for extensive usage without the aid of an external monitor and mouse, but it’s an acceptable trade off for a travel oriented notebook that is not supposed to be a desktop replacement in the end.

With my main desktop out for repair however, I’m left with the small work laptop only (and my wife is left with nothing). I don’t know about you, but to me this is a serious shortage of machines for hacking and personal use.

In order to take care of this, I’ve been thinking about getting a Mac Book Pro (the cheapest one). For about $2200 I could get a powerful machine – hardware wise – with the new Santa Rosa CPU and a fantastic operating system which has the power of Linux with the “work out of the box” feeling of Windows. And I would run Ubuntu alongside Mac OS X through Bootcamp too. I’ve done my research, I evaluated the alternatives and I’ve been considering Mac for a while now.

Doing mostly hacking with open source tools, especially with Ruby and Ruby on Rails, a Mac seemed like a good choice. Good hardware, *nix based, largely adopted in the Ruby on Rails community and the possibility of using Textmate seemed justifiably appealing. Sure enough I decided to head to Best Buy and actually try one before purchasing it.

I was in for a big disappointment. The 15” Mac Book Pro has a rather short monitor (because of its aspect ratio) and didn’t feel very ergonomic. I really wanted to like it, but we simply didn’t click (pun intended). I’m familiar with the 17” version and I know it’s much better, but I can’t justify spending more than $3000 (Canadian) on a laptop.

In defense of Apple, while browsing around I was able to play with the 24” iMac and it left me with a warm, fuzzy feeling. That is a computer worth buying in my opinion, the real estate screen is gorgeous and the price is reasonable. The offer may become especially interesting after the possible updates that will be announced at WWDC next week. Unfortunately though, I’m mostly looking for a laptop not for a desktop, so I have to skip this valuable option.

With the Mac ruled out, I started thinking about what I could get for the same price (about $2200) in the PC world. It turns out you can get a lot of decent hardware for the price of a single 15” Mac Book Pro.

I’m currently considering the following:

  • Acer Aspire 9300 with a 17” WXGA+ Widescreen LCD, AMD Turion 64 X2 1.60GHz processor, 2GB DDR2 RAM and 160GB disk (5400 rpm) and double layer DVD burner.
  • A large, bright Acer 22” external monitor.
  • A decent but fairly cheap laptop for my wife: Acer Aspire 5630, 15.4” LCD, Intel Core 2 Duo T5300 1.73GHz, 1024MB DDR2 RAM, 160GB (5400RPM) and double layer DVD burner.

Granted that the Mac Book Pro is faster machine than the Aspire 9300, but by spending less money, I can buy a laptop for my wife, a fairly powerful 17” laptop for myself (that will run Ubuntu as its main OS), and a very large external monitor that I can use in dual screen mode in conjunction with the 17” screen on the laptop. Not bad if you ask me.

My decision is not yet final but I plan to make a purchase in a couple of days, so I thought I would share this with you in order to hear your opinions and possible alternative laptop ideas.


Next Entries »

Copyright © 2005-2010 Antonio Cangiano. All rights reserved.