Ruby on Rails. It was a huge buzzword just a few years ago. It's launched many careers and is the preferred web development environment for many web developers. But what exactly is it?
Ever since Ruby Version Manager was released, it's been the de facto standard for installing Ruby.
Often ignored or only glossed over, control structures and loops are very important to master. While they're very straightforward in languages such as C, there are several subtleties to understand before you can really leverage the conditional and loop statements in Ruby.
Ruby on Rails. It was a huge buzzword just a few years ago. It's launched many careers and is the preferred web development environment for many web developers. But what exactly is it?
So much is made of the base data structures in Ruby. It's either an Array or a Hash or it isn't anything. But it's quite easy to make other related data structures out of these base data structures, such as a two dimensional array. Making an array of arrays in Ruby is not hard at all.
If you were like me, your eyes would just glaze over when reading programming books. "OK," you'd say, "but how is that useful?" This article is the first in a series of "worked examples," articles that feature working example programs and explain the Ruby features that make it tick. It starts off simple, with a number guessing game (that I'm sure many if you have already written if you've learned other programming languages).
Imagine you want to keep tabs on an object, but that object takes a lot of memory. If you were to save a reference to that object, the garbage collector cannot deallocate that memory. The WeakRef class allows you to use weak references to watch objects without actually keeping references to them. This is not without caveats though.
©2012 About.com. All rights reserved.
A part of The New York Times Company.