Pages

Minggu, 13 Mei 2012

10 Ruby technologies you should know

Takeaway: 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.

0 komentar:

Posting Komentar