> I think this is a question that a lot of Ruby programmers struggle
> with, 
> especially if they've come to Ruby after a long history with some
> other 
> programming language. Despite efforts like this:
> 
> 	http://www.rubygarden.org/ruby?RubyStyleGuide
> 
> there's not really a "checklist" out there to compare your work to
> (and 
> I don't think anyone wants that anyways).


Maybe I'm old and set in my ways, but I just read that page and while
good, I'm having a little trouble with some aspects of it.

In the "use iterators" section, it says ...

Even Better 

Use iterators and higher order functions. These were invented in
LISP, which was around before Algol introduced while and for loops.
Therefore these are very old ways, and have worked fine for the last
50 years! 

PROMPTS = ["First Name", "Last Name", "Phone"]
first_name,last_name,phone = PROMPTS.map { |prompt | prompt_and_read(
prompt ) }


I'm sorry, I'm perfectly capable of grokkin that, but there is no way
(to me) that that example reads better than the initial:

first_name = prompt_and_read "First name"
last_name  = prompt_and_read "Last name"
phone      = prompt_and_read "Phone"



The iterator example reads like perl to me, which in and of itself
isn't bad, but it just seems like using a ruby construct for the sake
of using a ruby construct.

Thoughts?




> 
> Perhaps your best bet, then, is to study Ruby code that *others*
> have 
> pointed to as exemplary of "The Ruby Way". That certainly includes 
> looking at the sources from Ruby's standard library, but a lot of
> code 
> from the Ruby community falls into this category as well. For
> example, 
> many people have pointed to Sean Russell's REXML library:
> 
> 	http://www.germane-software.com/software/rexml
> 
> as a very intuitive (read: "Ruby-like") interface. I hope others
> reading 
> this thread might throw in their $0.02 about other good examples
> (for my 
> benefit ;)
> 
> > Going by my own standards for software, I'm assuming that a good
> Ruby interface should be:
> > 
> > 1) usable, that is, not buggy, reasonably efficient, and
> predictable
> > 2) complete, that is, provides a complete interface to whatever
> it's interfacing with
> > 3) documented, (no point having an interface that you can't
> figure out) and
> > 4) supported, so you have some hope of getting bugs fixed, etc. 
> 
> Well, yes. I guess those things are important too ;)
> 


=====
--
Use your computer to help find a cure for cancer: http://members.ud.com/projects/cancer/

Yahoo IM: michael_s_campbell

__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com