From: Jim Freeze Date: 2002-07-19T22:27:11+09:00 Subject: Re: Selling ruby to my boss On Thu, Jul 18, 2002 at 03:33:38PM +0900, Dirk Detering wrote: > Jim Freeze schrieb: > > One interesting aspect of Ruby, even non-programmers > > are able to sit in on a Ruby code review, understand > > what the code is doing and make suggestions. > > Wow! How do you achieve that? > Or in another way: Who are your 'non-programmers'? > A couple of reasons why we can do this. 1) We don't go overboard with esoteric coding. 2) Ruby reads very much like you would say something in english. In fact it is not very difficult to convert pseudo code into ruby. In fact, sometimes the pseudo code runs just fine. :) Consider the following examples: Our company has coding standards for skill that require developers to write things as: ;; Make an assignment in skill (setq x 5) ;; Make an assignment in Ruby x = 5 ;; Convert an angle from radians to degrees in skill (setq phase (times (atan2 tmpVal2 tmpVal) (quotient 180.0 3.14159265))) # Convert an angle from radians to degrees in Ruby phase = 180.0/Math::PI * atan2(tmpVal2, tmpVal) To most people (and all non-coders) I think Ruby is the easier of the two to read. Ruby reads more like I would describe something to someone else. For example, take the following skill code: numbers = '(1 2 3 ) => ( 1 2 3 ) (setq first ( car numbers )) => 1 I don't think that anytime in the near future I am going to say 'car list' to someone when I am telling them to take the first item in a list. And then there's Perl: # Derivative in Perl for $row(1..$#$data_ref) { ... $deriv[$row][$col] = ($$data_ref[$row][$col+1] - $$data_ref[$row][$col-1])/$h; # Are you sure you have your $$'s right and the correct precence is # automatically applied? } # Derivative in Ruby data.size.times { |row| ... deriv[row][col] = (data[row][col+1] - data[row][col-1])/h } $.02 -- Jim Freeze If only I had something clever to say for my comment... ~