<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>H3RALD: Articles</title>
    <link>http://www.h3rald.com/articles</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Fabio Cevasco's Writings</description>
    <item>
      <title>Book Review: Design Patterns in Ruby</title>
      <description>&lt;p style="float:right"&gt;&lt;img src="/files/design_patterns_in_ruby.jpg" alt="" /&gt;&lt;/p&gt;


	&lt;p&gt;I finally got my hands on a shiny new copy of &lt;em&gt;Design Patterns in Ruby&lt;sup&gt;&lt;a href="#fn1"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/em&gt;. The book itself is not brand new and it was already widely praised by many different people online, so I wanted to take a look for myself.&lt;/p&gt;


	&lt;p&gt;To my surprise, the book is a hardcover edition, which makes it look more professional and more durable than the average programming book&lt;sup&gt;&lt;a href="#fn2"&gt;2&lt;/a&gt;&lt;/sup&gt;. It&amp;#8217;s also smaller and shorter than the average programming book&lt;sup&gt;&lt;a href="#fn2"&gt;2&lt;/a&gt;&lt;/sup&gt; (340 pages), which makes it much easier to carry around and less intimidating to read. It&amp;#8217;s also &lt;em&gt;not&lt;/em&gt; meant to be a reference book, so it is actually pleasant an easy to read all in one go, as you&amp;#8217;ll soon find out.&lt;/p&gt;


	&lt;p&gt;What is it about? &amp;mdash; well, design patters in the Ruby language of course. But it&amp;#8217;s not the usual brainwash of programming theory you would expect by a typical book on patters, it has &lt;em&gt;plenty&lt;/em&gt; of examples of real code. When I say &lt;em&gt;real code&lt;/em&gt; I don&amp;#8217;t mean the usual Dog/Cat/Horse/&amp;lt;insert animal here&amp;gt; classes or juke-box simulations which don&amp;#8217;t work at all etc. etc., I mean actual snippets from well known Ruby applications, like RubyGems, FXRuby and, of course, Rails.
OK well, there&amp;#8217;s an exception perhaps: Russ &lt;em&gt;did&lt;/em&gt; include a few wild life simulations (ponds with frogs and similar), but it&amp;#8217;s only for your own good, and for the sake of tradition.&lt;/p&gt;


	&lt;p&gt;Anyhow, let&amp;#8217;s start from the beginning&amp;#8230;&lt;/p&gt;


	&lt;h3&gt;Part I: Patters and Ruby&lt;/h3&gt;


	&lt;p&gt;The first part of the book serves as a general introduction to the other two parts. If you know the basics of both design patterns and Ruby, you can safely skip this as you won&amp;#8217;t find anything of overwhelming interest here.&lt;/p&gt;


	&lt;p&gt;Personally I really liked &lt;strong&gt;Chapter 1&lt;/strong&gt; though, &amp;#8220;Building better Programs with Patterns&amp;#8221;, in which Russ does a great job in summarizing the original GoF book&lt;sup&gt;&lt;a href="#fn3"&gt;3&lt;/a&gt;&lt;/sup&gt; into four points::&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;em&gt;Separate our the things that change from those that stay the same.&lt;/em&gt;&lt;/li&gt;
		&lt;li&gt;&lt;em&gt;Program to an interface, not an implementation.&lt;/em&gt;&lt;/li&gt;
		&lt;li&gt;&lt;em&gt;Prefer composition over inheritance.&lt;/em&gt;&lt;/li&gt;
		&lt;li&gt;&lt;em&gt;Delegate, delegate, delegate.&lt;/em&gt;&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;Also, although it does not come from the Design Patterns book but from building real systems, the author adds the &lt;span class="caps"&gt;YAGNI&lt;/span&gt; (You Ain&amp;#8217;t Gonna Need It) principle&lt;sup&gt;&lt;a href="#fn4"&gt;4&lt;/a&gt;&lt;/sup&gt; as a reminder to resist the temptation of implementing things which &lt;em&gt;may&lt;/em&gt; be needed &lt;em&gt;later on&lt;/em&gt;, even if they are not needed right now.
The chapter ends with an outline of the patterns which will be presented throughout the book: 14 out of the original 23 patterns by the Gand of Four will be discussed in Part II and 3 bonus &amp;#8220;Ruby-only&amp;#8221; patterns will be examined in Part &lt;span class="caps"&gt;III&lt;/span&gt;, as a special treat.&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;Chapter 2&lt;/strong&gt; (&lt;em&gt;Getting started with Ruby&lt;/em&gt;) feels perhaps a bit out of place. As others pointed out&lt;sup&gt;&lt;a href="#fn5"&gt;5&lt;/a&gt;&lt;/sup&gt;, why does a book on advanced Ruby programming techniques include a 35-page-long introduction on the Ruby language? The answer was given by Russ himself in an interview&lt;sup&gt;&lt;a href="#fn6"&gt;6&lt;/a&gt;&lt;/sup&gt;:&lt;/p&gt;


&lt;blockquote&gt;
&amp;#8220;The reason that I included the introductory chapter about Ruby in there was to make the book accessible to folks with little or no Ruby background.
Now honestly, I don&#8217;t think that you could come to my book with no background in Ruby and walk away from it an expert Ruby programmer &amp;mdash; it&#8217;s not really that kind of introductory book.
But I do think that someone with experience in other languages could read my book and come away knowing about Ruby, understanding what all the shouting is about.&amp;#8221; 
&lt;/blockquote&gt;

	&lt;p&gt;I admit, I skipped this chapter during my first reading because I was eager to move on to the main part of the book, but I did read it afterwards (I had to write this review after all!). It&amp;#8217;s quite a nice introduction aimed at the average .NET/Java developer: Russ provides a step-by-step presentation of the main features of the language while holding the reader by hand when something weird or scary comes about:&lt;/p&gt;


&lt;blockquote&gt;
The slightly strange-looking syntax in this code is actually a tip-off something deep and important: In Ruby, everythng &amp;mdash; and I mean &lt;em&gt;everything&lt;/em&gt; &amp;mdash; is an object.
&lt;/blockquote&gt;

	&lt;p&gt;Of course Chapter 2 won&amp;#8217;t turn you into a Ruby guru, but it definitely fulfills one of the author&amp;#8217;s goals: bringing developers of other languages closer to Ruby, and give them a tiny taste of how Ruby can be &lt;em&gt;wickedly powerful&lt;/em&gt;.&lt;/p&gt;


	&lt;h3&gt;Part II: Patterns in Ruby&lt;/h3&gt;


	&lt;p&gt;Part II constitutes the bulk of the book, describing 14 GoF patterns in 220 pages. The patterns covered are the following:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;Template Method&lt;/li&gt;
		&lt;li&gt;Strategy&lt;/li&gt;
		&lt;li&gt;Observer&lt;/li&gt;
		&lt;li&gt;Composite&lt;/li&gt;
		&lt;li&gt;Iterator&lt;/li&gt;
		&lt;li&gt;Command&lt;/li&gt;
		&lt;li&gt;Adapter&lt;/li&gt;
		&lt;li&gt;Proxy&lt;/li&gt;
		&lt;li&gt;Decorator&lt;/li&gt;
		&lt;li&gt;Singleton&lt;/li&gt;
		&lt;li&gt;Factory Method&lt;/li&gt;
		&lt;li&gt;Abstract Factory Method&lt;/li&gt;
		&lt;li&gt;Builder&lt;/li&gt;
		&lt;li&gt;Interpreter&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;Why not covering all 23? Well, because to be honest, they are rarely used in Ruby. Furthermore, in some cases some of the ones examined in the book may feel a bit &lt;em&gt;unnatural&lt;/em&gt; to the average Rubyist: how many times did you ever think about using an External Iterator when &lt;code&gt;each&lt;/code&gt; is normally available as default internal iterator for any Array-like class?&lt;/p&gt;


	&lt;p&gt;Each chapter in this part is devoted to a particular pattern and it is organized in more or less the same way, as outlined in the following sections.&lt;/p&gt;


	&lt;h4&gt;Introduction and Personal Anecdotes&lt;/h4&gt;


	&lt;p&gt;Most chapters start with a personal anecdote involving the author: it may be a memory related to his first job at the local grocery store (Chapter 8), or about the day he decided to buy his son a bike (Chapter 14):&lt;/p&gt;


&lt;blockquote&gt;
&amp;#8220;I remember the day we bought my son his first bike.&amp;#8221; [&amp;#8230;] I spent hours trying to pull together a minor junkiard of parts according to instructions that would have baffled the entire National Security Agency. As it turned out, picking the bike was the easy part: putting it together was the real challenge.
&lt;/blockquote&gt;

	&lt;p&gt;This was used to introduce the Builder pattern, and how to use it to configure objects which include different logical parts.
Personally I find this technique particularly useful to introduce a particular problem from a different, more mundane prospective instead of starting off with an abstract theorethical description of the pattern itself. 
The anecdote is then followed by the description of the actual programming problem for which the specific pattern will be used.&lt;/p&gt;


	&lt;h4&gt;Description of the Pattern and Initial Implementation&lt;/h4&gt;


	&lt;p&gt;An initial implementation of the pattern in Ruby will be provided more or less immediately after the introduction of each chapter, often accompanied by a simple &lt;span class="caps"&gt;UML&lt;/span&gt; diagram.
This implementation normally has quite a few conceptual flaws, which are then examined and corrected step-by-step the chapter to obtain a more &amp;#8220;Ruby-friendly&amp;#8221; solution.&lt;/p&gt;


	&lt;h4&gt;A More Rubyfied Version of the Pattern&lt;/h4&gt;


	&lt;p&gt;The final implementation of each pattern is often very different from the initial attempt, and it may contain quite a lot of Ruby-specific code. The author does an excellent job in suggesting pattern implementations which often use blocks, &lt;code&gt;Proc&lt;/code&gt; objects or method redefinitions when needed, to make the code more succint and more readable at the same time, as all Ruby code should be.&lt;/p&gt;


	&lt;p&gt;By doing so, even people who are still learning Ruby will understand how to use some very useful Ruby idioms which can be a bit difficult to grasp otherwise.&lt;/p&gt;


	&lt;h4&gt;Using and Abusing &amp;lt;Pattern&amp;gt;&lt;/h4&gt;


	&lt;p&gt;Patterns are often overused and misused, and some people normally end up wondering if they should be used at all, after all. This section (present as a matter of fact in &lt;em&gt;every&lt;/em&gt; chapter of part II an &lt;span class="caps"&gt;III&lt;/span&gt;) examines the pitfalls of the pattern and the most common mistakes developer make when applying it.
It is by far the most useful section of each chapter, and that&amp;#8217;s what I&amp;#8217;ll be reading and re-reading every time I&amp;#8217;m thinking about using a particular pattern in my code. As a matter of fact, these sections make you realize that &lt;em&gt;every&lt;/em&gt; pattern has its own inherent flaws and dangers, and that it is far from being a Silver Bullet. Even when you&amp;#8217;re &lt;em&gt;supposed&lt;/em&gt; to use a pattern to accomplish something, be aware that &lt;em&gt;something nasty&lt;/em&gt; can happen unless you&amp;#8217;re extra careful: this, perhaps, is the true Golden Rule conveyed throughout the whole book.&lt;/p&gt;


	&lt;h4&gt;&amp;lt;Pattern&amp;gt;s in the Wild&lt;/h4&gt;


	&lt;p&gt;This is another very interesting section which is included in every chapter of part II and &lt;span class="caps"&gt;III&lt;/span&gt;. After describing what a pattern does, how it &lt;em&gt;can&lt;/em&gt; be used and how it &lt;em&gt;should&lt;/em&gt; be used, you&amp;#8217;ll finally find some interesting examples taken from real world applications.
By &amp;#8220;real world application&amp;#8221; I mean something like ActiveRecord&lt;sup&gt;&lt;a href="#fn7"&gt;7&lt;/a&gt;&lt;/sup&gt; (Observer, Command, Adapter, &amp;#8230;), DRb&lt;sup&gt;&lt;a href="#fn8"&gt;8&lt;/a&gt;&lt;/sup&gt; (Proxy) or FXRuby&lt;sup&gt;&lt;a href="#fn9"&gt;9&lt;/a&gt;&lt;/sup&gt; (Composite), for example, i.e. important programs and libraries which are used in production environments.
Personally, I was really glad to find such examples in this book: it definitely helps you feeling design patterns as something more practical and useful than pure software architecture theories.&lt;/p&gt;


	&lt;h4&gt;Wrapping it Up&lt;/h4&gt;


	&lt;p&gt;&amp;#8220;Wrapping it Up&amp;#8221; is the title of the last section of each chapter of Part II and &lt;span class="caps"&gt;III&lt;/span&gt;. It&amp;#8217;s basically a summary of the whole chapter and thus a useful way to recap the most important concepts. I found this section particularly useful when using the book as a design pattern reference, after reading it for the first time: this section provides a quick and essential overview of each pattern&amp;#8212;and the most important DOs and &lt;span class="caps"&gt;DON&lt;/span&gt;&amp;#8217;Ts, too.&lt;/p&gt;


	&lt;h3&gt;Part &lt;span class="caps"&gt;III&lt;/span&gt;: Patterns for Ruby&lt;/h3&gt;


	&lt;p&gt;By the time you get to Part &lt;span class="caps"&gt;III&lt;/span&gt; you&amp;#8217;ll definitely feel that Ruby can do &lt;em&gt;more&lt;/em&gt;. Some of the Ruby implementation of certain patterns described in the book make extensive use of blocks and Proc objects, and the &lt;code&gt;method_missing&lt;/code&gt; method (although potentially dangerous unless extra care is taken) gives us a more immediate way to obtain delegation, for example when creating Proxies. 
Also the fact that objects can be modified at runtime by adding and removing methods &amp;#8220;as needed&amp;#8221; seems quite an underused feature in traditional patterns, simply because those patterns were first conceived for languages which are very different from Ruby and are perhaps less &lt;em&gt;liberal&lt;/em&gt; than Ruby when it comes to dynamic features&lt;sup&gt;&lt;a href="#fn10"&gt;10&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;


	&lt;p&gt;These particular Ruby features can be used (and abused, of course) to implement more Ruby-esque patterns, such as the ones included in this part of the book:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;Internal Domain-Specific Languages&lt;/li&gt;
		&lt;li&gt;Meta-Programming&lt;/li&gt;
		&lt;li&gt;Convention Over Configuration&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;These are just examples, of course some may complain because the Active Record or &lt;span class="caps"&gt;ORM&lt;/span&gt; pattern are missing, but this is understandable as it may be considered too specific compared to the others. 
Each pattern is examined in detail, and I particularly like way the &lt;span class="caps"&gt;DSL&lt;/span&gt; pattern was described: Chapter 16 explains how to develop a simple but effective Ruby &lt;span class="caps"&gt;DSL&lt;/span&gt; from scratch for creating file backups. This can be particularly useful for people who never tried creating DSLs before, but also for developers who tried, but want to improve their skills.&lt;/p&gt;


	&lt;p&gt;Chapter 18 (Convention Over Configuration) is sufficiently clear and detailed, perhaps even too much if you already know how Rails was developed (and all the hype which follwed).&lt;/p&gt;


	&lt;p&gt;On the other hand, I was a bit disappointed by Chapter 17 (Meta-Programming). Maybe it&amp;#8217;s because I built up extremely high expectations about it while reading the rest of the book, but it just felt too short and not detailed enough for my liking. If I had to write such a chapter (which would have been actually very hard), I would have started from an excellent post by Ola Bini&lt;sup&gt;&lt;a href="#fn11"&gt;11&lt;/a&gt;&lt;/sup&gt; which introduces &lt;em&gt;eleven&lt;/em&gt; meta-programming techniques, and built up content and examples from there. The only reason why &lt;del&gt;- I think -&lt;/del&gt; Russ didn&amp;#8217;t do it in his book was length/balance constraint: a &lt;em&gt;properly detailed&lt;/em&gt; chapter about meta-programming in Ruby could easily take up over forty pages!&lt;/p&gt;


	&lt;h3&gt;The Verdict&lt;/h3&gt;


	&lt;p&gt;As I said in the beginning: this is not meant to be a complete, in-depth, reference book on everything you may want to know about design patterns in Ruby. That&amp;#8217;s why, as a matter of fact, you can actually read this book all the way through without getting utterly bored. Russ uses an informal, yet appropriate style to turn potentially complex, theorethical computer science principles into easy-to-understand, &lt;em&gt;useful&lt;/em&gt; tools which can truly improve the way you code.&lt;/p&gt;


	&lt;p&gt;The whole book flows very very nicely. I actually recommend reading this book in sequence, without skipping chapters, because each pattern is described in a way that is somehow linked to the following ones, so that you can understand and learn about the pros and cons of each one in a more natural and useful way.&lt;/p&gt;


	&lt;p&gt;OK, I would have loved to see Part &lt;span class="caps"&gt;III&lt;/span&gt; as long as Part II, probably, but overall I&amp;#8217;m very, very satisfied of what the book taught me. The only problem is that it also made me suddenly realize all the naive design mistakes I&amp;#8217;ve been making when coding in Ruby, so I&amp;#8217;ll now feel compelled to fix at least some of them&amp;#8230;&lt;/p&gt;


	&lt;p&gt;Definitely a worthwhile read, I just hope to see more books like this, or even a second edition of this one soon!&lt;/p&gt;


	&lt;h3&gt;Notes&lt;/h3&gt;


	&lt;p id="fn1"&gt;&lt;sup&gt;1&lt;/sup&gt; &lt;a href="http://www.informit.com/store/product.aspx?isbn=0321490452"&gt;Design Patterns in Ruby&lt;/a&gt; by Russ Olsen, Addison Wesley Professional, 2007.&lt;/p&gt;


	&lt;p id="fn2"&gt;&lt;sup&gt;2&lt;/sup&gt; Think of &lt;a href="http://www.pragprog.com/titles/ruby"&gt;Programming Ruby: The Pragmatic Programmer&amp;#8217;s Guide, 2nd Ed.&lt;/a&gt; by Dave Thomas with Chad Fowler and Andy Hunt, Pragmatic Programmers, 2004.&lt;/p&gt;


	&lt;p id="fn3"&gt;&lt;sup&gt;3&lt;/sup&gt; &lt;a href="http://www.informit.com/store/product.aspx?isbn=0201633612"&gt;Design Patterns: Elements of Reusable Object-Oriented Software&lt;/a&gt;, by By Erich Gamma, Richard Helm, Ralph Johnson, John M. Vlissides (a.k.a. the &lt;em&gt;Gang of Four&lt;/em&gt;), Addison Wesley Professional, 1994.&lt;/p&gt;


	&lt;p id="fn4"&gt;&lt;sup&gt;4&lt;/sup&gt; For more information on the &lt;span class="caps"&gt;YAGNI&lt;/span&gt; principle, visit &lt;a href="http://www.xprogramming.com/Practices/PracNotNeed.html"&gt;You&amp;#8217;re &lt;span class="caps"&gt;NOT&lt;/span&gt; gonna need it&lt;/a&gt;, Ronald E Jeffries.&lt;/p&gt;


	&lt;p id="fn5"&gt;&lt;sup&gt;5&lt;/sup&gt; See &lt;a href="http://on-ruby.blogspot.com/2007/12/design-patterns-in-ruby-review.html"&gt;Design Patterns in Ruby, a review&lt;/a&gt;, _On Ruby_blog.&lt;/p&gt;


	&lt;p id="fn6"&gt;&lt;sup&gt;6&lt;/sup&gt; See &lt;a href="http://on-ruby.blogspot.com/2008/01/russ-olsen-interview.html"&gt;Russ Olsen Interview&lt;/a&gt;, _On Ruby_blog.&lt;/p&gt;


	&lt;p id="fn7"&gt;&lt;sup&gt;7&lt;/sup&gt; &lt;a href="http://ar.rubyonrails.com/"&gt;ActiveRecord&lt;/a&gt; is an implementation of the Object-Relational Mapping (ORM) pattern used by the Ruby on Rails framework.&lt;/p&gt;


	&lt;p id="fn8"&gt;&lt;sup&gt;8&lt;/sup&gt; Distributed Ruby, see &lt;a href="http://chadfowler.com/ruby/drb.html"&gt;Intro to DRb&lt;/a&gt; by Chad Fowler.&lt;/p&gt;


	&lt;p id="fn9"&gt;&lt;sup&gt;9&lt;/sup&gt; &lt;a href="http://www.fxruby.org/"&gt;FXRuby&lt;/a&gt;, a graphical toolkit written in Ruby.&lt;/p&gt;


	&lt;p id="fn10"&gt;&lt;sup&gt;10&lt;/sup&gt; This can be a good or bad thing depending on the way you look at it, and what you want to use the language for. The fact that Ruby is dynamically typed makes it easier to do things which are totally impossible in C++ or Java, but it also introduces a whole new set of potential dangers.&lt;/p&gt;


	&lt;p id="fn11"&gt;&lt;sup&gt;11&lt;/sup&gt; &lt;a href="http://ola-bini.blogspot.com/2006/09/ruby-metaprogramming-techniques.html"&gt;Ruby Metaprogramming Techniques&lt;/a&gt;, Ola Bini: Programming Language Synchronicity.&lt;/p&gt;</description>
      <pubDate>Fri, 11 Apr 2008 05:41:00 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:3a469896-539e-4cec-9288-78108accf7af</guid>
      <author>h3rald</author>
      <link>http://www.h3rald.com/articles/design-patterns-in-ruby-review</link>
      <category>Articles</category>
      <category>ruby</category>
      <category>review</category>
      <category>books</category>
      <enclosure url="http://www.h3rald.com/files/design_patterns_in_ruby.jpg" type="image/jpeg" length="19218"/>
      <trackback:ping>http://www.h3rald.com/trackback/entries/157</trackback:ping>
    </item>
    <item>
      <title>Book Review: Writing Efficient Ruby Code</title>
      <description>&lt;p style="float:right"&gt;&lt;img src="/files/efficient_ruby_shortcut.jpeg" alt="" /&gt;&lt;/p&gt;


	&lt;p&gt;The second shortcut from Addison-Wesley Professional series I&amp;#8217;m going to review is called &lt;a href="http://www.informit.com/store/product.aspx?isbn=0321540034"&gt;Writing Efficient Ruby Code&lt;/a&gt;. A very promising title, especially considering that this book is only 50 pages long.&lt;/p&gt;


	&lt;p&gt;As usual, this shortcut can be intended as a sort of programmer-friendly detailed cheatsheet: like the other ones in this series it sports a monitor-friendly landscape layout and does not go to deep into the details unless strictly necessary to understand a particular concept.&lt;/p&gt;


	&lt;h3&gt;The Author&lt;/h3&gt;


	&lt;p&gt;&lt;a href="http://railsexpress.de/blog/"&gt;Dr. Stefan Kaes&lt;/a&gt;, the author, contributed a lot to improve Ruby on Rails&amp;#8217; performance by refactoring portions of its core and try to &amp;#8220;get maximum speed out of performance-critical sections of code&amp;#8221;. This short but interesting shortcut groups together a lot of performance tweaks, tips and tricks but also some &amp;#8220;anti-patterns&amp;#8221; Kaes was able to identify through his career as programming teacher Ruby software consultant and key Rails contributor.&lt;/p&gt;


	&lt;h3&gt;The Contents&lt;/h3&gt;


	&lt;p&gt;Like with the previously-covered &lt;a href="/articles/mongrel-shortcut-review"&gt;Mongrel shortcut&lt;/a&gt;, &lt;em&gt;Writing Efficient Ruby Code&lt;/em&gt; always goes straight to the point when it comes to identify problems. The first one mentioned is of course that the &lt;em&gt;Ruby Interpreter is Slow&lt;/em&gt;, most people are aware of that, due to their direct experience or because this argument is normally used by non-Rubyists to argue the language&amp;#8217;s usability in commercial projects. What you may not know is why that is so, and that&amp;#8217;s where the first part of this book comes into play.&lt;/p&gt;


	&lt;blockquote&gt;
		&lt;p&gt;&lt;em&gt;&amp;#8220;Ruby is a highly dynamic language: Almost all language entities are first-class citizens in that they can be created, changed, and destroyed at runtime. This comprises classes, modules, methods, constants, and class and instance variables. Only local variables are second-class citizens in Ruby: Whether a name refers to a local variable is determined at parse time.&lt;/em&gt;&lt;/p&gt;
	&lt;/blockquote&gt;


	&lt;p&gt;This makes Ruby extremely flexible, but also more complex. Whever you use a name to refer to an object, Ruby has to search for the object it refers to, and this costs in terms of processing time.&lt;/p&gt;


	&lt;p&gt;As a matter of fact, one of the most recurring tips in the book to improve code performance is the following:&lt;/p&gt;


	&lt;p style="text-align:center;"&gt;&lt;strong&gt;Method calls are expensive, use variables directly when possible.&lt;/strong&gt;&lt;/p&gt;


	&lt;p&gt;Keep this in mind: &lt;code&gt;self.something&lt;/code&gt; is &lt;em&gt;not&lt;/em&gt; the same as &lt;code&gt;@something&lt;/code&gt;. The end result is the same, but the first way costs more in terms of performance because Ruby has to look up the method name.
Similarly, &lt;strong&gt;local variables &lt;em&gt;should&lt;/em&gt; be introduced as a way to &amp;#8220;cache&amp;#8221; the result of method calls&lt;/strong&gt;. Often you may feel &amp;#8220;guilty&amp;#8221; to introduce a new variable and keep calling the same method over and over: this should definitely be avoided.&lt;/p&gt;


	&lt;p&gt;Other useful tips include, for example:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;Use syntax constructs (e.g. assignments) as expressinons. Use evaluation precedences.&lt;/li&gt;
		&lt;li&gt;Use interpolated strings &lt;code&gt;"... #{string_variable}"&lt;/code&gt; (there&amp;#8217;s also no performance difference if constant strings are used between &lt;code&gt;"&lt;/code&gt; or &lt;code&gt;'&lt;/code&gt;)&lt;/li&gt;
		&lt;li&gt;Use operators which update the data structure without copying it (when possible). Use &lt;code&gt;update&lt;/code&gt; or &lt;code&gt;merge&lt;/code&gt; to update hashes.&lt;/li&gt;
		&lt;li&gt;Iterating using &lt;code&gt;for a in  A&lt;/code&gt; is slightly faster than performing the same iteration using &lt;code&gt;each&lt;/code&gt;, (it is the opposite in Ruby 1.9 though)&lt;/li&gt;
		&lt;li&gt;do not use &lt;code&gt;return&lt;/code&gt; unless you have to&lt;/li&gt;
		&lt;li&gt;test in order of expected case frequency&lt;/li&gt;
		&lt;li&gt;Use parallel assignment (&lt;code&gt;a, b = 5, 6&lt;/code&gt;) where applicable&lt;/li&gt;
		&lt;li&gt;If a module gets included in only one other class (or module), it&#8217;s preferable to open the class instead.&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;I deliberately chose not to elaborate any further on the tips listed above because otherwise I&amp;#8217;ll give a big chunk of the contents of the book itself. If you know Ruby enough, you may already know why such reccommendations make sense, but if you don&amp;#8217;t, &lt;em&gt;Writing Efficient Ruby Code&lt;/em&gt; can be a short but very interesting read.&lt;/p&gt;


	&lt;h3&gt;The Good&lt;/h3&gt;


	&lt;p&gt;For each of the 30 &amp;#8220;coding patterns&amp;#8221; (and consequent anti-patterns) described in the book, the author does a great job explaining the reasons of doing something in a particular way, also through examples and benchmarks, where possible.&lt;/p&gt;


	&lt;p&gt;Furthermore, this &lt;em&gt;shortcut&lt;/em&gt; can really be useful to grasp a few difference between Ruby 1.8.5, 1.8.6 and 1.9 in terms of performance: not all the patters apply to all Ruby implementations, and when that&amp;#8217;s the case it is clearly stated.&lt;/p&gt;


	&lt;h3&gt;The Bad&lt;/h3&gt;


	&lt;p&gt;My only complaint about the book is probably the lack of details and more &amp;#8220;specialized&amp;#8221; patterns. Everything (except for a few Rails-specific tips) normally apply to Ruby &lt;em&gt;as a whole&lt;/em&gt;, without going deeply to analyze specific libraries or third-party gems. As a result, once you get the general idea, some of the patters may seem pretty obvious or a logic consequence of others.&lt;/p&gt;


	&lt;p&gt;It is also true that this is meant to be a &lt;em&gt;shortcut&lt;/em&gt;, not a comprehensive analysis on code optimization techniques which can be applied to specific cases: something like this would require much more than 50 pages!&lt;/p&gt;


	&lt;h3&gt;The Bottom Line&lt;/h3&gt;


	&lt;p&gt;Read it, re-read a few bits of it to make sure you grasp the most important concepts, and keep its table of contents in front of you as a reminder when refactoring your code!&lt;/p&gt;</description>
      <pubDate>Mon, 21 Jan 2008 05:47:00 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:6712bd59-655a-4682-a2f5-4dafc0c1a69b</guid>
      <author>h3rald</author>
      <link>http://www.h3rald.com/articles/efficient-ruby-code-shortcut-review</link>
      <category>Articles</category>
      <category>ruby</category>
      <category>review</category>
      <category>books</category>
      <trackback:ping>http://www.h3rald.com/trackback/entries/151</trackback:ping>
    </item>
    <item>
      <title>A Firefox Lover's Guide to Opera</title>
      <description>&lt;blockquote&gt;
		&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; This article can be considered a sequel for &lt;a href="http://www.h3rald.com/articles/ie-lovers-guide-to-firefox"&gt;An IE Lover&amp;#8217;s Guide to Firefox&lt;/a&gt;, which described Firefox through the eyes of an Internet Explorer fan. Similarly, this article describes Opera&amp;#8217;s features from the point of view of a user &amp;ndash; myself &amp;ndash; who has been using Firefox for years and is now considering another browser switch.&lt;/p&gt;
	&lt;/blockquote&gt;


	&lt;p&gt;I am a Firefox fan. I&amp;#8217;ve been using Firefox since it was named &amp;#8220;Firebird&amp;#8221; and calling it &amp;#8220;stable&amp;#8221; was a big overstatement. Firefox dragged me out of Internet Explorer, and that was definitely one of its biggest achievements.&lt;/p&gt;


	&lt;p&gt;Because I&amp;#8217;m addicted to trying out new tools, however, I always kept testing new browsers I discovered here and there. K-Meleon, Flock, Sleipnir&amp;#8230; When Safari came out for Windows I immediately installed it and used it for about 2 hours, only to realize that it wasn&amp;#8217;t &amp;ndash; and it still isn&amp;#8217;t &amp;ndash; usable at all, mainly due to sporadic crashes.&lt;/p&gt;


	&lt;p style="float:right"&gt;&lt;img src="/files/opera/fast.jpg" alt="" /&gt;&lt;/p&gt;


	&lt;p&gt;Similarly, I&amp;#8217;ve been trying out &lt;a href="http://www.opera.com/"&gt;Opera&lt;/a&gt; periodically, as new releases came out, but again it didn&amp;#8217;t seem to work for me. The biggest complaint I had was its inability to render heavily-ajaxified web sites properly. However, now it seems that the Opera Development Team made a big effort to improve the browser, and I was pleased to notice that &lt;a href="http://www.opera.com/products/desktop/next/"&gt;Opera 9.5b&lt;/a&gt; (&amp;#8220;Kestrel&amp;#8221;) doesn&amp;#8217;t seem to have this sort of problems at all.&lt;/p&gt;


	&lt;h3&gt;Planning the Switch&lt;/h3&gt;


	&lt;p&gt;Firefox has extensions. Plenty of them actually. Some are useful, like the newish Del.icio.us one made by Yahoo, and also crappy ones you&amp;#8217;ll never use unless you want to have a fancy button on one of your over-cluttered toolbars which enables you to interface more easily with X or Y web services you hardly ever use.&lt;/p&gt;


	&lt;p&gt;By contrast, Opera never attempted to add full-blown extension support to its venerable and yet very powerful browser. Instead, they kept building more and more features right into its core, being careful not to undermine the browser&amp;#8217;s two proverbial qualities: &lt;em&gt;speed&lt;/em&gt; and &lt;em&gt;stability&lt;/em&gt;. What seemed a doomed philosophy at first turned out to be a good thingin the long run. More and more people are getting more and more worried about Firefox&amp;#8217;s memory issues and begin to &lt;em&gt;wander off&lt;/em&gt; to explore new things, exactly like I did.&lt;/p&gt;


	&lt;p&gt;The first step to switch from Firefox to Opera is to reduce the number of Firefox extensions to the bare minimum you need:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;Colorzilla&lt;/li&gt;
		&lt;li&gt;Web Developer&lt;/li&gt;
		&lt;li&gt;MeasureIt&lt;/li&gt;
		&lt;li&gt;Search Status&lt;/li&gt;
		&lt;li&gt;Gmail Manager&lt;/li&gt;
		&lt;li&gt;Secure Login&lt;/li&gt;
		&lt;li&gt;Del.icio.us

	&lt;p&gt;How many extensions do you &lt;em&gt;actually&lt;/em&gt; use? Here&amp;#8217;s a short analysis for the ones above:&lt;/p&gt;&lt;/li&gt;
	&lt;/ul&gt;


	&lt;ul&gt;
	&lt;li&gt;The first three are related to Web Development only, which means that I don&amp;#8217;t need them unless I&amp;#8217;m doing some web-development tests during which I&amp;#8217;m always going to have more than one browser open anyway. &lt;strong&gt;&lt;span class="caps"&gt;UPDATE&lt;/span&gt;:&lt;/strong&gt; there are a few &lt;a href="http://widgets.opera.com/search/?order=name&amp;#38;q=ruler"&gt;Ruler&lt;/a&gt; widget which can be used instead of MeasureIt &lt;em&gt;(thanks &lt;strong&gt;Ameer&lt;/strong&gt;)&lt;/em&gt;.&lt;/li&gt;
		&lt;li&gt;SearchStatus gives me Alexa Rank and Google Pagerank: I think I can survive without those for a while. &lt;strong&gt;&lt;span class="caps"&gt;UPDATE&lt;/span&gt;:&lt;/strong&gt; if not, there&amp;#8217;s always &lt;a href="http://www.puzzleclub.ru/files/seobar/"&gt;SEObar&lt;/a&gt; &lt;em&gt;(thanks &lt;strong&gt;Ameer&lt;/strong&gt;)&lt;/em&gt;.&lt;/li&gt;
		&lt;li&gt;I use Gmail Manager because my girlfriend uses Gmail on the same computer. I&amp;#8217;m switching to Opera and she&amp;#8217;ll stick with Firefox, so no problem there&amp;#8230;&lt;/li&gt;
		&lt;li&gt;Secure Login? It&amp;#8217;s called &lt;em&gt;Wand&lt;/em&gt; and it has been built-in into Opera for the last decade or so.&lt;/li&gt;
		&lt;li&gt;Del.icio.us &amp;ndash; OK, I won&amp;#8217;t be able to access my favorite tags as quickly, but &lt;a href="http://erlang.no/2005/10/06/delicious-opera-buttons-2/"&gt;someone&lt;/a&gt; already came out with a few handy buttons for a better integration with the popular social bookmarking service.&lt;/li&gt;
	&lt;/ul&gt;


	&lt;blockquote&gt;
		&lt;p&gt;&lt;strong&gt;&lt;span class="caps"&gt;UPDATE&lt;/span&gt;:&lt;/strong&gt; For a list of the features provided by Firefox extensions which are included in Opera, see Rijk&amp;#8217;s &lt;a href="http://files.myopera.com/Rijk/blog/extensions.html"&gt;Top 150 Popular Firefox Extensions and Opera&lt;/a&gt;&lt;/p&gt;
	&lt;/blockquote&gt;


	&lt;p style="float:right"&gt;&lt;img src="/files/opera/opera_navigation.png" alt="" /&gt;&lt;/p&gt;


	&lt;p&gt;Because I&amp;#8217;m addicted to betas, I immediately downloaded &lt;a href="http://www.opera.com/products/desktop/next/"&gt;Opera Kestrel&lt;/a&gt;, i.e. Opera 9.50 beta 1. I never actually liked Opera&amp;#8217;s default theme, so I started looking around for &lt;strong&gt;&lt;a href="http://my.opera.com/community/customize/skins/"&gt;new skins&lt;/a&gt;&lt;/strong&gt; (yes, eye-candy matters sometimes) and came across the Ximple series by &lt;a href="http://my.opera.com/community/customize/skins/author/?id=serafins"&gt;serafins&lt;/a&gt;. In particular, &lt;a href="http://my.opera.com/community/customize/skins/info/?id=3835"&gt;2nd thought &amp;#8211; Jimple&lt;/a&gt; quickly became my favorite.&lt;/p&gt;


	&lt;h3&gt;Tabs&lt;/h3&gt;


	&lt;p&gt;&lt;em&gt;&amp;#8220;Opera is the Web pioneer that delivered tabbed browsing in 2000 [&amp;#8230;]&amp;#8221;&lt;/em&gt;&lt;/p&gt;


	&lt;p&gt;Opera tabs &lt;em&gt;feel&lt;/em&gt; stable and mature. Why? Probably because tabs are used more consistently to open not only web pages but also:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;Downloads (&amp;#8220;Transfers&amp;#8221;)&lt;/li&gt;
		&lt;li&gt;&lt;span class="caps"&gt;RSS&lt;/span&gt; feeds&lt;/li&gt;
		&lt;li&gt;Notes&lt;/li&gt;
		&lt;li&gt;Emails&lt;/li&gt;
		&lt;li&gt;Bookmarks&lt;/li&gt;
		&lt;li&gt;Widget Management &lt;/li&gt;
		&lt;li&gt;Contacts&lt;/li&gt;
		&lt;li&gt;History&lt;/li&gt;
		&lt;li&gt;Page Links&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;I think this is a great feature and Firefox should definitely consider it: v3.0 comes with new download and bookmark managers, but they&amp;#8217;re still dialogs. Yes, I know, there&amp;#8217;s probably some extension which allows you to display them in the sidebar, but that&amp;#8217;s not the point: Opera brings more consistency to the overall browsing experience by using tabs wherever they should be used.&lt;/p&gt;


	&lt;p&gt;Additionally, Opera tabs&amp;#8230;&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;Can be rearranged, exactly like Firefox tabs&lt;/li&gt;
		&lt;li&gt;Can be restored, if closed accidently, by re-opening them from the Trash can&lt;/li&gt;
		&lt;li&gt;Can be locked, meaning that they can&amp;#8217;t be closed accidently&lt;/li&gt;
		&lt;li&gt;Can be duplicated&lt;/li&gt;
		&lt;li&gt;Can be saved in groups (sessions) and re-opened later on&lt;/li&gt;
		&lt;li&gt;Can be restored if Opera crashes&lt;/li&gt;
	&lt;/ul&gt;


	&lt;h3&gt;Speed Dial&lt;/h3&gt;


	&lt;p&gt;When you open Opera for the first time, and &lt;em&gt;whenever you open a new empty tab&lt;/em&gt; the Speed Dial is displayed. What I originally thought it was one of the most annoying things introduced by Opera 9 turned out to be actually useful and very addictive.&lt;/p&gt;


	&lt;p&gt;The idea behind it is simple:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;Show a default page with 9 slots&lt;/li&gt;
		&lt;li&gt;Allow users to drag links to those slots&lt;/li&gt;
		&lt;li&gt;Display preview of each slot (which is cached and can be updated by refreshing the page)&lt;/li&gt;
		&lt;li&gt;Allow users to quickly access pages saved in the Speed Dial via &lt;span class="caps"&gt;CTRL&lt;/span&gt;+1 .. &lt;span class="caps"&gt;CTRL&lt;/span&gt;+9 or simply by clicking them.

	&lt;p&gt;Simple and effective. Once you get going with it, you&amp;#8217;ll overcome the initial feeling of imposition and you&amp;#8217;ll use it more and more: I literally can&amp;#8217;t live without it now!&lt;/p&gt;&lt;/li&gt;
	&lt;/ul&gt;


	&lt;h3&gt;Right-click goodies&lt;/h3&gt;


	&lt;p&gt;While I was testing Opera, my girlfriend came along and asked me to look something up on &lt;a href="http://www.imdb.com/"&gt;&lt;span class="caps"&gt;IMDB&lt;/span&gt;&lt;/a&gt;. I normally had &lt;span class="caps"&gt;IMDB&lt;/span&gt; as custom search engine in Firefox, but unfortunately Opera didn&amp;#8217;t seem to allow users to customize their search engines&amp;#8230;&lt;/p&gt;


	&lt;p&gt;Totally wrong. Not only Opera lets you add any search engine to the search bar, it also does it with style and in the easiest way possible:&lt;/p&gt;


	&lt;p style="float:right"&gt;&lt;img src="/files/opera/search_engines.png" alt="" /&gt;&lt;/p&gt;


	&lt;ol&gt;
	&lt;li&gt;Go to your search engine or any website with a search form&lt;/li&gt;
		&lt;li&gt;Right click the search field&lt;/li&gt;
		&lt;li&gt;Click &lt;strong&gt;Create Search&amp;#8230;&lt;/strong&gt;&lt;/li&gt;
		&lt;li&gt;Specify a name and a keyword for your search engine&lt;/li&gt;
	&lt;/ol&gt;


	&lt;p&gt;Done. You&amp;#8217;ll now be able to search that particular site directly from the search bar. As you can see, I added Wikipedia, &lt;span class="caps"&gt;IMDB&lt;/span&gt; and even the &lt;a href="http://www.uesp.net/wiki/Main_Page"&gt;Unofficial Elder Scrolls Pages&lt;/a&gt; in this way.&lt;/p&gt;


	&lt;p&gt;Besides creating searches, Opera lets you do a lot by right-clicking anywhere on a page:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;strong&gt;Block Content&lt;/strong&gt;: Right-click an empty area of any webpage and select &lt;strong&gt;Block Content&lt;/strong&gt; to select which ads, scripts and images will be blocked from now on.&lt;/li&gt;
		&lt;li&gt;&lt;strong&gt;Validate&lt;/strong&gt;: Validate the &lt;span class="caps"&gt;HTML&lt;/span&gt; source code of the current page.&lt;/li&gt;
		&lt;li&gt;&lt;strong&gt;Translate&lt;/strong&gt;: Translate the current page into a foreign language with just two clicks.&lt;/li&gt;
		&lt;li&gt;&lt;strong&gt;Open With&lt;/strong&gt;: Open the current page in another browser installed on your system.&lt;/li&gt;
		&lt;li&gt;&lt;strong&gt;Edit Site Preferences&amp;#8230;&lt;/strong&gt;: Choose to block/allow cookies and popups, identify Opera as another browser, set a different encoding, enable/disable scripts, images, flash, etc. These setting apply to the &lt;em&gt;current web site only&lt;/em&gt;.&lt;/li&gt;
		&lt;li&gt;View source, reload page every X seconds/minutes, send by email, etc.&lt;/li&gt;
	&lt;/ul&gt;


	&lt;h3&gt;Widgets&lt;/h3&gt;


	&lt;p&gt;&lt;a href="http://widgets.opera.com/"&gt;Opera Widgets&lt;/a&gt; must not be considered as Opera&amp;#8217;s counterpart to Firefox extensions. Instead, Opera Widgets can be used as &lt;em&gt;poor man&amp;#8217;s Vista Gadgets&lt;/em&gt; on Windows XP, and they do their job most remarkably.&lt;/p&gt;


	&lt;p&gt;I&amp;#8217;m personally very fond of these ones:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;a href="http://widgets.opera.com/widget/3683/"&gt;The Free Dictionary&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href="http://widgets.opera.com/widget/8461/"&gt;Wikipedia&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href="http://widgets.opera.com/widget/3687/"&gt;Calendar&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href="http://widgets.opera.com/widget/4513/"&gt;Whois Widget&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href="http://widgets.opera.com/widget/3689/"&gt;Currency Converter&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href="http://widgets.opera.com/widget/5118/"&gt;&lt;span class="caps"&gt;HTML&lt;/span&gt; Entities&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href="http://widgets.opera.com/widget/7206/"&gt;Twitter&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;They all have a common trait: they all behave as standalone programs, as they should be. The Wikipedia one, for example, can display Wikipedia entries directly inside the widget, unlike some others which just take you to Wikipedia, which is rather pointless.&lt;/p&gt;


	&lt;p&gt;Although widgets live within Opera, they can be displayed &amp;#8220;always behind&amp;#8221;, which means they&amp;#8217;ll be glued to your desktop and therefore will be visible whenever Opera and other applications are minimized.&lt;/p&gt;


	&lt;p&gt;Needless to say that anyone brave enough can make widgets for Opera by following a simple &lt;a href="http://dev.opera.com/articles/view/opera-widgets-specification-1-0/"&gt;Widget Specification&lt;/a&gt;.&lt;/p&gt;


	&lt;h3&gt;Everything you can do on the Internet&lt;/h3&gt;


	&lt;p&gt;The term &lt;em&gt;browser&lt;/em&gt; applied to Opera is somehow misleading. Personally I would have called it something like &amp;#8220;Internet Suite&amp;#8221;, because that would be a better choice due to the features it offers and the things it can do.&lt;/p&gt;


	&lt;p&gt;Traditionally speaking, a web browser can be used to browse web pages, read feeds (sometimes) and navigate through &lt;span class="caps"&gt;FTP&lt;/span&gt; directories. Here&amp;#8217;s what Opera can handle:&lt;/p&gt;


	&lt;p style="float:right"&gt;&lt;img src="/files/opera/files.png" alt="" /&gt;&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;Web Pages &amp;ndash; No need of explanations here.&lt;/li&gt;
		&lt;li&gt;&lt;span class="caps"&gt;FTP&lt;/span&gt; &amp;ndash; &lt;span class="caps"&gt;FTP&lt;/span&gt; directories are listed very clearly, overriding server&amp;#8217;s settings with a more user-friendly layout.&lt;/li&gt;
		&lt;li&gt;Local Files &amp;ndash; This was a surprise for me. Typing &lt;code&gt;file://&lt;/code&gt; will automatically load a list of the drives currently available on your machine. Similarly, auto-completion for directory and file names is supported! I almost started using Opera as my everyday&amp;#8217;s file manager (almost).&lt;/li&gt;
		&lt;li&gt;Feeds &amp;ndash; An embedded feed reader can be used to subscribe to &lt;span class="caps"&gt;RSS&lt;/span&gt;/Atom feeds and view them&amp;#8230; in a tab, of course.&lt;/li&gt;
		&lt;li&gt;E-mails &amp;ndash; Opera &lt;em&gt;is&lt;/em&gt; also a pretty decent email client. As of version 9.5 full &lt;span class="caps"&gt;IMAP&lt;/span&gt; support has been added, which definitely makes the difference.&lt;/li&gt;
		&lt;li&gt;&lt;span class="caps"&gt;IRC&lt;/span&gt; &amp;ndash; Opera can be used as an client, which works pretty well. Who needs ChatZilla anymore?&lt;/li&gt;
		&lt;li&gt;News &amp;ndash; Opera can be used to signup and retrieve news from newsgroups.&lt;/li&gt;
		&lt;li&gt;Gopher/WAIS &amp;ndash; Although not used everyday, Opera can handle these old protocols as well.&lt;/li&gt;
		&lt;li&gt;BitTorrent Files &amp;ndash; By default, Opera can act as a BitTorrent client as well, so you can just open .torrent files through the program and then monitor the download progress in the Transfers window, like with any other normal download. While this feature is indeed useful, it is also possible to &lt;a href="http://www.opera.com/support/search/view/840/"&gt;disable it&lt;/a&gt; and still use your favorite BitTorrent client.&lt;/li&gt;
	&lt;/ul&gt;


	&lt;h3&gt;Portability and Synchronization&lt;/h3&gt;


	&lt;p&gt;Let&amp;#8217;s spend some words about &lt;em&gt;portability&lt;/em&gt;. Sure, there are two &amp;#8220;Portable Opera&amp;#8221; apps out there, and they work well enough, but one thing I&amp;#8217;d like about a web browser is the ability to synchronize my preferences, customizations, themes, passwords etc. etc. across multiple computers. 
Firefox is &lt;a href="http://labs.mozilla.com/2007/12/introducing-weave/"&gt;getting there&lt;/a&gt;, although the technology is still at a very early stage.
Opera is doing something similar through &lt;a href="http://link.opera.com/"&gt;Opera Link&lt;/a&gt;, which allows you to synchronize automatically your Bookmarks, your Personal Bar and your Speed Dial. All you need is to get a (free) Opera account, login to Opera Link and enable the synchronization feature from the &lt;em&gt;File&lt;/em&gt; menu. From now on every time you&amp;#8217;ll modify your Speed Dial or Bookmarks, the changes will be sent to your Opera Link page. Similarly, whenever you start using opera somewhere else, if you login to your Opera Account you should be able to synchronize your Bookmarks and Speed Dial.&lt;/p&gt;


	&lt;p&gt;Here are some thoughts on this type of technology:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;It&amp;#8217;s not totally private yet. While it&amp;#8217;s great to be able to sync bookmarks and speed dial, the problems arise when you finish using your friend&amp;#8217;s computer for example&amp;#8230; what happens to the bookmarks you just sync&amp;#8217;ed? The only way to delete them would be to have your friend to log in to his Opera account and re-sync them. Not enough privacy for my liking.&lt;/li&gt;
		&lt;li&gt;Your passwords, notes, widgets, etc. etc. cannot be synchronized yet, but that will hopefully be possible in near future.&lt;/li&gt;
		&lt;li&gt;Sync&amp;#8217;ing bookmarks is pointless for me. Although Opera still hopes to compete with Del.icio.us &amp;#38; Co., that will be very hard to achieve. I stopped using in-browser bookmarks long ago. &lt;/li&gt;
		&lt;li&gt;Link seems and interesting feature considering that Opera is available on virtually &lt;em&gt;any operating system&lt;/em&gt; and a lot of different devices (mobile phones, Nintendo DS &amp;#38; Wii, &amp;#8230;).&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;At any rate, it is still possible to &amp;#8220;carry around&amp;#8221; your personal opera settings by following the instructions provided on &lt;a href="http://help.opera.com/Windows/9.50/en/backup.html"&gt;this page&lt;/a&gt; which explains pretty much everything you need to know aboud Opera files and local storage.&lt;/p&gt;


	&lt;h3&gt;Advanced Features&lt;/h3&gt;


	&lt;p&gt;Opera looks more &amp;#8220;polished up&amp;#8221; than Firefox in most cases. The superb usage of tabs for nearly everything is one example, and another one is the possibility to apply skins (themes) on-the-fly, without having to restart the browser. 
Firefox &lt;em&gt;can&lt;/em&gt; do this via the &lt;a href="http://labs.mozilla.com/2007/12/personas-for-firefox/"&gt;Personas&lt;/a&gt; extension, but Opera had this built-in for a long time.&lt;/p&gt;


	&lt;p&gt;To apply a new skin:&lt;/p&gt;


	&lt;ol&gt;
	&lt;li&gt;Go to the &lt;a href="http://my.opera.com/community/customize/skins/"&gt;Skins Directory&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;Download a skin you like&lt;/li&gt;
		&lt;li&gt;Opera will download and apply the skin immediately, &lt;strong&gt;and it will ask you whether you want to keep it or not&lt;/strong&gt;. If you choose not to, it won&amp;#8217;t save it in your profile (very useful for quick previews). Neat.&lt;/li&gt;
	&lt;/ol&gt;


	&lt;p&gt;Another quality opera always excelled to is accessibility. Besides using the interface in the traditional way, it is also possible to:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;strong&gt;Use &lt;a href="http://www.opera.com/products/desktop/mouse"&gt;mouse gestures&lt;/a&gt;&lt;/strong&gt; &amp;ndash; I wasn&amp;#8217;t a big fan of this until I bothered reading the excellent documentation Opera provided for them (which is significantly better than &lt;a href="http://www.mousegestures.org/"&gt;the Firefox&amp;#8217;s equivalent&lt;/a&gt;). It can be quite useful at times.&lt;/li&gt;
		&lt;li&gt;&lt;strong&gt;Use &lt;a href="http://www.opera.com/products/desktop/keyboard/"&gt;keyboard shortcuts&lt;/a&gt;&lt;/strong&gt; &amp;ndash; Believe it or not, you can literally &lt;a href="http://www.opera.com/support/tutorials/nomouse/"&gt;use Opera without a mouse&lt;/a&gt;.&lt;/li&gt;
		&lt;li&gt;&lt;strong&gt;&lt;a href="http://www.opera.com/products/desktop/voice/"&gt;Speak&lt;/a&gt; to it&lt;/strong&gt; &amp;ndash; Opera&amp;#8217;s voice integration is getting better and better. Not only you can effectively &lt;a href="http://www.opera.com/support/tutorials/voice/"&gt;tell your browser what to do&lt;/a&gt;, you can also use the built-in text-to-speech function (Windows only) to have it read entire pages for you. It actually works quite well and it can parse punctuation well enough to apply the right intonation. Just for fun, I had it read it an Italian page&amp;#8230; and it actually worked as expected: it was like listening to an American reading an Italian text using US pronuntiation!&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;Finally, power users will be delighted of the way opera lets you hack the program settings, as you can:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;Use &lt;strong&gt;Tools &amp;gt; Quick Preferences&lt;/strong&gt; to block/unblock popups, cookies, Java applets, images, etc.&lt;/li&gt;
		&lt;li&gt;Use &lt;strong&gt;Tools &amp;gt; Advanced&lt;/strong&gt; to access detailed information concerning cookies, cache (it lists every image/object cached!), plug-ins, Wand passwords, etc.&lt;/li&gt;
		&lt;li&gt;Use &lt;strong&gt;Tools &amp;gt; Appearence&amp;#8230;&lt;/strong&gt; to access and manage appearance-related settings, like skins, toolbars, buttons and panels&lt;/li&gt;
		&lt;li&gt;Use &lt;strong&gt;Tools &amp;gt; Preferences&amp;#8230;&lt;/strong&gt; to access general preferences (all the rest)&lt;/li&gt;
		&lt;li&gt;Type in &lt;strong&gt;opera:config&lt;/strong&gt; to view and tweak Opera&amp;#8217;s internal settings, somehow like Firefox&amp;#8217;s about:config, but much cleaner and easier to use.&lt;/li&gt;
		&lt;li&gt;Download the &lt;strong&gt;&lt;a href="http://dev.opera.com/tools/"&gt;Developer Console&lt;/a&gt;&lt;/strong&gt; to have a simpler alternative to Firefox&amp;#8217;s Web Developer Toolbar extension, to view &lt;span class="caps"&gt;DOM&lt;/span&gt; elements, &lt;span class="caps"&gt;CSS&lt;/span&gt; and Javascript information.&lt;/li&gt;
	&lt;/ul&gt;


	&lt;h3&gt;Annoyances&lt;/h3&gt;


	&lt;p&gt;After using as main browser for a few weeks now, I can say that it&amp;#8217;s great but not perfect yet. It&amp;#8217;s very advanced, faster and more mature than any other browser, of course,but there are a few things which should be fixed or improved.&lt;/p&gt;


	&lt;p&gt;In particular:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;strong&gt;It&amp;#8217;s not open source&lt;/strong&gt; &amp;ndash; This may not matter to someone, but some people consider this an essential requirement for their browser, and that&amp;#8217;s why Firefox is their most obvious choice. Although Opera is free, it is proprietary software after all, which means is definitely not as open as you may want it to be. Personally I&amp;#8217;m not too bothered, as I&amp;#8217;m starting to think that too much openness may lead to too many unuseful and bloated extensions and make the program somehow &amp;#8220;unpredictable&amp;#8221; and heavy.&lt;/li&gt;
		&lt;li&gt;&lt;del&gt;&lt;strong&gt;No address bar search&lt;/strong&gt; &amp;ndash; Amazingly, only Firefox seems to have this feature built-in. I&amp;#8217;m referring to the ability to type whatever in the address bar to be redirected to the site returned by a Google&amp;#8217;s &lt;em&gt;I&amp;#8217;m feeling lucky&lt;/em&gt; search. It is possible to emulate this feature in Opera by creating a custom search for &lt;em&gt;I&amp;#8217;m Feeling Lucky&lt;/em&gt; and assign it a short keyword like &amp;#8220;l&amp;#8221;. In this way, for example, typing in &lt;code&gt;l h3rald&lt;/code&gt; should lead you to this website. Not quite as immediate as in Firefox though.&lt;/del&gt;&lt;/li&gt;
		&lt;li&gt;&lt;del&gt;&lt;strong&gt;No find as you type&lt;/strong&gt; &amp;ndash; Another big disappointment for who comes from Firefox or Safari: Opera still uses a dialog box to perform page searches.&lt;/del&gt;&lt;/li&gt;
		&lt;li&gt;&lt;del&gt;&lt;strong&gt;No spell clecking&lt;/strong&gt; &amp;ndash; Again, both Firefox and Safari now offer text fields spell checking. Opera doesn&amp;#8217;t yet.&lt;/del&gt;&lt;/li&gt;
		&lt;li&gt;&lt;strong&gt;No &lt;span class="caps"&gt;HTML&lt;/span&gt; mail composer&lt;/strong&gt; &amp;ndash; Opera&amp;#8217;s built-in mail client can display &lt;span class="caps"&gt;HTML&lt;/span&gt; emails but doesn&amp;#8217;t yet allow users to create them.&lt;/li&gt;
		&lt;li&gt;&lt;del&gt;&lt;strong&gt;Auto-start widgets?&lt;/strong&gt; &amp;ndash; This is a feature enhancement Opera Dev Team should consider: allow users to configure certain widgets to start automatically when Opera starts.&lt;/del&gt;&lt;/li&gt;
		&lt;li&gt;&lt;strong&gt;Google Reader + Flash problems&lt;/strong&gt; &amp;ndash; Sometimes I experiences some scrolling problems when reading news which contain embedded flash movies on Google Reader.&lt;/li&gt;
		&lt;li&gt;&lt;strong&gt;Corporate Sites&lt;/strong&gt; &amp;ndash; Unfortunately some corporate web site do not support Opera or are not displayed correctly in Opera. Unfortunately there&amp;#8217;s nothing much we can do about it but trying to &amp;#8220;mask&amp;#8221; Opera as another browser (via &lt;strong&gt;right-click &amp;gt; Edit Site Preferences&amp;#8230;&lt;/strong&gt;)&lt;/li&gt;
		&lt;li&gt;&lt;del&gt;&lt;strong&gt;Default Browser Problems&lt;/strong&gt; &amp;ndash; Setting Opera as default browser on Windows doesn&amp;#8217;t seem to set the file icons accordingly (or worse, it resets them to the default file icon).&lt;/del&gt;&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;&lt;strong&gt;&lt;span class="caps"&gt;ERRATA&lt;/span&gt;:&lt;/strong&gt;&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;It is possible to have Opera to redirect you to the right after typing a few words in thr address bar by setting Google&amp;#8217;s &amp;#8220;I&amp;#8217;m feeling lucky&amp;#8221; as default search engine &lt;em&gt;(thanks &lt;strong&gt;&lt;span class="caps"&gt;EJ902&lt;/span&gt;&lt;/strong&gt;)&lt;/em&gt;.&lt;/li&gt;
		&lt;li&gt;Spell Checking is &lt;a href="http://www.opera.com/support/tutorials/opera/spellcheck/"&gt;supported&lt;/a&gt; via &lt;span class="caps"&gt;GNU&lt;/span&gt; Aspell &lt;em class="thanks &lt;strong :redsh" id="109:&gt;cvm&lt;/strong&gt;&amp;#8220;&gt;_ or by using &lt;a href="http://opera.gt500.org/ospell/"&gt;Ospell&lt;/a&gt; for inline spell checking _(thanks &lt;strong&gt;Dava&lt;/strong&gt;)&lt;/em&gt;.&lt;/li&gt;
		&lt;li&gt;Find as you type can be triggered by pressing &lt;code&gt;.&lt;/code&gt; and typing &lt;em&gt;(thanks &lt;strong&gt;cvm&lt;/strong&gt;)&lt;/em&gt;.&lt;/li&gt;
		&lt;li&gt;It is possible to auto-start widgets by saving a session with all your widget open and reloading it at every startup [CTRL+F12 &amp;gt; General &amp;gt; Startup &amp;gt; Continue saved sessions] &lt;em&gt;(thanks &lt;strong&gt;Tamil&lt;/strong&gt; &amp;#38; &lt;strong&gt;Ameer&lt;/strong&gt;)&lt;/em&gt;.&lt;/li&gt;
		&lt;li&gt;As of the &lt;a href="http://my.opera.com/desktopteam/blog/"&gt;latest snapshot&lt;/a&gt;, setting Opera as default browser and handler for &lt;span class="caps"&gt;HTML&lt;/span&gt; files doesn&amp;#8217;t cause any problems &lt;em&gt;thanks &lt;strong&gt;Ayush&lt;/strong&gt;)&lt;/em&gt;.&lt;/li&gt;
	&lt;/ul&gt;


	&lt;h3&gt;Conclusion&lt;/h3&gt;


	&lt;p&gt;Despite the few annoyances listed in the previous section, Opera 9.5 beta 1 truly impressed me. I was waiting for Opera to get better before switching and now I&amp;#8217;ve not been using Firefox for a few weeks.
Although Opera offers a lot of features, there&amp;#8217;s still room for improvements, especially for what concerns integration with third party services: I would really like to see some sort of integration with del.icio.us, and that could be possible via widgets at least. 
Regarding the new Opera Link feature, it looks very promising and a potential competitor for Mozilla Weave even though it will be used mainly to get more and more users to register to the Opera community (I did, at least), which is indeed very active any way.&lt;/p&gt;


	&lt;p&gt;To conclude this article, which still barely scratches the surface of this very powerful application, I&amp;#8217;d like to praise two more things about Opera:&lt;/p&gt;


	&lt;p&gt;&lt;span style="float:right; margin:3px;"&gt;
&lt;script type="text/javascript"&gt;
digg_url = &amp;#8216;http://digg.com/software/A_Firefox_Lover_s_Guide_to_Opera&amp;#8217;;
&lt;/script&gt;
&lt;script src="http://digg.com/tools/diggthis.js" type="text/javascript"&gt;&lt;/script&gt;
&lt;/span&gt;&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;Their website network, and in particular their truly excellent documentation knowledge base, which is very comprehensive of references, tutorials and interesting articles. I am a full time technical writer myself, and I&amp;#8217;ve hardly ever come across better documentation.&lt;/li&gt;
		&lt;li&gt;Their extensive &lt;a href="http://www.opera.com/docs/specs/"&gt;support and compliance to web standards&lt;/a&gt;, which makes Opera the most advanced browser ever made.&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;If you&amp;#8217;ve not tried Opera before, or if you&amp;#8217;ve always dismissed it because &amp;#8220;X browser is better&amp;#8221;, you may want to &lt;a href="http://www.opera.com/products/desktop/"&gt;give it another shot&lt;/a&gt;: for me it was definitely worthwhile!&lt;/p&gt;</description>
      <pubDate>Fri, 28 Dec 2007 14:19:00 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:8d31c3da-549a-41be-9db4-4c699acd102c</guid>
      <author>h3rald</author>
      <link>http://www.h3rald.com/articles/firefox-lovers-guide-to-opera</link>
      <category>Articles</category>
      <category>browsers</category>
      <category>review</category>
      <category>software</category>
      <category>Opera</category>
      <category>Firefox</category>
      <category>IE</category>
      <trackback:ping>http://www.h3rald.com/trackback/entries/149</trackback:ping>
    </item>
    <item>
      <title>Book Review: Mongrel Digital Shortcut</title>
      <description>&lt;p&gt;If you ever considered about developing an deploying a Rails application in the last year or so, you must have heard of &lt;a href="http://mongrel.rubyforge.org/index.html"&gt;Mongrel&lt;/a&gt; before. If you didn&amp;#8217;t, I&amp;#8217;d recommend you learn more about it because up to now it proved to be one of the few essential ingredients for deploying &lt;em&gt;scalable&lt;/em&gt; Rails applications.&lt;/p&gt;


	&lt;p&gt;Mongrel is a creation of &lt;a href="http://www.zedshaw.com/"&gt;Zed Shaw&lt;/a&gt; who started writing a replacement for FastCGI to use with Rails, and ended up creating a brand new, &lt;span class="caps"&gt;HTTP&lt;/span&gt; web server who turned out to be one of the best things the Rails community ever saw happening.&lt;/p&gt;


	&lt;p&gt;It was created to be simple to use and configure, nevertheless it &lt;em&gt;does&lt;/em&gt; require some skill to set it up and tune it. Documentation is there, along with plenty of blog posts, but there&amp;#8217;s also an interesting &lt;a href="http://www.informit.com/store/product.aspx?isbn=0321483502&amp;#38;rl=1"&gt;book&lt;/a&gt; from &lt;a href="http://www.awprofessional.com/"&gt;Addison Wesley Professional&lt;/a&gt; which is definetely worth a read.&lt;/p&gt;


	&lt;p style="float:right"&gt;&lt;img src="/files/mongrel_shortcut.jpeg" alt="" /&gt;&lt;/p&gt;


	&lt;p&gt;&amp;#8220;Mongrel: Serving, Deploying, and Extending Your Ruby Applications&amp;#8221; &amp;ndash; that&amp;#8217;s the title of the book. A &lt;em&gt;Digital Shortcut&lt;/em&gt;, 100-odd pages long, in &lt;em&gt;landscape&lt;/em&gt; format to make it easier to read on a computer, straight to the point with no added sugar for just 15$ (PDF only). I must say Addison Wesley got it right: the book&amp;#8217;s format is, as a matter of fact, &lt;em&gt;optimized for web developers&lt;/em&gt;, especially those who can&amp;#8217;t afford to read a 500-pages book covering everything about a subject just to find that one thing they don&amp;#8217;t know about.
This &lt;em&gt;shortcut&lt;/em&gt; can be seen, essentially, as an expanded cheatsheet which will teach you the basics about Mongrel and also give you plenty of advice on how to learn more about it.&lt;/p&gt;


	&lt;p&gt;Let&amp;#8217;s have a closer look at it.&lt;/p&gt;


	&lt;h3&gt;Overview, Introduction &amp;#38; Getting Started&lt;/h3&gt;


	&lt;p&gt;The first three &lt;del&gt;chapters&lt;/del&gt; sections (there are no chapters, just &lt;em&gt;sections&lt;/em&gt;) of the book are meant to be a gentle introduction to Mongrel and its world. The main author is &lt;a href="http://www.informit.com/authors/bio.aspx?a=0260912e-6ed8-4ed1-882a-c357e644feec"&gt;Matt Pelletier&lt;/a&gt;, but Zed Show&amp;#8217;s contributions are definitely one of the book&amp;#8217;s best selling points. 
Zed&amp;#8217;s thoughts are scattered here and there in many &lt;em&gt;sidebars&lt;/em&gt; throughout the book (there&amp;#8217;s at least one in each section): you&amp;#8217;ll see an odd-looking face (Zed&amp;#8217;s self-caricature) with some text next to it; when you read it, you&amp;#8217;ll notice that they are &lt;em&gt;actually&lt;/em&gt; Zed&amp;#8217;s own thoughts, straight from his mind, with no editorial filter whatsoever in-between. 
Be warned: the text included within the &lt;strong&gt;Zed Sez&lt;/strong&gt; sidebars is highly opinionated, that&amp;#8217;s precisely what Zed &lt;em&gt;feels&lt;/em&gt; to say about something, and he&amp;#8217;ll just say it: just the plain, simple thoughts of an experienced programmer. As the author explains in &lt;strong&gt;Section 1&lt;/strong&gt;: &lt;em&gt;&amp;#8220;[&amp;#8230;] You may not agree with everything he says, but you probably should.&amp;#8221;&lt;/em&gt;&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;Section 2&lt;/strong&gt; is a general introduction about Mongrel. It explains &lt;em&gt;what&lt;/em&gt; it is, &lt;em&gt;when&lt;/em&gt; and &lt;em&gt;why&lt;/em&gt; it was made, and &lt;em&gt;how&lt;/em&gt; it works. There&amp;#8217;s nothing new to learn if you already used Mongrel before, probably, but it&amp;#8217;s definitely the first thing to show to someone who&amp;#8217;s new to Mongrel and its world, and possibly a bit skeptical about it. 
The last subsection &lt;em&gt;&amp;#8220;What can Mongrel do for me&amp;#8221;&lt;/em&gt; is an attempt to &lt;del&gt;brainwash&lt;/del&gt; persuade you to fully embrace Mongrel and its philosophy, whether you are a developer, a sysadmin or even a manager: assertions like &lt;em&gt;&amp;#8220;Mongrel is pretty damned secure.&amp;#8221;&lt;/em&gt; and &lt;em&gt;&amp;#8220;Mongrel&amp;#8217;s license is capitalist-friendly.&amp;#8221;&lt;/em&gt; will definitaly make some of you (managers) happy.&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;Section 3&lt;/strong&gt; is slightly more juicy than the previous one, as it explains how to install and use Mongrel. Basically that&amp;#8217;s what everyone who ever used it already knows, but it&amp;#8217;s still necessary for the book&amp;#8217;s consistency, after all. After reading this section, you&amp;#8217;ll probably have your first Mongrel up and running and serving your little Rails application&amp;#8217;s pages, and you&amp;#8217;ll begin to wonder why the hell you need to keep reading this book now that everything seems to work already&amp;#8230;&lt;/p&gt;


	&lt;h3&gt;Section 4: Configurations&lt;/h3&gt;


	&lt;p&gt;&amp;#8230;aka &amp;#8220;a truly useful Mongrel cheatsheet&amp;#8221;. This section dives deep(er) into Mongrel&amp;#8217;s configuration by explaining what each start parameter does in detail. The parameters are presented in tabular form in a very well-organized way. As you would expect from an high-quality cheatsheet.&lt;/p&gt;


	&lt;p&gt;Then the author will explore a few commonly used deployment scenarios, in particular:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;strong&gt;Standalone&lt;/strong&gt; &amp;ndash; The simplest configuration possible, with just one Mongrel instance serving both static and dynamic pages.&lt;/li&gt;
		&lt;li&gt;&lt;strong&gt;mongrel&amp;#95;cluster&lt;/strong&gt; &amp;ndash; How to use &lt;em&gt;&amp;#8220;a pack of mongrels&amp;#8221;&lt;/em&gt; together to handle more traffic.&lt;/li&gt;
		&lt;li&gt;&lt;strong&gt;Behind a static web server&lt;/strong&gt; &amp;ndash; The most common (and most scalable) option, used to serve static content faster using a front-end server and use Mongrel only to handle Ruby pages.&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;Towards the end of the section, for the developer&amp;#8217;s delight, the author will discuss two common, useful scenarios where Mongrel can be used:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;strong&gt;Apache 2 + mod_proxy_balancer + mongrel&amp;#95;cluster&lt;/strong&gt; &lt;/li&gt;
		&lt;li&gt;&lt;strong&gt;Nginx + mongrel&amp;#95;cluster&lt;/strong&gt;&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;The difference here is that detailed instructions are provided on how to setup and configure each server, including example file sources. This can be particularly useful for the Nginx example, as most of the documentation for this fantastic, lightweight Mongrel fron-end is scattered around the web (or written in Russian in a &lt;a href="http://sysoev.ru/nginx/"&gt;well known place&lt;/a&gt;).&lt;/p&gt;


	&lt;h3&gt;Section 5: Production Deployment&lt;/h3&gt;


	&lt;p&gt;This section introduces one of the most important part of the life cycle of a Rails application: the deployment on a production server. The author is pretty honest about the whole subject:&lt;/p&gt;


&lt;blockquote&gt;
&lt;em&gt;&amp;#8220;You will not do this in a day. If you are expecting to code until 1 minute before your deadline and then simply point and click and have an instant server then you need to take some kind of
medication because you are violently hallucinating. You will need at least a week of 8 hours days to make sure your first deployment works and to have the time to do it right.&amp;#8221;&lt;/em&gt;
&lt;/blockquote&gt;

	&lt;p&gt;Sounds terribly true. Especially for larger projects demanding good performance under heavy traffic. Scared? Probably, if you never deployed a Rails application &amp;#8220;properly&amp;#8221; before, but at least the book comes to the rescue by providing an overview of what you need to perform a deployment and why it is such a complex and delicate process.&lt;/p&gt;


	&lt;p&gt;Not only this, but also a &amp;#8220;Best Practices Rubric&amp;#8221; is also provided for the developer&amp;#8217;s own private enjoyement. It&amp;#8217;s written as a list of questions like:&lt;/p&gt;


	&lt;p&gt;&lt;em&gt;11. Do you have a shared location where you can document the deployment, such as a Wiki or &lt;span class="caps"&gt;CMS&lt;/span&gt;?&lt;/em&gt;
&lt;em&gt;12. Do you know how to use httperf or ab and know what the statistics mean?&lt;/em&gt;&lt;/p&gt;


	&lt;p&gt;After these 13 questions, the author provides the key to give a meaning to your answers:&lt;/p&gt;


&lt;blockquote&gt;
&lt;em&gt;&amp;#8220;For each question you answer with &amp;#8220;NO&amp;#8221;, add 10 hours to your time estimate for completion. This may seem unrealistic, since saying &amp;#8220;NO&amp;#8221; to everything means it&amp;#8217;ll take 190 hours (about one
month), but this estimate is actually low according to most first deployment experiences.&amp;#8221;&lt;/em&gt;
&lt;/blockquote&gt;

	&lt;p&gt;If you answered &amp;#8220;NO&amp;#8221; too many times to these questions, you may want to read on through the next subsection which states 17 &amp;#8220;worst practices&amp;#8221;: an invaluable read for beginners!&lt;/p&gt;


	&lt;p&gt;But after all this section is not only about stating the obvious (&amp;#8230;right?): a full example scenario is describedand examined throughly to give you an idea of how a deployment &lt;em&gt;should&lt;/em&gt; be made, using three different machines:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;One for Apache (as a front-end to Mongrel)&lt;/li&gt;
		&lt;li&gt;One for the Mongrel cluster and the Rails application&lt;/li&gt;
		&lt;li&gt;One for the database&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;Maybe something you&amp;#8217;ll never do if you just want to run your grandma&amp;#8217;s site on Rails, but certainly something you may want to start looking at if your grandma becomes really popular and your small server gets grounded by several thousands of visitors per day.&lt;/p&gt;


	&lt;p&gt;The last part of the section will give you a brief introduction on monitoring your applications and on which tools you should be using, although it does not discuss the subject in detail at all, it&amp;#8217;s just meant to point you to the right direction.&lt;/p&gt;


	&lt;h3&gt;Section 6: Extending Mongrel&lt;/h3&gt;


	&lt;p&gt;This section digs deeper into the software code internals and describes &lt;em&gt;how to teach new tricks to your Mongrel&lt;/em&gt;, i.e. how to extend its functionality.&lt;/p&gt;


	&lt;p&gt;Before you begin, though, don&amp;#8217;t forget what Zed himself has to say about Mongrel&amp;#8217;s simplicity:&lt;/p&gt;


&lt;blockquote&gt;
&lt;em&gt;&amp;#8220;I&amp;#8217;ve always had a different aesthetic sense when I write my software. I value simplicity and directness and try to write software that follows this approach. I jokingly call it the Shibumi School of Software Structure. All I do is apply this rule: When given two possible designs with equal end results, pick the simpler one. I then ruthlessly strip the solution down to its finest elements, but no more.&amp;#8221;&lt;/em&gt;
&lt;/blockquote&gt;

	&lt;p&gt;Mongrel&amp;#8217;s architecture is not that complex, and this section is sufficient to get you started by providing an overview of the main classes involved (HttpServer, HttpRequest, HttpResponse, HttpHandler, URIClassifier), and how they work together.
Note that the book won&amp;#8217;t describe anything about the APIs of these classes. but after all, the project&amp;#8217;s &lt;a href="http://mongrel.rubyforge.org/rdoc/files/README.html"&gt;RDoc documentation&lt;/a&gt; should cover all the details you need.&lt;/p&gt;


	&lt;p&gt;The rest of the section focuses on how to extend Mongrel, by:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;Writing custom handlers in Ruby&lt;/li&gt;
		&lt;li&gt;Creating custom filters to perform security checks, clean up requests and preliminary file processing&lt;/li&gt;
		&lt;li&gt;Creating plugins and distributing them as rubygems&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;Two working examples are also provided:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;An example handler to deflate content (if the browser supports deflate)&lt;/li&gt;
		&lt;li&gt;An example &amp;#8220;duck&amp;#8221; plugin, to make Mongrel quack like a duck when it&amp;#8217;s started (not the most useful thing in the world, but serves the purpose)&lt;/li&gt;
	&lt;/ul&gt;


	&lt;h2&gt;Debugging, Performance &amp;#38; Security&lt;/h2&gt;


	&lt;p&gt;The last three sections deals with other important aspects concerning the deployment of your application, how to debug, how to improve performance and how to secure your application.&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;Section 7&lt;/strong&gt; introduces two debugging modes:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;Dash-Bee logging (-B) &lt;/li&gt;
		&lt;li&gt;&lt;span class="caps"&gt;USR1&lt;/span&gt; logging (lighter)&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;And also gives you an idea on what to look for when debugging an application. Nothing too detailed, granted, but enough to make sure you are pointed in the right direction.&lt;/p&gt;


	&lt;p&gt;Again, Zed&amp;#8217;s wisdom and wit are remarkable:&lt;/p&gt;


&lt;blockquote&gt;
&lt;em&gt;&amp;#8220;These people&amp;#8217;s problem is they suffer from Potpourri Turd Syndrome&#8212;a belief that their you-know-what don&amp;#8217;t stink and smells like fine dew on freshly cut grass. Whenever there&amp;#8217;s a bug, they go
running like kids in a candy store to other people&amp;#8217;s code trying to find fault and just assume that it&amp;#8217;s nothing they wrote.
[&amp;#8230;]
When you run into a problem with your application, always assume it&amp;#8217;s your fault first. Mongrel&amp;#8217;s not perfect, but its code is minuscule compared to the size of Rails and most likely even your own appli-cation code. Mongrel also powers many large and medium deployments without any problems. If there&amp;#8217;s an error, the evidence already says it&amp;#8217;s in your code, so bite the bullet and start investigating it as if it&amp;#8217;s your problem.&amp;#8221;&lt;/em&gt;
&lt;/blockquote&gt;

	&lt;p&gt;Similarly, &lt;strong&gt;Section 8&lt;/strong&gt; is a short but useful overview on performance tips and tricks and deployment tuning. The most useful thing is probably the checklist of the &amp;#8220;tuning process&amp;#8221;, which illustrates the simple steps to take to tune your application.&lt;/p&gt;


	&lt;p&gt;Finally, &lt;strong&gt;Section 9&lt;/strong&gt; addresses some common security concerns and clarifies how Mongrel deals with them. The answer is normally &amp;#8220;Mongrel strictly does this&amp;#8221; or &amp;#8220;Mongrel doesn&amp;#8217;t support this feature&amp;#8221;. After all, you should have understood by now that Mongrel is an example of simplicity and that it deliberately does not aim to offer all the feature you&amp;#8217;d expect by a server like Apache:&lt;/p&gt;


&lt;blockquote&gt;
&lt;em&gt;&amp;#8220;As you probably see, Mongrel say, &amp;#8220;No&amp;#8221; in many places where most Web servers say, &amp;#8220;Yes, OK.&amp;#8221; Sometimes this is because no one using Mongrel has needed it yet, sometimes it&amp;#8217;s because there&amp;#8217;s a
better, simpler way to accomplish the same goal. Mongrel is a different kind of Web server, and frequently you can solve your problem with a different solution.&amp;#8221;&lt;/em&gt; 
&lt;/blockquote&gt;

	&lt;h2&gt;Conclusion&lt;/h2&gt;


	&lt;p&gt;If Mongrel is opinionated software, this is definitely an opinionated book which fully embraces the project&amp;#8217;s philosopy of simplicity above everything else. It&amp;#8217;s an interesting read and it won&amp;#8217;t bore you to death by deliberately skipping long and potentially tedious subjects and adding interesting insights instead (like the Zed Sez sidebars). Perhaps it is a bit too direct towards certain people, who may get even get offended (as planned) by some of the author&amp;#8217;s assertions.&lt;/p&gt;


	&lt;p&gt;Despite being a 100-pages book, this &lt;em&gt;shortcut&lt;/em&gt; covers pretty much everything you need to know &lt;strong&gt;about Mongrel&lt;/strong&gt;. It will &lt;em&gt;not&lt;/em&gt; teach you everything about deployment, security, performance tweaks and debugging though: as the authors often state throughout the book, a lot of (big) books are available on those subject, and it wouldn&amp;#8217;t make sense to even attempt to discuss them in this shortcut.&lt;/p&gt;


	&lt;p&gt;Similarly, you won&amp;#8217;t find complex examples either, but that&amp;#8217;s acceptable because simple examples are often the only thing you need to grasp the basics of a concept or feature, and then use them as a &amp;#8220;scaffold&amp;#8221; for your own code.&lt;/p&gt;


	&lt;p&gt;Globally, the book is well balanced and &lt;em&gt;optimized&lt;/em&gt; for its size: lightweight introductory sections at first, then the &amp;#8220;real juice&amp;#8221; in the middle, and a few overview sections on advanced topics towards the end. You can read it easily in a few hours, perhaps less, and whenever you need to look something up in a hurry it will be fairly easy to locate.&lt;/p&gt;


	&lt;p&gt;A good read, and a &lt;em&gt;must&lt;/em&gt; for everyone who wants to learn more about Mongrel or Rails deployment.&lt;/p&gt;</description>
      <pubDate>Sat, 15 Dec 2007 03:42:00 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:e9705e1b-6dd5-49f0-b5df-1a6681e6ceb2</guid>
      <author>h3rald</author>
      <link>http://www.h3rald.com/articles/mongrel-shortcut-review</link>
      <category>Articles</category>
      <category>review</category>
      <category>books</category>
      <category>Rails</category>
      <category>ruby</category>
      <enclosure url="http://www.h3rald.com/files/mongrel_shortcut.jpeg" type="image/jpeg" length="11113"/>
      <trackback:ping>http://www.h3rald.com/trackback/entries/144</trackback:ping>
    </item>
    <item>
      <title>A closer look at Komodo Edit</title>
      <description>&lt;p&gt;&lt;a href="http://digg.com/programming/A_closer_look_at_Komodo_Edit"&gt;
&lt;img src="http://digg.com/img/badges/180x35-digg-button.png" width="180" height="35" alt="Digg!" /&gt;
&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;&lt;em&gt;What&amp;#8217;s your favorite code editor?&lt;/em&gt;&lt;/p&gt;


	&lt;p&gt;This is a common question which still keeps popping up on community boards, mailing lists, comments, etc. Every programmer who writes code in some programming language normally has an editor of choice. Being realistic, most of the times it&amp;#8217;s not only one program but several, depending on the language and on the features needed at the time.
Yes, great, but how do you choose your favorite editor?
By trying a lot of them of course: that&amp;#8217;s what I&amp;#8217;ve been doing since I started programming. Lately I&amp;#8217;ve become fond of &lt;a href="http://www.vim.org"&gt;Vim&lt;/a&gt; (or better, gVim), although I have a few other editors I may recommend, e.g.:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;a href="http://notepad-plus.sourceforge.net/uk/site.htm"&gt;Notepad++&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href="http://intype.info/home/index.php"&gt;Intype&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href="http://scintilla.sourceforge.net/SciTE.html"&gt;SciTE&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;Recently, however, I came across my &lt;em&gt;n&lt;sup&gt;th&lt;/sup&gt;&lt;/em&gt; &amp;#8220;what&amp;#8217;s your favorite editor&amp;#8221; thread and someone mentioned &lt;a href="http://www.activestate.com/Products/komodo_edit/"&gt;Komodo Edit&lt;/a&gt;. I knew of it already, actually, but I never had a chance to give it a &lt;em&gt;proper&lt;/em&gt; try. 
ActiveState is well known mainly for two things:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;Their effort in offering a lot of commercial, windows-based Perl libraries&lt;/li&gt;
		&lt;li&gt;Their commercial &lt;span class="caps"&gt;IDE&lt;/span&gt;, Komodo &lt;span class="caps"&gt;IDE&lt;/span&gt;, which I personally tried quite a long time ago&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;The problems of Komodo &lt;span class="caps"&gt;IDE&lt;/span&gt; are foundamentally two:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;It costs money &amp;#8211; this is not great in a world where Eclipse and Netbeans are free&lt;/li&gt;
		&lt;li&gt;It is an &lt;span class="caps"&gt;IDE&lt;/span&gt; &amp;#8211; which normally means &lt;em&gt;&amp;#8216;heavy as hell&amp;#8217;&lt;/em&gt;.&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;It&amp;#8217;s a matter of taste and needs: some people feel more confortable with using an editor for certain tasks, while sometimes an &lt;span class="caps"&gt;IDE&lt;/span&gt; may be the best solution, despite its potential slowness and bulk.&lt;/p&gt;


	&lt;p&gt;Komodo Edit solves the above-mentioned problems because:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;It&amp;#8217;s free&lt;/li&gt;
		&lt;li&gt;It&amp;#8217;s an editor&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;Actually I wouldn&amp;#8217;t call it an editor, because it offers quite a lot of features which are normally absent in editors&amp;#8212;it&amp;#8217;s something in-between, which definitely deserves a try.&lt;/p&gt;


	&lt;h2&gt;User interface&lt;/h2&gt;


	&lt;p&gt;Komodo Edit&amp;#8217;s interface is one of the most clear I&amp;#8217;ve ever come across. It is organized in four main areas plus the top menu and toolbar (which only has the buttons you &lt;span class="caps"&gt;REALLY&lt;/span&gt; need, unlike Notepad++&amp;#8217;s 31-button-bar).&lt;/p&gt;


	&lt;p style="float:center"&gt;&lt;img src="/files/komodo_main.png" alt="" /&gt;&lt;/p&gt;


	&lt;p&gt;The central area is for editing, the left pane is for the Project browser, the right one is for the Toolbox and the bottom pane is for command output. Luckily enough, a set of handy little buttons is provided in the toolbar to show and hide each pane. I normally only use the Project Browser and the main editing area, leaving the Toolbox and Command Output panes hidden, but that&amp;#8217;s up to you really.&lt;/p&gt;


	&lt;p style="float:left"&gt;&lt;img src="/files/komodo_show-hide_pane.png" alt="" /&gt;&lt;/p&gt;


	&lt;p&gt;Komodo Edit allows symultaneous editing of multiple documents, which means that it has tabs like most of the best editors out there. Furthermore, it is possible to have Komodo re-open the files edited in the last editing session, saving you a lot of time. Granted, a lot of &lt;span class="caps"&gt;IDE&lt;/span&gt; do, but this is &lt;strong&gt;&lt;span class="caps"&gt;NOT&lt;/span&gt;&lt;/strong&gt; an &lt;span class="caps"&gt;IDE&lt;/span&gt;, remember? It&amp;#8217;s an &lt;em&gt;editor&lt;/em&gt;, or at least it is advertised as such.&lt;/p&gt;


	&lt;p&gt;In reality it has &lt;em&gt;most&lt;/em&gt; of the power of a full-blown &lt;span class="caps"&gt;IDE&lt;/span&gt; though normally remaining under the 60K memory usage (out of 2GB of total &lt;span class="caps"&gt;RAM&lt;/span&gt;)&amp;#8212;which is not that bad, considering what Eclipse and NetBeans need.
Out of all the &lt;a href="http://www.activestate.com/Products/komodo_edit/edit_vs_ide.plex"&gt;extra features&lt;/a&gt; offered by Komodo &lt;span class="caps"&gt;IDE&lt;/span&gt;, the only one I truly miss is the Code Browser. Other than that, it quickly became my editor/IDE of choice (when gVim isn&amp;#8217;t looking, of course&amp;#8230;)&lt;/p&gt;


	&lt;p&gt;Lets find out why&amp;#8230;&lt;/p&gt;


	&lt;h2&gt;Editing features&lt;/h2&gt;


	&lt;p&gt;Komodo Edit comes with all the editing features of ever average editor, so &lt;em&gt;&amp;#8220;[&amp;#8230;] Code commenting, auto-indent and outdent, block selection, incremental search, reflow paragraph, join lines, enter next character as raw literal, repeat next keystroke and clean line endings on &amp;#8220;save&amp;#8221;.&amp;#8221;&lt;/em&gt;, it uses Scintilla as main editing component, which makes it a close relative of Notepad++, Notepad2 and of course SciTE when it comes to understanding languages and syntax highlighting.&lt;/p&gt;


	&lt;p&gt;This is good, of course, as Scintilla is an excellent editing component, but &amp;#8211; I have to say this &amp;#8211; not as good as Vim when it comes to syntax highlighting (nothing is as good as Vim though, so I can&amp;#8217;t really complain!).
As you can see from the screenshot I included earlier on, it is possible to change the default black-on-white color scheme to something more stimulating and energy-saving. This doesn&amp;#8217;t mean I have to manually re-set the color of each element, it actually comes with a black-background scheme, which is handy.&lt;/p&gt;


	&lt;h3&gt;Supported Languages &amp;#38; Syntax Highlighting&lt;/h3&gt;


	&lt;p&gt;Komodo Edit supports quite a few programming languages, which means it can recognize the most common ones (C, C++, Java, &lt;span class="caps"&gt;PHP&lt;/span&gt;, Python, Ruby, Perl) but it also smart enough to notice framework-specific syntaxes like Smarty, Django or &lt;span class="caps"&gt;RHTML&lt;/span&gt;.
Like every scintilla-based editors, it sports a nice &lt;span class="caps"&gt;HTML&lt;/span&gt; multi-highlighter which allows you to keep putting all the Javascript, &lt;span class="caps"&gt;CSS&lt;/span&gt; and server-side scripting into the same file, &lt;span class="caps"&gt;GREAT&lt;/span&gt;! No, you probably wouldn&amp;#8217;t want to do that, but it&amp;#8217;s a good thing to have.&lt;/p&gt;


	&lt;h3&gt;Auto-completion&lt;/h3&gt;


	&lt;p&gt;What makes this editor a really handy tool is its auto-completion capabilities. Why? well, because it supports:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;Ruby: require, class modules (on . and ::), class variables and methods, method calltips.&lt;/li&gt;
		&lt;li&gt;Python&lt;/li&gt;
		&lt;li&gt;Perl&lt;/li&gt;
		&lt;li&gt;&lt;span class="caps"&gt;PHP&lt;/span&gt;&lt;/li&gt;
		&lt;li&gt;&lt;span class="caps"&gt;XSLT&lt;/span&gt;&lt;/li&gt;
		&lt;li&gt;&lt;span class="caps"&gt;XML&lt;/span&gt;&lt;/li&gt;
		&lt;li&gt;Tcl&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;Why is this so special? Well, because if you want this you normally need an &lt;span class="caps"&gt;IDE&lt;/span&gt;, and if you want it for Ruby &lt;span class="caps"&gt;AND&lt;/span&gt; Python &lt;span class="caps"&gt;AND&lt;/span&gt; Perl your choices are very limited. 
I played with the Ruby auto-completion features quite a bit, and I&amp;#8217;m actually really impressed.&lt;/p&gt;


	&lt;p style="float:right"&gt;&lt;img src="/files/komodo_auto-completion.png" alt="" /&gt;&lt;/p&gt;


	&lt;p&gt;It can suggest what to write through calltips after a &lt;code&gt;require&lt;/code&gt; directive, after a . and a ::, and hitting &lt;span class="caps"&gt;CTRL&lt;/span&gt;+SPACE (or just tab if you configure the right option) will auto-complete what you&amp;#8217;re writing, be it a language keyword, a variable of any kind or a method. Additionally, it comes with &amp;#8220;soft characters support&amp;#8221;, which means it will try to match ( [ { when possible, allowing you to &lt;em&gt;write over&lt;/em&gt; the completed character if you want to.&lt;/p&gt;


	&lt;h3&gt;Syntax Checking, Vi/Emacs key bindings and code folding&lt;/h3&gt;


	&lt;p&gt;The heading is almost self-explanatory here: Komodo Edit supports code folding (you can even chose the folding chracters!) for all its supported languages, syntax checking (it can detect and display errors before running the script, very useful in Ruby, and hard to find in other editors) and Vi/Emacs key bindings. 
It also offers &amp;#8220;vi emulation&amp;#8221;, which is constantly improving through every release &amp;#8211; so you won&amp;#8217;t forget Vim&amp;#8217;s keys when I don&amp;#8217;t use it: very nice, and again, hard to find in other editors, nevermind IDEs!&lt;/p&gt;


	&lt;h2&gt;Projects and Tools&lt;/h2&gt;


	&lt;p style="float:right"&gt;&lt;img src="/files/komodo_toolbox.png" alt="" /&gt;&lt;/p&gt;


	&lt;p&gt;The Project Browser and Toolbox are two features which are normally presents in IDEs and which are normally not found in editors. Granted, some editors like &lt;a href="http://www.pspad.com/en/"&gt;PSPad&lt;/a&gt; do indeed have &amp;#8220;projects&amp;#8221;, but most of the others don&amp;#8217;t. A &lt;em&gt;project&lt;/em&gt; in Komodo Edit is normally composed by:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;Some &lt;em&gt;Live Folders&lt;/em&gt; including all the source files of the application you&amp;#8217;re developing&lt;/li&gt;
		&lt;li&gt;An optional set of tools, commands, snippets and other goodies which may help you coding that particular application.&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;It is possible to create these tools by clicking the &lt;strong&gt;Add Item to current project&lt;/strong&gt; button in the Projects toolbar or by clicking the &lt;strong&gt;Add Item to Toolbox&lt;/strong&gt; button just over the toolbox. 
Either way, you can choose among the following:&lt;/p&gt;


	&lt;h4&gt;File/Remote File&lt;/h4&gt;


	&lt;p&gt;Add a file on your local machine or a remote file hosted on a server you configured via &lt;strong&gt;Edit &amp;gt; Preferences &amp;gt; Servers&lt;/strong&gt;. Supported protocols are: &lt;span class="caps"&gt;FTP&lt;/span&gt;,FTPS, &lt;span class="caps"&gt;SFTP&lt;/span&gt;, SCP.&lt;/p&gt;


	&lt;h4&gt;Folder&lt;/h4&gt;


	&lt;p&gt;This will &lt;em&gt;not&lt;/em&gt; link to a folder and import local files in Komodo, instead, it will create a container for other tools, not for local files.&lt;/p&gt;


	&lt;h4&gt;Live Folder&lt;/h4&gt;


	&lt;p&gt;On the contrary, a live folder links to an actual folder on your machines, and all files and directories inside it are automatically imported. Note that it is possible to choose to include or exclude certain files or directories from being imported by right-clicking the folder and editing its properties.&lt;/p&gt;


	&lt;h4&gt;Command&lt;/h4&gt;


	&lt;p&gt;This will create a shortcut to a command to execute. It is possible to specify its parameters, the directory where it will be run, whether its output will be displayed in the Command Output or in a newly-spawned console window, etc. etc.&lt;/p&gt;


	&lt;h4&gt;Snippet&lt;/h4&gt;


	&lt;p&gt;TextMate fans will love this. Komodo will let you create a code snippet for later use. Furthermore, it is possible to specify &amp;#8220;tabstops&amp;#8221; to automatically select certain words when tab is pressed (so you can effectively fill in only particular fields of the snippet).&lt;/p&gt;


	&lt;h4&gt;Template&lt;/h4&gt;


	&lt;p&gt;A simple but effective way to create code templates.&lt;/p&gt;


	&lt;h4&gt;Url&lt;/h4&gt;


	&lt;p&gt;A link which will open a given url.&lt;/p&gt;


	&lt;h4&gt;Open&amp;#8230; Shortcut&lt;/h4&gt;


	&lt;p&gt;This will popup an &lt;strong&gt;Open File&lt;/strong&gt; dialog in a direcxtory of your choice.&lt;/p&gt;


	&lt;h4&gt;Macro&lt;/h4&gt;


	&lt;p&gt;For those who require even more customization, it is also possible to record or code macros in Python or javascript, and then configure their key bindings and triggers.&lt;/p&gt;


	&lt;h4&gt;Custom Menu/Custom toolbar&lt;/h4&gt;


	&lt;p&gt;This was really impressive. Sure you can group all your tools in folders in your current project or you can create them in the toolbox to make them available all the time, but it would be cool if &lt;em&gt;the editor itself&lt;/em&gt; could make those tools available by default in a toolbar or a menu. Well, that&amp;#8217;s possible: all you need to do is create a new custom menu or toolbar and populate it with your tools by drag and drop. Very, very nice!&lt;/p&gt;


	&lt;p&gt;This mini-framework to create custom tools can be used to create project templates in a blink. To show this concept, Komodo Edit comes with a Rails template with almost all the tools you need when coding a Ruby on Rails application:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;Create/delete database&lt;/li&gt;
		&lt;li&gt;Generators&lt;/li&gt;
		&lt;li&gt;Migrations&lt;/li&gt;
		&lt;li&gt;Run server&lt;/li&gt;
		&lt;li&gt;Example view snippets&lt;/li&gt;
	&lt;/ul&gt;


	&lt;h2&gt;Conclusion&lt;/h2&gt;


	&lt;p&gt;Komodo Edit is an interesting editor which offers a lot of features which are normally only available in IDEs at a smaller memory footprint. Granted, when I want to jot something down I still prefer to fire up gVim, but for a serious coding session, Komodo is the right choice.
Its close attention to details and its ease of use make developing an even more pleasant experience, although perhaps there&amp;#8217;s still room for improvement, if you&amp;#8217;re really fussy.&lt;/p&gt;


	&lt;p&gt;Sometimes when you start getting used of its advanced features, the lack of a code browser seems a real shame, but after all, ActiveState must sell their &lt;span class="caps"&gt;IDE&lt;/span&gt; to someone at some point!&lt;/p&gt;


	&lt;p&gt;Another thing which I would have liked is the ability to create new syntax highlighting schemes, which Notepad++ and &lt;span class="caps"&gt;VIM&lt;/span&gt; both offer. Whydoes it bothers me so much? Well, because I&amp;#8217;d like a &lt;a href="http://textism.com/tools/textile/"&gt;Textile&lt;/a&gt; syntax highlighting scheme for writing blogs and articles. &lt;span class="caps"&gt;VIM&lt;/span&gt; and Intype seem to be the only ones which offer it out-of-the-box, but there&amp;#8217;s no trace of it in Komodo Edit.&lt;/p&gt;


	&lt;p&gt;Actually it is possible to create new syntax highlighting schemes and extend Komodo Edit via &lt;a href="http://community.activestate.com/addons"&gt;&lt;span class="caps"&gt;XUL&lt;/span&gt; extensions&lt;/a&gt;, exactly like Firefox. After a closer look, the Django syntax was added in this way.&lt;/p&gt;


	&lt;p&gt;Unfortunately there aren&amp;#8217;t that many extensions available for Komodo Edit, yet, but the &lt;a href="http://community.activestate.com/"&gt;Activestate Community&lt;/a&gt; seems very active, so you never know. Additionally, the recently-started &lt;a href="http://www.openkomodo.com/"&gt;OpenKomodo&lt;/a&gt; is a new project created by ActiveState to &amp;#8220;[&amp;#8230;] create an open source platform for building developer environments. ActiveState has open-sourced elements of Komodo Edit, a free multi-language editor for dynamic languages based on Komodo &lt;span class="caps"&gt;IDE&lt;/span&gt;, to create the Open Komodo code base&amp;#8221;. A new competitor for Eclipse and Netbeans will be available soon?&lt;/p&gt;


	&lt;p&gt;&lt;a href="http://digg.com/programming/A_closer_look_at_Komodo_Edit"&gt;
&lt;img src="http://digg.com/img/badges/180x35-digg-button.png" width="180" height="35" alt="Digg!" /&gt;
&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Sun, 25 Nov 2007 07:23:00 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:3ab60ff4-d775-4e62-afdd-c7c9175114aa</guid>
      <author>h3rald</author>
      <link>http://www.h3rald.com/articles/komodo-edit-review</link>
      <category>Articles</category>
      <category>review</category>
      <category>programming</category>
      <category>software</category>
      <trackback:ping>http://www.h3rald.com/trackback/entries/141</trackback:ping>
    </item>
    <item>
      <title>Book Review: Humble Little Ruby Book</title>
      <description>&lt;p&gt;After reading the very first paragraph of Mr. Neighborly&amp;#8217;s &lt;a href="http://www.humblelittlerubybook.com/"&gt;Humble Little Ruby Book&lt;/a&gt; (HLRB for short, from now on) it was very clear to me that it was going to be quite an unconventional read:&lt;/p&gt;


&lt;blockquote&gt;
&amp;#8220;Yes, there is a Chapter 0.  There is a little bit of introductory stuff we need to talk about before 
we set you loose on Ruby.  You wouldn&amp;#8217;t want to get psyched about a new gadget, get it home, 
and then figure out you need batteries, a grapefruit, and the ability to speak three  languages to 
even open the box would you?&amp;#8221; 
&lt;/blockquote&gt;

	&lt;p&gt;That reminded me immediately of &lt;a href="http://poignantguide.net/ruby/"&gt;Why&amp;#8217;s Poignant Guide to Ruby&lt;/a&gt;. without a doubt. I don&amp;#8217;t know how it is possible that two witty, crazy, and very inventive guys grew fond of the same programming language. Anyhow, to reassure a few of you, you won&amp;#8217;t find any foxes or chunky bacon cartoons in &lt;span class="caps"&gt;HLRB&lt;/span&gt;, just some very well made (although still pretty unconventional) diagrams like this one:&lt;/p&gt;


	&lt;p&gt;&lt;img src="/files/hlrb_diagram.png" alt="" /&gt;&lt;/p&gt;


	&lt;p&gt;Got the picture? Good. Let&amp;#8217;s move on&amp;#8230;&lt;/p&gt;


	&lt;h3&gt;Chapter 0: What&amp;#8217;chu talkin&amp;#8217; &amp;#8216;bout, mister?&lt;/h3&gt;


	&lt;p&gt;Chapter 0 is like an introduction to the book &lt;em&gt;and&lt;/em&gt; a place to put all the boring stuff you have to talk about in a book about a programming language:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;What is Ruby?&lt;/li&gt;
		&lt;li&gt;Installation procedure (on Windows, Mac &lt;span class="caps"&gt;OS X&lt;/span&gt; and Linux)&lt;/li&gt;
		&lt;li&gt;Hello, World!&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;Yes, you can skip this one safely without losing too much, unless of course you still need to install Ruby on your machine.&lt;/p&gt;


	&lt;h3&gt;Chapter 1: Welcome to Ruby.&lt;/h3&gt;


&lt;blockquote&gt;
&amp;#8220;This  section  aims  to  introduce  the  syntactic  sugar  and  linguistic  misfortunes  of  Ruby  in  the 
quickest manner that will still allow  for a full  education on the subject.&amp;#8221; 
&lt;/blockquote&gt;

	&lt;p&gt;As the first two lines of this chapter say, it&amp;#8217;s time to learn the basics of Ruby. You&amp;#8217;ll be quickly guided through strings, numbers, collections and variables. Every section with tons of code examples for your to play with. You won&amp;#8217;t find a full list of all the 876 methods of the String class, but you&amp;#8217;ll certainly learn the 10 most common ones at least (numbers are random, so no, don&amp;#8217;t count them). 
Sure, yes, right, whatever&amp;#8230; &lt;em&gt;if you really want&lt;/em&gt; you can skip this chapter too, but if you are already a Ruby Guru there&amp;#8217;s probably no need for you to read books about Ruby, right? Beginners need to read this chapter. It&amp;#8217;s compulsory, really, and pretty enjoyable, too.&lt;/p&gt;


	&lt;h3&gt;Chapter 2: Break it down now!&lt;/h3&gt;


	&lt;p&gt;Or &amp;#8220;learn how to segment your code&amp;#8221; using methods, and&amp;#8230; blocks &amp;#38; &lt;code&gt;Proc&lt;/code&gt; objects! Gosh. Our poor newbies will probably have a heart attack if they never heard about blocks and closures before. I almost got scared myself, because this is normally regarded as a pretty tough topic. Despite, at page 25 of the book you&amp;#8217;ll have to face your fears and dive into it. You&amp;#8217;ll survive, anyway.&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;Purist Warning:&lt;/strong&gt; Please be aware that sometimes the author may decide to use certain terms and construct which may not sound 100% right to your ears. Just move on, beginners will understand more things like &lt;em&gt;&amp;#8220;Think of Proc objects as blocks that are pushed into variables.&amp;#8221;&lt;/em&gt; than anything else, guaranteed.&lt;/p&gt;


	&lt;p&gt;After this section you&amp;#8217;ll finally be introduced to Ruby classes. Now, this can piss someone off, no doubt. Ruby is a &lt;em&gt;fully OO language&lt;/em&gt;, so people &lt;em&gt;must&lt;/em&gt; learn about classes before anything else. I must admit I was a bit confused by the ordering of the topics at first, but if someone comes from a non-OO background he&amp;#8217;ll probably find this particular order more suitable. 
This section will cover class and object basics in Ruby like defining classes, instantiating objects, access control, methods, attributes, scope, duck typing. Finally, you&amp;#8217;ll briefly look into modules as well.&lt;/p&gt;


	&lt;h3&gt;Chapter 3: Hustle and flow (control)&lt;/h3&gt;


	&lt;p&gt;Finally, the author will deal with flow control. So things like &lt;code&gt;if&lt;/code&gt;, &lt;code&gt;case&lt;/code&gt;, conditional operators, loops and statement modifiers. In my opinion this section is truly excellent: it introduces all the control structures in a very simple and crystal clear way, often using flowcharts. A great chance even for absolute beginners to understand these basic but powerful concepts.
Towards the end of the chapter, you&amp;#8217;ll also learn how exceptions work: a clever way to tell people &amp;#8220;you have to learn how to use exceptions from the very beginning&amp;#8221;. Really nicely done.&lt;/p&gt;


	&lt;h3&gt;Chapter 4: The system beneath&amp;#8230;&lt;/h3&gt;


	&lt;p&gt;Here comes the juicy stuff. Up to now you learnt the usual boring things you need to know when learning a new programming language, now finally you learn how to do &lt;em&gt;real things&lt;/em&gt;. The chapter is full of complete and meaningful code snippets which will answer nearly all the questions you may have (at this time):&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;How do I read and write to a file?&lt;/li&gt;
		&lt;li&gt;How do I handle threads and processes?&lt;/li&gt;
		&lt;li&gt;How do command-line parameters and environment variables work?&lt;/li&gt;
		&lt;li&gt;How can I perform specific Windows-only operations, like reading and writing to the Registry? What about &lt;span class="caps"&gt;OLE&lt;/span&gt; automation?&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;Some of the big books out there will not spend too much time talking about Windows-only libraries, but I found &lt;span class="caps"&gt;HLRB&lt;/span&gt; gives quite a comprehensive introduction about them.&lt;/p&gt;


	&lt;h3&gt;Chapter 5: Looking beyond home&lt;/h3&gt;


	&lt;p&gt;More juicy stuff. If you are looking for a tutorial to learn the basics about networking, from from sockets to &lt;span class="caps"&gt;FTP&lt;/span&gt; to &lt;span class="caps"&gt;POP&lt;/span&gt; and web services, look no further: this chapter does a very remarkable job introducing various network-related libraries, with the usual well written code examples.
If that&amp;#8217;s still not enough, you&amp;#8217;ll also have a chance to explore the wonderful world of distributed Ruby and of databases. Granted, this chapter won&amp;#8217;t tell you about the 1567 methods available in ActiveRecord (buy a copy of &lt;a href="http://www.pragmaticprogrammer.com/title/rails/"&gt;Agile Web Development with Rails&lt;/a&gt; for this), but will tell you enough to get started.&lt;/p&gt;


	&lt;h3&gt;Chapter 6: It&amp;#8217;s a Library!&lt;/h3&gt;


	&lt;p&gt;The final chapter will go more in depth on some more advanced topics, like:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;Strings&lt;/li&gt;
		&lt;li&gt;Regexp &lt;/li&gt;
		&lt;li&gt;Date &amp;#38; Time &lt;/li&gt;
		&lt;li&gt;Hashing and Cryptography&lt;/li&gt;
		&lt;li&gt;Unit Testing&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;Everything with more and more useful code snippets.&lt;/p&gt;


	&lt;h3&gt;The Appendices&lt;/h3&gt;


	&lt;p&gt;Last but not least, a &lt;span class="caps"&gt;HUGE&lt;/span&gt; collection of links and resources to learn more about Ruby, and a quick digression on C/C++ extensions&amp;#8230; not much, but enough to wet your appetite.&lt;/p&gt;


	&lt;h3&gt;The bottom line&lt;/h3&gt;


	&lt;p&gt;&lt;span class="caps"&gt;HLRB&lt;/span&gt; is not &lt;em&gt;the only&lt;/em&gt; book you need to read about Ruby. It&amp;#8217;s better to make this clear otherwise I&amp;#8217;ll be hunted forever by Dave Thomas, Chad Fowler, &lt;span class="caps"&gt;DHH&lt;/span&gt; and all the other excellent Ruby hackers who also wrote very successful books (which I bought as well). &lt;span class="caps"&gt;HLRB&lt;/span&gt; is &lt;span class="caps"&gt;LITTLE&lt;/span&gt; and &lt;span class="caps"&gt;HUMBLE&lt;/span&gt;, after all: it doesn&amp;#8217;t aim at becoming the official Ruby Bible anytime soon (although a bird told me it may get updated &lt;em&gt;someday&lt;/em&gt; and include more stuff), but it is still a worthwhile reading.&lt;/p&gt;


	&lt;p&gt;And of course I came to the very end of this review without mentioning the most important thing: this little wonder is free. All you need is to register to InfoQ (for free) and grab your &lt;a href="http://www.infoq.com/minibooks/ruby/"&gt;free copy&lt;/a&gt;. If you want you can buy a printed copy for just $9.95, if you feel in a good mood (please do).&lt;/p&gt;


	&lt;p&gt;The most obvious strengths of this book are the abundance of code examples and very useful working snippets, and the unconventional style which makes it very readable and not boring at all. If I were to name some of its weaknesses (but only if you force me to), I&amp;#8217;d say some parts should be expanded and more info on other libraries should be provided&amp;#8230; but you never know what the future will bring us!&lt;/p&gt;


	&lt;p&gt;Well done, &lt;a href="http://www.jeremymcanally.com/"&gt;Mr. Neighborly&lt;/a&gt;!&lt;/p&gt;</description>
      <pubDate>Wed, 03 Oct 2007 05:53:00 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:a602288d-a24f-4d66-a850-f6a7717513aa</guid>
      <author>h3rald</author>
      <link>http://www.h3rald.com/articles/hlrb-review</link>
      <category>Articles</category>
      <category>ruby</category>
      <category>review</category>
      <category>books</category>
      <trackback:ping>http://www.h3rald.com/trackback/entries/124</trackback:ping>
    </item>
    <item>
      <title>RedBook - A simple Ruby program for your daily logging needs</title>
      <description>&lt;p&gt;Logging your daily activities is important. If you don&amp;#8217;t believe me you&amp;#8217;d better check at least these three posts on LifeHacker, which feature different scripts and applications:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;a href="http://lifehacker.com/software/top/geek-to-live--quick+log-your-work-day-189772.php"&gt;QuickLogger&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href="http://lifehacker.com/software/windows/log-your-workday-from-the-system-tray-with-life-logger-285602.php"&gt;Life Logger&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href="http://lifehacker.com/software/featured-windows-download/log-your-workday-with-quicklogger-2-302932.php"&gt;QuickLogger 2&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;I had a look at each one of them, and I believe they are quite useful, although I didn&amp;#8217;t really find what I was looking for. Why? Well, for example:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;I don&amp;#8217;t believe a &lt;span class="caps"&gt;GUI&lt;/span&gt; is necessary&amp;#8212;you&amp;#8217;d better off with just a shortcut key or command to run from Launchy or QuickSilver, that&amp;#8217;s much faster.&lt;/li&gt;
		&lt;li&gt;They just log timestamped messages on a file, there&amp;#8217;s no real way to search through them and display them except by using a test editor&lt;/li&gt;
		&lt;li&gt;They are Windows only&amp;#8212;not that it matters for me, but others may not be happy about it.&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;That&amp;#8217;s why I thought I&amp;#8217;d roll out my own: meet &lt;a href="http://www.assembla.com/space/redbook"&gt;RedBook&lt;/a&gt;.
Let me say it&amp;#8217;s nothing fancy: I&amp;#8217;m not a full-time programmer but I do like playing with Ruby during my lunch breaks at work, so that&amp;#8217;s why RedBook is just a humble, tiny Ruby script. This automatically makes it cross-platform: you can install Ruby very easily on Linux &amp;#38; alikes, Mac &lt;span class="caps"&gt;OS X&lt;/span&gt; and Windows. Furthermore, if you are on Windows and for some weird reason you don&amp;#8217;t want to install Ruby, you can just try out the packed &lt;span class="caps"&gt;EXE&lt;/span&gt; file (made with RubyScript2Exe)&amp;#8212;it&amp;#8217;s about 2MB, but you won&amp;#8217;t need anything else.&lt;/p&gt;


	&lt;h3&gt;How It Works&lt;/h3&gt;


	&lt;p&gt;The program uses two &lt;span class="caps"&gt;YAML&lt;/span&gt; files, one for configuration, which must reside in the same directory as redbook.rb (or redboo.exe) and one for the log itself, which you can place anywhere, provided that you edit the configuration file accordingly. For information on how to install RedBook and how to configure it, you can check the manual.html (powered by &lt;a href="http://www.tiddlywiki.com"&gt;TiddlyWiki&lt;/a&gt;) file provided with the program or &lt;a href="http://redbook.h3rald.com"&gt;browse it online&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;When started, RedBook will load both the configuration file (config.yml) and &lt;em&gt;the whole log file&lt;/em&gt; into memory&amp;#8212;it&amp;#8217;s not a big deal, considering that they are only text files after all. I did a test with a log of quite a few MBs, and it was fine.&lt;/p&gt;


	&lt;p&gt;You can then start input commands right away, following a few sample rules. RedBook has a (very) rudimentary parser which is able to detect keywords, i.e. alphabetic strings prepended with a colon. RedBook commands look like this:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;strong&gt;&amp;#58;log&lt;/strong&gt; This message will be logger &lt;strong&gt;&amp;#58;tags&lt;/strong&gt; tag1 tag2 &lt;/li&gt;
		&lt;li&gt;&lt;strong&gt;&amp;#58;select&lt;/strong&gt; &lt;strong&gt;&amp;#58;last&lt;/strong&gt; 15 &lt;strong&gt;&amp;#58;since&lt;/strong&gt; January&lt;/li&gt;
		&lt;li&gt;&lt;strong&gt;&amp;#58;save&lt;/strong&gt; /home/h3rald/backup.yml&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;If everything goes OK, RedBook will reply with some sort of response, an acknowledgement, a list of messages, etc.&lt;/p&gt;


	&lt;p&gt;Simple.&lt;/p&gt;


	&lt;p&gt;Here&amp;#8217;s basically what the program can do:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;Log any message to the main log file. Messages can be tagged with one or more tags and will be automatically timestamped.&lt;/li&gt;
		&lt;li&gt;Load/display a list of logged messages on the screen. It is possible to filter messages by specifying a time span, a string to search in the message text, or a list of tags.&lt;/li&gt;
		&lt;li&gt;Dump loaded messages to a &lt;span class="caps"&gt;TXT&lt;/span&gt;, CSV or &lt;span class="caps"&gt;YAML&lt;/span&gt; file (you can even backup your log saving it to another &lt;span class="caps"&gt;YAML&lt;/span&gt; file in this way).&lt;/li&gt;
		&lt;li&gt;Calculate the time elapsed between two or more tasks. Time will be displayed in years, months, weeks, days, hours, minutes and/or seconds as necessary.&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;How? Here&amp;#8217;s a short tutorial&amp;#8230;&lt;/p&gt;


	&lt;h3&gt;A Quick RedBook Tutorial&lt;/h3&gt;


	&lt;p&gt;Let&amp;#8217;s assume you are able to run RedBook on your system by now (if you can&amp;#8217;t find some of the gems which are required for it, you can download them packed in a &lt;span class="caps"&gt;ZIP&lt;/span&gt; file from &lt;a href="http://www.assembla.com/spaces/files/redbook"&gt;here&lt;/a&gt;).&lt;/p&gt;


	&lt;p&gt;Here&amp;#8217;s what happens when you start the program:&lt;/p&gt;


	&lt;p&gt;&lt;span style="font-family: 'Bitstream Vera Sans Mono', Monaco, 'Courier New'; font-size: 10px"&gt;
&lt;del&gt;-&lt;/del&gt;&lt;br /&gt;
RedBook v0.1 &amp;#8211; Copyright&amp;#169; 2007, Fabio Cevasco&lt;br /&gt;
&lt;del&gt;-&lt;/del&gt;&lt;br /&gt;
   &lt;span style="color:blue"&gt;&amp;gt;&amp;gt;&lt;/span&gt; Loading config file&amp;#8230;&lt;br /&gt;
   &lt;span style="color:green"&gt;&amp;gt;&amp;gt;&lt;/span&gt; Config file loaded.&lt;br /&gt;
   &lt;span style="color:blue"&gt;&amp;gt;&amp;gt;&lt;/span&gt; Loading log file&amp;#8230;&lt;br /&gt;
   &lt;span style="color:green"&gt;&amp;gt;&amp;gt;&lt;/span&gt; Log file loaded.&lt;br /&gt;
   &lt;span style="color:blue"&gt;&amp;gt;&amp;gt;&lt;/span&gt; Ready.&lt;br /&gt;
&lt;span style="color:red"&gt;Red&lt;/span&gt;Book &amp;gt;&amp;gt;&lt;br /&gt;
&lt;/code&gt;
&lt;/span&gt;&lt;/p&gt;


	&lt;p&gt;Good. Let&amp;#8217;s start logging something then. Just use the &lt;strong&gt;&amp;#58;log&lt;/strong&gt; keyword, followed by a message, and then you can also add the &lt;strong&gt;&amp;#58;tags&lt;/strong&gt; keyword followed by space-separated tags, like this:&lt;/p&gt;


	&lt;p&gt;&lt;span style="font-family: 'Bitstream Vera Sans Mono', Monaco, 'Courier New'; font-size: 10px"&gt;
&lt;span style="color:red"&gt;Red&lt;/span&gt;Book &amp;gt;&amp;gt; &amp;#58;log My first message &amp;#58;tags test&lt;br /&gt;
   &lt;span style="color:green"&gt;&amp;gt;&amp;gt;&lt;/span&gt; Logged.&lt;br /&gt;
&lt;span style="color:red"&gt;Red&lt;/span&gt;Book &amp;gt;&amp;gt; &amp;#58;log This is another message&lt;br /&gt;
   &lt;span style="color:green"&gt;&amp;gt;&amp;gt;&lt;/span&gt; Logged.&lt;br /&gt;
&lt;span style="color:red"&gt;Red&lt;/span&gt;Book &amp;gt;&amp;gt; &amp;#58;log This is another message &amp;#58;tags test another_test&lt;br /&gt;
   &lt;span style="color:green"&gt;&amp;gt;&amp;gt;&lt;/span&gt; Logged.&lt;br /&gt;
&lt;/span&gt;&lt;/p&gt;


	&lt;p&gt;Try waiting a few seconds between each message. These three messages will be appended to the log file. You could open it in an editor, but it&amp;#8217;s normally easier to display them directly inside RedBook, like this:&lt;/p&gt;


	&lt;p&gt;&lt;span style="font-family: 'Bitstream Vera Sans Mono', Monaco, 'Courier New'; font-size: 10px"&gt;
&lt;span style="color:red"&gt;Red&lt;/span&gt;Book &amp;gt;&amp;gt; &amp;#58;select&lt;br /&gt;
 &lt;span style="color:yellow"&gt;1&lt;/span&gt; &lt;span style="color:blue"&gt;Sat Sep 29 2007 &amp;#8211; 09:09:32 PM&lt;/span&gt; My first message &lt;span style="color:cyan"&gt;[&lt;/span&gt;&lt;span style="color:yellow"&gt;test&lt;/span&gt;&lt;span style="color:cyan"&gt;]&lt;/span&gt;&lt;br /&gt;
 &lt;span style="color:yellow"&gt;2&lt;/span&gt; &lt;span style="color:blue"&gt;Sat Sep 29 2007 &amp;#8211; 09:10:51 PM&lt;/span&gt; This is another message&lt;br /&gt;
 &lt;span style="color:yellow"&gt;3&lt;/span&gt; &lt;span style="color:blue"&gt;Sat Sep 29 2007 &amp;#8211; 09:11:45 PM&lt;/span&gt; This is another message &lt;span style="color:cyan"&gt;[&lt;/span&gt;&lt;span style="color:yellow"&gt;test&lt;/span&gt;&lt;span style="color:cyan"&gt;]&lt;/span&gt;&lt;span style="color:cyan"&gt;[&lt;/span&gt;&lt;span style="color:yellow"&gt;another_test&lt;/span&gt;&lt;span style="color:cyan"&gt;]&lt;/span&gt;&lt;br /&gt;
   &lt;span style="color:green"&gt;&amp;gt;&amp;gt;&lt;/span&gt; 3 messages loaded.&lt;br /&gt;
&lt;/span&gt;&lt;/p&gt;


	&lt;p&gt;Easy. What if you have hundreds of messages? Well, the &amp;#58;select operation can take an optional search string, or you can tell RedBook to load only those messages tagged with one or more specific tags, like this:&lt;/p&gt;


	&lt;p&gt;&lt;span style="font-family: 'Bitstream Vera Sans Mono', Monaco, 'Courier New'; font-size: 10px"&gt;
&lt;span style="color:red"&gt;Red&lt;/span&gt;Book &amp;gt;&amp;gt; &amp;#58;select &amp;#58;tags test&lt;br /&gt;
 &lt;span style="color:yellow"&gt;1&lt;/span&gt; &lt;span style="color:blue"&gt;Sat Sep 29 2007 &amp;#8211; 09:09:32 PM&lt;/span&gt; My first message &lt;span style="color:cyan"&gt;[&lt;/span&gt;&lt;span style="color:yellow"&gt;test&lt;/span&gt;&lt;span style="color:cyan"&gt;]&lt;/span&gt;&lt;br /&gt;
  &lt;span style="color:yellow"&gt;3&lt;/span&gt; &lt;span style="color:blue"&gt;Sat Sep 29 2007 &amp;#8211; 09:11:45 PM&lt;/span&gt; This is another message &lt;span style="color:cyan"&gt;[&lt;/span&gt;&lt;span style="color:yellow"&gt;test&lt;/span&gt;&lt;span style="color:cyan"&gt;]&lt;/span&gt;&lt;span style="color:cyan"&gt;[&lt;/span&gt;&lt;span style="color:yellow"&gt;another_test&lt;/span&gt;&lt;span style="color:cyan"&gt;]&lt;/span&gt;&lt;br /&gt;
    &lt;span style="color:green"&gt;&amp;gt;&amp;gt;&lt;/span&gt; 2 messages loaded.&lt;br /&gt;
&lt;/span&gt;&lt;/p&gt;


	&lt;p&gt;Or you can use the &amp;#58;from and/or &amp;#58;to keywords to specify a certain time frame, like this:&lt;/p&gt;


	&lt;p&gt;&amp;#58;select &amp;#58;tags test &lt;strong&gt;&amp;#58;from ten minutes ago&lt;/strong&gt;&lt;/p&gt;


	&lt;p&gt;&amp;#58;select &lt;strong&gt;&amp;#58;from last week &amp;#58;to 2 days ago&lt;/strong&gt;&lt;/p&gt;


	&lt;p&gt;RedBook includes a very nice &amp;#8220;natural language date/time parser&amp;#8221;, &lt;a href="http://chronic.rubyforge.org/"&gt;Chronic&lt;/a&gt; which is able to convert sentences like the following into Ruby Time objects:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;6 in the morning&lt;/li&gt;
		&lt;li&gt;friday 1pm&lt;/li&gt;
		&lt;li&gt;sat 7 in the evening&lt;/li&gt;
		&lt;li&gt;today&lt;/li&gt;
		&lt;li&gt;yesterday at 4:00&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;It&amp;#8217;s not perfect (and it&amp;#8217;s in pre-alpha as well), but it does the job, for what I can see, and it makes it very easy and fast to specify timeframes.&lt;/p&gt;


	&lt;p&gt;After executing a &amp;#58;select command, two other operations can be performed on the loaded messages: &lt;strong&gt;&amp;#58;calc&lt;/strong&gt; and &lt;strong&gt;&amp;#58;save&lt;/strong&gt;.&lt;/p&gt;


	&lt;p&gt;&amp;#58;calc calculates the exact amount of time elapsed between two or more tasks. Do you remember the numbers on the far left of each message? Think them as temporary IDs for the actual messages, and you can use them to select specific tasks when executing the &amp;#58;calc operation:&lt;/p&gt;


	&lt;p&gt;&lt;span style="font-family: 'Bitstream Vera Sans Mono', Monaco, 'Courier New'; font-size: 10px"&gt;
&lt;span style="color:red"&gt;Red&lt;/span&gt;Book &amp;gt;&amp;gt; &amp;#58;calc 1 3&lt;br /&gt;
 &lt;span style="color:yellow"&gt;1&lt;/span&gt; &lt;span style="color:blue"&gt;Sat Sep 29 2007 &amp;#8211; 09:09:32 PM&lt;/span&gt; My first message &lt;span style="color:cyan"&gt;[&lt;/span&gt;&lt;span style="color:yellow"&gt;test&lt;/span&gt;&lt;span style="color:cyan"&gt;]&lt;/span&gt;&lt;br /&gt;
      &lt;del&gt;-&lt;/del&gt; 2 minutes and 13 seconds.&lt;br /&gt;
       &lt;span style="color:yellow"&gt;3&lt;/span&gt; &lt;span style="color:blue"&gt;Sat Sep 29 2007 &amp;#8211; 09:11:45 PM&lt;/span&gt; This is another message &lt;span style="color:cyan"&gt;[&lt;/span&gt;&lt;span style="color:yellow"&gt;test&lt;/span&gt;&lt;span style="color:cyan"&gt;]&lt;/span&gt;&lt;span style="color:cyan"&gt;[&lt;/span&gt;&lt;span style="color:yellow"&gt;another_test&lt;/span&gt;&lt;span style="color:cyan"&gt;]&lt;/span&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/p&gt;


	&lt;p&gt;Similarly, if no IDs are specified, &amp;#58;calc calculates the time difference between each message and the previous:&lt;/p&gt;


	&lt;p&gt;&lt;span style="font-family: 'Bitstream Vera Sans Mono', Monaco, 'Courier New'; font-size: 10px"&gt;
&lt;span style="color:red"&gt;Red&lt;/span&gt;Book &amp;gt;&amp;gt; &amp;#58;calc&lt;br /&gt;
 &lt;span style="color:yellow"&gt;1&lt;/span&gt; &lt;span style="color:blue"&gt;Sat Sep 29 2007 &amp;#8211; 09:09:32 PM&lt;/span&gt; My first message &lt;span style="color:cyan"&gt;[&lt;/span&gt;&lt;span style="color:yellow"&gt;test&lt;/span&gt;&lt;span style="color:cyan"&gt;]&lt;/span&gt;&lt;br /&gt; 
      &lt;del&gt;-&lt;/del&gt; 1 minute and 19 seconds.&lt;br /&gt;      
 &lt;span style="color:yellow"&gt;2&lt;/span&gt; &lt;span style="color:blue"&gt;Sat Sep 29 2007 &amp;#8211; 09:10:51 PM&lt;/span&gt; This is another message&lt;br /&gt; 
      &lt;del&gt;-&lt;/del&gt; 54 seconds.&lt;br /&gt;      
 &lt;span style="color:yellow"&gt;3&lt;/span&gt; &lt;span style="color:blue"&gt;Sat Sep 29 2007 &amp;#8211; 09:11:45 PM&lt;/span&gt; This is another message &lt;span style="color:cyan"&gt;[&lt;/span&gt;&lt;span style="color:yellow"&gt;test&lt;/span&gt;&lt;span style="color:cyan"&gt;]&lt;/span&gt;&lt;span style="color:cyan"&gt;[&lt;/span&gt;&lt;span style="color:yellow"&gt;another_test&lt;/span&gt;&lt;span style="color:cyan"&gt;]&lt;/span&gt;&lt;br /&gt;
 &lt;/span&gt;&lt;/p&gt;


	&lt;p&gt;Finally, you can save loaded messages to a &lt;span class="caps"&gt;TXT&lt;/span&gt;, YAML or &lt;span class="caps"&gt;CSV&lt;/span&gt; file, as follows:&lt;/p&gt;


	&lt;p&gt;&lt;span style="font-family: 'Bitstream Vera Sans Mono', Monaco, 'Courier New'; font-size: 10px"&gt;
&lt;span style="color:red"&gt;Red&lt;/span&gt;Book &amp;gt;&amp;gt; &amp;#58;save log.txt&lt;br /&gt;
   &lt;span style="color:blue"&gt;&amp;gt;&amp;gt;&lt;/span&gt; Saving&amp;#8230;&lt;br /&gt;
   &lt;span style="color:green"&gt;&amp;gt;&amp;gt;&lt;/span&gt; Saved dataset to &amp;#8220;log.txt&amp;#8221;&lt;br /&gt;
&lt;/span&gt;
h
If you want to backup your log, you can load all messages and then save them to a &lt;span class="caps"&gt;YAML&lt;/span&gt; file. Maybe in this case you want to append the &lt;strong&gt;&amp;#58;silent&lt;/strong&gt; keyword to the &amp;#58;select command, so that messages won&amp;#8217;t be displayed on the screen.&lt;/p&gt;


	&lt;h3&gt;Conclusion&lt;/h3&gt;


	&lt;p&gt;RedBook is just a simple program: it suits my needs for now, but of course there&amp;#8217;s roo for improvement. If you have some useful suggestions, or you want to contribute in some way, feel free to contact me!&lt;/p&gt;


	&lt;p style="text-align:center;"&gt;&lt;a href="http://redbook.h3rald.com"&gt;Home Page&lt;/a&gt; | &lt;a href="http://code.google.com/p/redbook/"&gt;Development&lt;/a&gt; | &lt;a href="http://code.google.com/p/redbook/downloads/list"&gt;Download&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Sat, 29 Sep 2007 14:05:00 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:f9dc3f7e-50e4-43cc-9a1c-b548934f0e03</guid>
      <author>h3rald</author>
      <link>http://www.h3rald.com/articles/redbook</link>
      <category>Articles</category>
      <category>ruby</category>
      <category>productivity</category>
      <category>software</category>
      <category>tools</category>
      <category>redbook</category>
      <trackback:ping>http://www.h3rald.com/trackback/entries/123</trackback:ping>
    </item>
    <item>
      <title>10 Reasons to Learn Ruby</title>
      <description>&lt;h3&gt;Preamble&lt;/h3&gt;


	&lt;p&gt;I discovered Ruby fairly recently, through the excellent Ruby on Rails framework&lt;sup&gt;&lt;a href="#fn1"&gt;1&lt;/a&gt;&lt;/sup&gt;. Although I don&amp;#8217;t consider myself a Ruby expert by any means, I read the PickAxe&lt;sup&gt;&lt;a href="#fn2"&gt;2&lt;/a&gt;&lt;/sup&gt;, I&amp;#8217;ve coded a few utilities for my personal use in Ruby and I&amp;#8217;m currently developing with Rails during my free time. 
Ruby is currently my programming language of choice; I started off with Turbo Pascal in high school, discovered C and C++ at university, did my thesis in Java and learned &lt;span class="caps"&gt;PHP&lt;/span&gt; from scratch because I wanted to learn how to make websites quickly and easily. I guess I feel compelled to code sometimes, more as a form of entertainment than anything else.  Rather dissatisfied with what I tried language-wise, I was determined to start learning either Python or Ruby. I chose the latter because I didn&amp;#8217;t want incorrect indentation to break my code&lt;sup&gt;&lt;a href="#fn3"&gt;3&lt;/a&gt;&lt;/sup&gt;, and here I am, heaping praise upon it.&lt;/p&gt;


	&lt;p&gt;There are plenty&lt;sup&gt;&lt;a href="#fn4"&gt;4&lt;/a&gt;&lt;/sup&gt; of introductions, tutorials, articles and essays of different sorts which aim to guide the novice and advise the guru on how to get the most out of Ruby. This article, however, is not one of them.&lt;/p&gt;


	&lt;p&gt;It&amp;#8217;s more of a modest, humble, and incomplete list of a few reasons which may (or may not) entice you to use Ruby or at least play with it a bit. A word of caution: if you are using another programming language for work or whatever, don&amp;#8217;t complain to me if you don&amp;#8217;t want to use it anymore &amp;#8211; that&amp;#8217;s exactly what happened to me, but luckily, it didn&amp;#8217;t matter.  Ruby is a very beautiful and elegant language, but like all things of this sort, it may well poison your mind and corrupt your soul&amp;#8230;&lt;/p&gt;


	&lt;p&gt;You have been warned.&lt;/p&gt;


	&lt;h3&gt;Why learn Ruby?&lt;/h3&gt;


	&lt;h4&gt;#1 &amp;#8211; You get all the treats without the tricks&lt;/h4&gt;


	&lt;p&gt;Ruby borrows from all the best programming languages out there, from smalltalk to Java, Perl to Python&lt;sup&gt;&lt;a href="#fn5"&gt;5&lt;/a&gt;&lt;/sup&gt;. Basically, here&amp;#8217;s the features and functionalities Ruby gives you which you may have seen elsewhere:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;em&gt;Exceptions:&lt;/em&gt; Believe it or not, exceptions are one of the most important things to master when developing any kind of application. &lt;span class="caps"&gt;PHP4&lt;/span&gt; programmers probably won&amp;#8217;t know anything about them and they&amp;#8217;ll tell you to just print stuff on the screen or use their &amp;#8220;extremely advanced&amp;#8221; class for error handling. Please, ignore them. Fortunately for all of us, Ruby comes with try/catch (or better, begin/rescue) blocks and a series of predefined, extensible Exceptions to handle errors properly.&lt;/li&gt;
		&lt;li&gt;&lt;em&gt;Namespaces:&lt;/em&gt; Ruby modules make excellent and easy-to-use namespaces, for the joy of Java and C++ enthusiasts.&lt;/li&gt;
		&lt;li&gt;&lt;em&gt;Built-in Regular Expressions:&lt;/em&gt; For all the Perl monkeys, you can put something between slashes and it will become a regular expression, ready to be matched with a =~ operator.&lt;/li&gt;
		&lt;li&gt;&lt;em&gt;Overloadable operators:&lt;/em&gt; Ruby lets you define operators like +, -, etc., for any of your classes.&lt;/li&gt;
		&lt;li&gt;&lt;em&gt;Packages:&lt;/em&gt; Called &amp;#8220;gems&amp;#8221;, they really are solid and precious indeed&amp;#8230;and they work! Packages support dependencies, and they can be either cross-platform or platform-dependent.&lt;/li&gt;
		&lt;li&gt;&lt;em&gt;Interactive Shell:&lt;/em&gt; the Interactive Ruby Shell can be used to test Ruby code instantly, similar to the Python console.&lt;/li&gt;
		&lt;li&gt;&lt;em&gt;Unit Testing&lt;/em&gt;: The &lt;code&gt;Test::Unit&lt;/code&gt; module makes things so easy that you really don&amp;#8217;t have any excuse not to test your code.&lt;/li&gt;
	&lt;/ul&gt;


	&lt;h4&gt;#2 &amp;#8211; You&amp;#8217;ll love the little things&lt;/h4&gt;


	&lt;p&gt;Ruby is elegant. Why&amp;#8217;s that? Because it doesn&amp;#8217;t focus on making code &lt;em&gt;concise&lt;/em&gt; so much as &lt;em&gt;readable and usable&lt;/em&gt;. Here are some tips to help you out:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt; You can use both &lt;em&gt;if&lt;/em&gt; and &lt;em&gt;unless&lt;/em&gt; in condition statements. Of course you can just use &lt;em&gt;if&lt;/em&gt; and negate the condition, but &lt;em&gt;unless&lt;/em&gt; can be less error-prone at times. Furthermore, you can use both operators as conditional modifiers, after a statement rather than before: &lt;em&gt;order.new unless order.exists&lt;/em&gt;.&lt;/li&gt;
		&lt;li&gt; You can use question marks and exclamation marks at the end of your methods. Although no convention is enforced, ? is added if the method should return true or false, while ! is used to clarify that the method does something forcefully, like destroying a database record, chopping off the last character of a string, etc.&lt;/li&gt;
		&lt;li&gt; You can use the &lt;em&gt;alias&lt;/em&gt; directives to create an alias for a method already defined. In this way you can have an &lt;em&gt;exist&lt;/em&gt; and an &lt;em&gt;exists&lt;/em&gt; method at no additional cost or repetition.&lt;/li&gt;
		&lt;li&gt; You can use the &lt;em&gt;attr_reader&lt;/em&gt;, &lt;em&gt;attr_writer&lt;/em&gt; or &lt;em&gt;attr_accessor&lt;/em&gt; directives to automatically generate getter and setter methods for specified class members.&lt;/li&gt;
		&lt;li&gt; Some naming conventions are enforced for your own sanity: constants, classes and modules are capitalized, methods and members must start with a lowercase letter; global variables are prepended by a $, instance variables by &lt;code&gt;@&lt;/code&gt; and class variables by &lt;code&gt;@@&lt;/code&gt;; etc.&lt;/li&gt;
		&lt;li&gt; Parentheses are optional in method calls.  You can therefore write &lt;em&gt;File.open(&amp;#8221;/home/h3rald/test.txt&amp;#8221;)&lt;/em&gt; or simply &lt;em&gt;File.open &amp;#8221;/home/h3rald/test.txt&amp;#8221;&lt;/em&gt;, which is particularly handy with methods that don&amp;#8217;t take parameters.&lt;/li&gt;
	&lt;/ul&gt;


	&lt;h4&gt;#3 &amp;#8211; You won&amp;#8217;t ever use a semicolon again&lt;/h4&gt;


	&lt;p&gt;You want to add another instruction? Just go on the next line. Hit &lt;return&gt; and you&amp;#8217;re done. In Ruby, like in Python, newlines matter and you don&amp;#8217;t have to remember to end your instructions with a semicolon. Unfortunately this means that you won&amp;#8217;t be able to write your whole program in a single line of code, like the C++ folks&amp;#8230; that&amp;#8217;s too bad, isn&amp;#8217;t it?&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;&lt;span class="caps"&gt;UPDATE&lt;/span&gt;:&lt;/strong&gt; Indeed you &lt;span class="caps"&gt;CAN&lt;/span&gt; use semicolons as line delimiters in Ruby as well, the point, however, is that you don&amp;#8217;t have to.&lt;/p&gt;


	&lt;h4&gt;#4 &amp;#8211; Everything is an object, as it should be&lt;/h4&gt;


	&lt;p&gt;When I studied Java they taught me that everything is an object.&lt;/p&gt;


	&lt;p&gt;&lt;em&gt;- &amp;#8220;So 14 and 374346.678 are objects then?&amp;#8221;&lt;/em&gt;
&lt;em&gt;- &amp;#8220;No, silly, they are numbers!&amp;#8221;&lt;/em&gt;&lt;/p&gt;


	&lt;p&gt;In Ruby, numbers, strings, Boolean values &lt;em&gt;et al&lt;/em&gt; are objects. Really. This means you&amp;#8217;ll write things like:&lt;/p&gt;


&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_ruby "&gt;&lt;span class="punct"&gt;&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;YOU SHOULDN'T ALWAYS USE CAPITALS&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;.&lt;/span&gt;&lt;span class="ident"&gt;downcase&lt;/span&gt; &lt;span class="comment"&gt;#=&amp;gt; outputs &amp;quot;you shouldn't always use capitals&amp;quot;&lt;/span&gt;
&lt;span class="punct"&gt;-&lt;/span&gt;&lt;span class="number"&gt;12&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;abs&lt;/span&gt; &lt;span class="comment"&gt;#=&amp;gt; outputs 12&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;instead of something like:&lt;/p&gt;


&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_ruby "&gt;&lt;span class="comment"&gt;# PHP Code&lt;/span&gt;

&lt;span class="ident"&gt;strtolower&lt;/span&gt;&lt;span class="punct"&gt;(&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;YOU SHOULDN'T ALWAYS USE CAPITALS&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;);&lt;/span&gt;
&lt;span class="ident"&gt;abs&lt;/span&gt;&lt;span class="punct"&gt;(-&lt;/span&gt;&lt;span class="number"&gt;12&lt;/span&gt;&lt;span class="punct"&gt;);&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;You save time, y