Amazing Rails Framework + Amazing TextMate

If you are wondering about Rails and Ruby, stop wondering and dive in. While you’re at it, get a good editor and machine to work with. This means a Mac and TextMate. If you don’t have a Mac already, get one, it’s not the cheapest, but not the most expensive; just the most value for your moollah!

Ruby. It’s not PHP. It’s not Perl. It’s better. Ruby comes with the gem tool to get and install extra stuff called RubyGems. It’s similar to (but of course different from) Perl’s CPAN and PHP’s PECL and PEAR.

Ruby on Rails. It’s a great framework that is only getting better. It does defy some of the conventions of Ruby programming style in favor of its own conventions. But there are good reasons. Rails is an ORM, Object Relational Mapping system. That means it connects an OOP (Object Oriented Programming) language to a RDBMS (Relational Database Management System). Databases, you see, are not object oriented. SQL-based databases in particular don’t do things the way OOP languages do things. SQL is more like a language like C or Perl or PHP (before adding object orientation) but very much a language unto itself.

So Rails doing Ruby in its own way is not bad. It makes sense and is done for a reason: to align Rails idioms with what’s in the database schema. Some Ruby programmers will try to correct you, but even Yukihiro ‘Matz’ Matsumoto (松本行弘) (creator of Ruby) will tell you that the old Perl-ism “There’s more than one way to do it.” holds true in Ruby. (Though it should be noted that Rubyists like to say “There’s a better way to do it.” which is usually true.)

TextMate. It’s a surprisingly great text editor. With it, you shouldn’t need any sort of IDE. It is simple on the surface, yet as loaded with features, dare I say, as the venerable EMACS app. TextMate integrates well with Rails and Ruby, HTML, XHTML, XML, CSS, YAML and a host of other languages and pseudo-languages. At first it is mystifyingly simplistic, almost disapointing you. Then when you delve into its menus and keyboard combinations, you find an incredible wealth of clever and useful tools. It can do a lot all by itself since it can act as the host environment for loads of UNIX command line tools and is internet aware, allowing you to use W3C validators while working (provided you are online, which you should be if you are developing anything these days) .It’s worth every bit of currency you spend on it.

I even found something in TextMate surprising and refreshingly smart by accident today. While working with a Ruby or Rails file, you will often press the [return] key and go to a new line only needing to hit [delete] once to type end in order to close a block of Ruby code. Or so I thought. In fact, all you have to do is type end and TextMate will outdent it one level for you! (If only I’d known that a few months ago, think of all the keystrokes I could have saved…)

Which brings me to a wonderful book, TextMate Power Editing For the Mac. It’s a killer manual for using TextMate. Period. Yes, yet another fabulous computer book from The Pragmatic Programmers setting the bar higher still for all the other publishers. These guys just never miss a beat. And as always they sell these as print and pdf. What’s cooler is, they sell their pdf books at a lower price than the print version and DRM-free, allowing you to print or copy the file as you wish. The don’t treat you like a criminal. The only thing even remotely resembling DRM is that at the bottom of each page it says “Prepared exclusively for [Your Name Here]“. What’s cooler still, is that they do pay attention to reader feedback and do make corrections and incorporate them into the pdf versions regularly and print editions often.

Even O’Reilly doesn’t come close to this cool and responsive to what readers have wanted out of technology for eons (in computer life that means about 2 decades). Talk about responsive to readers, they even respond to e-mails personally. I almost hope they don’t get too big and successful and allow the suits and MBAs to come in and ruin all the fun of a company that really cares about its customers. They don’t just make and sell the koolaid, they drink it too, and believe me, it’s damn good koolaid!

Before this gets too long, I wanted to admit, I’ve taken the wrong (in my humble opinion) way to Rails, and I wanted to tell everyone that you do need Programming Ruby (the pickaxe book) and Ruby for Rails but you should start learning Ruby on Rails with Agile Web Development With Rails, 2nd Edition. Get all the other Ruby and Rails books you find, but start with the skateboard book.

0 comments ↓

There are no comments yet...Kick things off by filling out the form below.

Leave a Comment