15.01.2015 Views

Journal of Research in Innovative Teaching - National University

Journal of Research in Innovative Teaching - National University

Journal of Research in Innovative Teaching - National University

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

considers a programm<strong>in</strong>g language as a user <strong>in</strong>terface for programmers, so he designed Ruby “to<br />

make programmers happy.” He based his design for Ruby on three ma<strong>in</strong> pr<strong>in</strong>ciples: conciseness,<br />

consistency, and flexibility (Matsumoto, 2000).<br />

These three pr<strong>in</strong>ciples make programm<strong>in</strong>g <strong>in</strong> Ruby not only fun but, more importantly,<br />

productive. This is where Ruby stands out to be the language <strong>of</strong> choice <strong>in</strong> agile problem-driven<br />

teach<strong>in</strong>g environments. The pr<strong>in</strong>ciple <strong>of</strong> conciseness dictates that a language should do a lot <strong>of</strong><br />

work quickly. The pr<strong>in</strong>ciple <strong>of</strong> consistency means that a programmer with basic knowledge can<br />

learn Ruby very quickly. Last but not least, the pr<strong>in</strong>ciple <strong>of</strong> flexibility means that Ruby will help<br />

express humans, not restrict them. A Ruby programmer can write arbitrary objects that are<br />

treated just like the built-<strong>in</strong> ones (Matsumoto, 2000).<br />

Ruby Genealogy<br />

Ruby is generally described as an object-oriented script<strong>in</strong>g language. This general description<br />

relates directly to the genealogy <strong>of</strong> Ruby. Programm<strong>in</strong>g languages genealogy reveals how Ruby<br />

was directly affected by several object-oriented and script<strong>in</strong>g languages, as shown <strong>in</strong> Figure 1<br />

(Lévénez, 2009). Matz designed Ruby with the goal <strong>of</strong> hav<strong>in</strong>g the right balance <strong>of</strong> functional and<br />

imperative programm<strong>in</strong>g (About Ruby, 2009). Ruby <strong>in</strong>herited powerful data abstraction features<br />

from Clu. It is as much dynamic and object-oriented as SmallTalk, Common Lisp, Eiffel, and<br />

Clos. Ruby is as versatile as Perl and as powerful as Python (Scott, 2006).<br />

Figure 1. Ruby Inherited Features from Different Programm<strong>in</strong>g Paradigms<br />

Key Ruby Features<br />

Ruby is purely object-oriented and is an <strong>in</strong>terpreted language. These two characteristics put<br />

every feature <strong>of</strong> the language <strong>in</strong> perspective accord<strong>in</strong>g to the pr<strong>in</strong>ciples beh<strong>in</strong>d it. Ruby did not<br />

<strong>in</strong>troduce new features to the programm<strong>in</strong>g languages world, however, it did comb<strong>in</strong>e the best<br />

available features from exist<strong>in</strong>g paradigms. These features are the reason Ruby stands out and<br />

was chosen <strong>in</strong> this use case <strong>of</strong> agile teach<strong>in</strong>g and learn<strong>in</strong>g.<br />

Six-Level Scop<strong>in</strong>g<br />

Ruby has a spectacular six-level variable scop<strong>in</strong>g system. This allows for flexible scop<strong>in</strong>g and<br />

the ability to encapsulate variables at different levels. A variable can be <strong>of</strong> global, local, class,<br />

class <strong>in</strong>stance, <strong>in</strong>stance, or block scope. Each scope level is identified by a certa<strong>in</strong> prefix or<br />

nam<strong>in</strong>g convention. There are no variable declarations <strong>in</strong> Ruby. This made the course project<br />

implementation easier, as there is no need to worry about variable types and declarations.<br />

However, one would argue that this could cause issues due to ambiguity about variables. In fact,<br />

64

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!