Aaron N. Tubbs bio photo

Aaron N. Tubbs

Dragon chaser.

Twitter Facebook Google+ LinkedIn Github
  • Ruby has a lot of the stupid shortcuts that let me enjoy perl, such as putting short one-liner conditionals after the operation. Even better, it also supports pushing loops into the secondary on a one-liner, which I do all the time when I want to quickly write something — and it makes for cleaner code compared to building up a huge structure (my opinion only). I’m starting to believe the assertion that Ruby does take the best things from other languages, and is going to be appealing even if my hack-together language of choice is Perl.
  • Related to this, effortless inline regexps feel right at home, and don’t force the user to treat them as objects, which is really nice. I’m sorry, regular expressions are not a tool for scripting and hackers; they are a critical part of every developer’s toolbox, and not using them makes everybody’s life more difficult. I couldn’t believe how many people had never touched regular expressions when I started my current job, now the developers are all using them — and couldn’t imagine life without. My initial impression of using regular expressions as modifiers suggest they are slightly more hassle, but mostly of the syntactic sugar nature. I’ll get off my high horse.
  • Ruby terminates everything with end. I find myself appreciating this; it doesn’t have the stylistic restriction of Python “There’s only one way to do it.” It doesn’t have the awful redundancy of VB (or any of its other issues), and for a scripting language, I’m not sure gobs of braces were ever the way to go in the first place. At first it seemed crude, but now I’m starting to think it is elegant. We’ll see how it wears in the long run.
  • Ruby lets you anonymously toss around chunks of code with little to no effort. This first blew my mind when I saw the following example, which made clear in a few short seconds that looping constructs are method calls, that yield is genius, and that the theory that Ruby was made to get things done has truth to it. This is similar to the moment of perfect clarity I felt when I first understood the call/cc operator (which, as a scary thought, came sometime after I implemented it in a new language, and secondly, I’m not sure I could explain it anymore), only it took a few seconds instead of all afternoon, and did not require the use of mind-altering substances.
ARGV.each { |line| print line if line =~ /Ruby/ }