Web Development

10 Ruby technologies you should know

Sharpen your Ruby development skills by taking advantage of these technologies.

I have been spending a good amount of time lately learning to navigate the Ruby waters. If you too are getting your feet wet with Ruby for Web development, these 10 technologies will help you write better applications, faster.

1: The Ruby language

If you are planning on working in Ruby, you should know the Ruby language. I have discovered that the syntax of Ruby itself is not too hard to learn, but there is a mode of thinking about Ruby code that takes time and experience working in Ruby to develop. Your best bet, in my experience, is to plan out a small project that will touch on all of the major pieces of the language (not just the basic items like arrays and strings, but the deeper ideas, such as mixins, monkey patching, blocks, and closures). Force yourself to do things the way a Ruby developer would, not the way a Java or C# developer using a different syntax would. Recommended reading materials are The Pickaxe Book" (Programming Ruby 1.9: The Pragmatic Programmers' Guide) and The Ruby Way.

2: Ruby on Rails

Ruby on Rails has been the reason for Ruby's success in the Web development world (though there are other excellent ways to use Ruby on the Web as well). Indeed, Rails is one big reason why other systems like ASP.NET have started to move to the MVC pattern themselves. If you are looking to do Web development, Rails is a well-supported and well-documented system and an excellent place to start learning. I took the Rails for Zombies course and I thought it was very good, and it helped me get a leg up on Rails.

3: Sinatra

Sinatra is a lightweight system for performing Web development. It has two big advantages for Web developers. First, it is easy to learn the Sinatra system itself. It has a simple routing syntax, does not do fancy tricks, and after reading one (albeit long) Web page, you know what you need to run with it. Its second big advantage is that it is designed from the ground up to be completely modular, giving you extreme amounts of flexibility in your projects.

4: RubyGems

RubyGems is Ruby's system for maintaining and packaging Ruby modules. In addition, it is a repository for these packages, much like CPAN is for Perl. The gems in RubyGems cover a huge variety of programming needs. If you feel like you need to write a piece of code to accomplish a task, there is a good chance that there is a gem that meets the need or will help you get there.

5: eRuby

eRuby is Ruby's basic templating system for embedding Ruby code into text files and injecting the output into the file as output, just like PHP or classic ASP. It's not too difficult to learn the eRuby system. It takes a few minutes, but it is a useful tool for the toolbox.

6: YAML

YAML is a specialized format for defining data, like JSON. Unlike JSON, YAML is not potentially executable code, dramatically reducing your exposure to security problems. YAML is also supported by Ruby out of the box and has wide support in other languages as well. As a data exchange format, YAML has a lot to offer and is worth evaluating.

7: HAML

HAML provides an alternative to eRuby for templates. Instead of allowing you to embed Ruby into otherwise normal HTML templates, HAML is a language in its own right, enabling you to define HTML in a simplified form that gets converted to HTML at runtime. The HAML tutorial brilliantly shows how easy it is to work with HAML. HAML is much easier to create, maintain, and edit than HTML, let alone HTML that contains embedded Ruby code. While eRuby is important to know because of how widespread it is (and because it has other uses), HAML is the better way to do Web templates.

8: Sass

Sass is to CSS as HAML is to HTML. It allows you to write CSS not as a static text file, but as a living, breathing file that can use things like variables and mixins to simplify the creation and maintenance of style information. Like YAML and HAML, Sass is not a Ruby-specific technology. But it has been quickly adopted within the Ruby community while the rest of the Web development world does not seem to notice its existence. Also like YAML and HAML, learning Sass is a cinch.

9: CoffeeScript

CoffeeScript is similar to YAML, HAML, and Sass in its conception and format (a whitespace and indentation delimited DSL), but its target is JavaScript. Like the others mentioned, CoffeeScript is not a Ruby-specific system by any stretch of the imagination, but it has become quite popular with Ruby programmers. It also is easy to learn; the home page of the CoffeeScript site also serves as a competent introduction to CoffeeScript.

10: jQuery

About a year ago, the Rails project made the decision for jQuery to be the default AJAX system for Rails, and for good reason. jQuery has established itself as competent and mature, with widespread support and a thriving ecosystem of developers creating plugins for it. For the work you need to do in AJAX, jQuery is a solid technology, and you are likely to find what you need already available. jQuery is also the AJAX library of choice for other Web development frameworks out there, like ASP.NET MVC, making it a portable skill as well.

About

Justin James is the Lead Architect for Conigent.

4 comments
Duke E Love
Duke E Love

I played with Rails years ago but now that I have had exposure to other frameworks and things like ORM, meta programming and MVC I see why it is so popular. It's all about getting stuff done and removing the suck from app development. And Ruby is so concise and simple. And is very easy in the eyes. Much more so than PHP and other flying spaghetti monsters.

manuelramoscaro
manuelramoscaro

If you come from Java, Jruby it's also a good choise to run Rails, Sinatra, etc... etc... because you can use all Java Power... API... on a easy way...nowadays ... to have some fun... i'm translating a home aplication from Shoes to Jruby+Swing and it's amazing... http://sourceforge.net/projects/rmldonkey/ ...that's nowadays Shoes application...

sirfan98cs
sirfan98cs

Learning Ruby is definitely a fun! The inventor of this language has kept it as top priority. However, I not sure how soon Ruby will find its way into the enterprise development arena. We all know that this area require top attention to make any Language to challenge todays giants like JAVA and .NET precisely.

Matt Nawrocki
Matt Nawrocki

I'm making my way through Ruby now, albeit slowly. The language is wonderfully expressive and flexible.

Editor's Picks