Ruby

December 06, 2007

On Languages

I've arrived at some rough analogies for programming languages.

C is like driving a Formula One race car. Most people just shouldn't. But if you're really good, you can meld man and machine in ways that just can't be done any other way, and you can build a truly fast, lean, and powerful system. But all kinds of things can go wrong, and usually badly.

C++ is like driving a Formula One race car towing an elephant. You have all of the risks of C with a whole bunch of weight making all the advantages of C moot. There are exceptions, but very few and far between.

Java is like dispensing with the car altogether and just driving the elephant. It's big, slow, and has a mind of its own.

Python and Ruby are different... they don't fit the car analogy so well, but instead fit into art forms. They just work differently. So I see Python as more like a musical composition. It has structure, and some rules, but at the same time has a free-flowing creativity and can have real elegance.

Ruby is more like painting, very pure, each stroke combining with all the others to create a whole much greater than its parts, but lacking the rules and structure that Python has. Ruby lends itself to incredibly elegant solutions. Unfortunately it doesn't have the system or networking robustness of Python, so sometimes it's as practical as a career in painting (but other times, as in the case of Rails, it's just about as perfect as any language is likely to get).

Apologies if I stepped on your pet language. I've just been doing this a long time (almost 20 years) and have developed distinct opinions and impressions. I don't want to argue about it.


Technorati Tags:
, , ,


June 18, 2007

Ruby, Rails, Asterisk, RealTime...

Cackle with glee, cackle with glee... if only I could tell you. :)

June 08, 2007

Ruby and Rails R-O-C-K

Check out my automatic breadcrumbs. This could be expanded on, no doubt, but this will work for any CRUD-based model and controller. This kind of dynamic programming is just sweetness. This code lives in the main layout.

I uploaded the code to Pastie: http://pastie.textmate.org/68999

October 10, 2006

Why Ruby Rocks

I love Ruby. Here's one of a thousand reasons why:

song.__send__ "#{msg}=", token

The value of msg is the name of an attribute, so this code sets that attribute (well, calls the method attribute= where attribute is the attribute name, where an attr_accessor or attr_writer exists) to the value of token.

That's equivalent to calling song.foo = token if msg has the value foo.

Technorati Tags: , ,

The Story of Stuff

Photoblog

Photography Site

Recent Images

  • www.flickr.com
    This is a Flickr badge showing public photos from jeremey. Make your own badge here.

Flickr

  • jeremey. Get yours at bighugelabs.com/flickr

Houston Photobloggers

Blog powered by TypePad