From: gabriele renzi Date: 2004-03-23T23:44:27+09:00 Subject: Re: Ruby style guidance (was: Re: Need some advice on PickAxe II) il Tue, 23 Mar 2004 06:25:36 -0800, "David A. Black" ha scritto:: >Hi -- > >On Tue, 23 Mar 2004, gabriele renzi wrote: > >> Seriously, it would be nice to have some kind of Style Guidelines >> somewhere (like using CamelCase for classes and under_scores for >> methods, provide block form for accessing resource that need to be >> freed and so on) > >There's a good style guide at: > >http://pub.cozmixng.org/~the-rwiki/rw-cgi.rb?cmd=view;name=RubyCodingConvention > >Also the Ruby code in the Ruby distribution itself will give you a >good sense of traditional, standard Ruby style. That page is nice, but It seem somehow "too little". There are many best practices that one may dicover looking at the code in the stdlib or at code snippet on this ng/list, but it would be nice to see them summarized. take as an example: how to iterate on stdin input? One may use while gets do stuff with $_ end or $stdin.each_line or $stdin.each do |line| or while line = gets end yes I could go and grep the whole stdlib but I'd prefer to have a reference Prolly I should just go and edit that wiki page :) PS there must be a reason for hat page being named as "draft" :)