<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Ruby and Rails Style Guide</title>
	<atom:link href="http://www.pathf.com/blogs/ruby-and-rails-style-guide/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.pathf.com/blogs</link>
	<description>Running commentary about agile development, user experience design and Ajax.</description>
	<lastBuildDate>Sat, 04 Sep 2010 05:35:40 -0500</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>By: Jens Jäger</title>
		<link>http://www.pathf.com/blogs/ruby-and-rails-style-guide/comment-page-1/#comment-4071</link>
		<dc:creator>Jens Jäger</dc:creator>
		<pubDate>Sun, 09 Nov 2008 22:06:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?page_id=1229#comment-4071</guid>
		<description>Great writeup.

I wrote a Rails Syleguide I use in my projects:
http://www.jensjaeger.com/2008/04/styleguide-for-rails-projects/</description>
		<content:encoded><![CDATA[<p>Great writeup.</p>
<p>I wrote a Rails Syleguide I use in my projects:<br />
<a href="http://www.jensjaeger.com/2008/04/styleguide-for-rails-projects/" rel="nofollow">http://www.jensjaeger.com/2008/04/styleguide-for-rails-projects/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Noel Rappin</title>
		<link>http://www.pathf.com/blogs/ruby-and-rails-style-guide/comment-page-1/#comment-4039</link>
		<dc:creator>Noel Rappin</dc:creator>
		<pubDate>Thu, 06 Nov 2008 04:42:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?page_id=1229#comment-4039</guid>
		<description>Takaaki:

1) Which do you like better, YAML.load or YAML::load ? 

I don&#039;t have a strong preference.

2) How do you declare variables. E.g., a) array = [] or array = Array.new

I find that I rarely declare an empty array variable, often doing so is a sign you should be using an Enumerable method with a block. I prefer the [] style, and {} for Hash unless I&#039;m doing something unusual, in which case the wordier style is clue that something weird is being done.

3) What’s your usage of single quotes and double quotes for string. Do you exclusively use single quotes when there is no interoperation?

In theory, yes, I try to use single quotes without interpolation, but it&#039;s an easy (and relatively harmless) thing to backslide on.

As to the options in your gist post:

Multiple assignment on multiple lines. Always. It&#039;s rarely a good idea to have multiple statements on a line in Ruby (some rare exceptions when the code is deliberately boilerplate). Multiple left hand sides is, I think, just a bad idea.

I have no preference between &quot;size&quot; and &quot;length&quot;

I would never have &quot;return nil&quot; as the last line of a method. I might do either of the other two options (just plain &quot;nil&quot;, or ending with the rescue), depending on which seemed more readable in the method, I don&#039;t have a strong preference.</description>
		<content:encoded><![CDATA[<p>Takaaki:</p>
<p>1) Which do you like better, YAML.load or YAML::load ? </p>
<p>I don&#8217;t have a strong preference.</p>
<p>2) How do you declare variables. E.g., a) array = [] or array = Array.new</p>
<p>I find that I rarely declare an empty array variable, often doing so is a sign you should be using an Enumerable method with a block. I prefer the [] style, and {} for Hash unless I&#8217;m doing something unusual, in which case the wordier style is clue that something weird is being done.</p>
<p>3) What’s your usage of single quotes and double quotes for string. Do you exclusively use single quotes when there is no interoperation?</p>
<p>In theory, yes, I try to use single quotes without interpolation, but it&#8217;s an easy (and relatively harmless) thing to backslide on.</p>
<p>As to the options in your gist post:</p>
<p>Multiple assignment on multiple lines. Always. It&#8217;s rarely a good idea to have multiple statements on a line in Ruby (some rare exceptions when the code is deliberately boilerplate). Multiple left hand sides is, I think, just a bad idea.</p>
<p>I have no preference between &#8220;size&#8221; and &#8220;length&#8221;</p>
<p>I would never have &#8220;return nil&#8221; as the last line of a method. I might do either of the other two options (just plain &#8220;nil&#8221;, or ending with the rescue), depending on which seemed more readable in the method, I don&#8217;t have a strong preference.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brooke Kuhlmann</title>
		<link>http://www.pathf.com/blogs/ruby-and-rails-style-guide/comment-page-1/#comment-4035</link>
		<dc:creator>Brooke Kuhlmann</dc:creator>
		<pubDate>Wed, 05 Nov 2008 21:11:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?page_id=1229#comment-4035</guid>
		<description>Good article.  Well written and excellent feedback to the community at large.

Personally, I think have indented &quot;when&quot; clauses in a case statement is more aesthetically pleasing but that is probably because I come from a Java background.</description>
		<content:encoded><![CDATA[<p>Good article.  Well written and excellent feedback to the community at large.</p>
<p>Personally, I think have indented &#8220;when&#8221; clauses in a case statement is more aesthetically pleasing but that is probably because I come from a Java background.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zubin</title>
		<link>http://www.pathf.com/blogs/ruby-and-rails-style-guide/comment-page-1/#comment-4033</link>
		<dc:creator>Zubin</dc:creator>
		<pubDate>Wed, 05 Nov 2008 02:57:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?page_id=1229#comment-4033</guid>
		<description>Oops, bad formatting! There should be two spaces before each attribute...</description>
		<content:encoded><![CDATA[<p>Oops, bad formatting! There should be two spaces before each attribute&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zubin</title>
		<link>http://www.pathf.com/blogs/ruby-and-rails-style-guide/comment-page-1/#comment-4032</link>
		<dc:creator>Zubin</dc:creator>
		<pubDate>Wed, 05 Nov 2008 02:56:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?page_id=1229#comment-4032</guid>
		<description>Great writeup, thanks!

The only difference in my &quot;style&quot; is for methods with long attributes:

a_very_long_method_name(
  argument1,
  a + b,
  arg_3
)

Although it uses more lines, I think the indentation makes more sense.</description>
		<content:encoded><![CDATA[<p>Great writeup, thanks!</p>
<p>The only difference in my &#8220;style&#8221; is for methods with long attributes:</p>
<p>a_very_long_method_name(<br />
  argument1,<br />
  a + b,<br />
  arg_3<br />
)</p>
<p>Although it uses more lines, I think the indentation makes more sense.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Claudio</title>
		<link>http://www.pathf.com/blogs/ruby-and-rails-style-guide/comment-page-1/#comment-4029</link>
		<dc:creator>Claudio</dc:creator>
		<pubDate>Tue, 04 Nov 2008 14:20:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?page_id=1229#comment-4029</guid>
		<description>Many times you find in ruby code:

do_something and return if condition

that works as long as do_something returns true.

This practice should be avoided since in a modifier method (as &quot;do_something&quot; often is) the return value is seldom important. 
But if the method returns false or nil, the code fails.</description>
		<content:encoded><![CDATA[<p>Many times you find in ruby code:</p>
<p>do_something and return if condition</p>
<p>that works as long as do_something returns true.</p>
<p>This practice should be avoided since in a modifier method (as &#8220;do_something&#8221; often is) the return value is seldom important.<br />
But if the method returns false or nil, the code fails.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Kotowski</title>
		<link>http://www.pathf.com/blogs/ruby-and-rails-style-guide/comment-page-1/#comment-4027</link>
		<dc:creator>Daniel Kotowski</dc:creator>
		<pubDate>Tue, 04 Nov 2008 13:01:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?page_id=1229#comment-4027</guid>
		<description>Nice chunk of useful rules. I&#039;ll use them ASAP. Thanks!</description>
		<content:encoded><![CDATA[<p>Nice chunk of useful rules. I&#8217;ll use them ASAP. Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Takaaki Kato</title>
		<link>http://www.pathf.com/blogs/ruby-and-rails-style-guide/comment-page-1/#comment-4025</link>
		<dc:creator>Takaaki Kato</dc:creator>
		<pubDate>Tue, 04 Nov 2008 11:27:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?page_id=1229#comment-4025</guid>
		<description>Hi I would like to know your opinion on three areas. 

1) Which do you like better, YAML.load or YAML::load ? 

2) How do you declare variables. E.g., a) array = [] or array = Array.new

3) What&#039;s your usage of single quotes and double quotes for string. Do you exclusively use single quotes when there is no interoperation?

Please refer to http://gist.github.com/22117 . I wrote some options there.</description>
		<content:encoded><![CDATA[<p>Hi I would like to know your opinion on three areas. </p>
<p>1) Which do you like better, YAML.load or YAML::load ? </p>
<p>2) How do you declare variables. E.g., a) array = [] or array = Array.new</p>
<p>3) What&#8217;s your usage of single quotes and double quotes for string. Do you exclusively use single quotes when there is no interoperation?</p>
<p>Please refer to <a href="http://gist.github.com/22117" rel="nofollow">http://gist.github.com/22117</a> . I wrote some options there.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Noel Rappin</title>
		<link>http://www.pathf.com/blogs/ruby-and-rails-style-guide/comment-page-1/#comment-4017</link>
		<dc:creator>Noel Rappin</dc:creator>
		<pubDate>Mon, 03 Nov 2008 21:33:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?page_id=1229#comment-4017</guid>
		<description>That was a bit of a typo -- you shouldn&#039;t user get_ or set_ prefixes or suffixes in Ruby as a general rule.</description>
		<content:encoded><![CDATA[<p>That was a bit of a typo &#8212; you shouldn&#8217;t user get_ or set_ prefixes or suffixes in Ruby as a general rule.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bryanl</title>
		<link>http://www.pathf.com/blogs/ruby-and-rails-style-guide/comment-page-1/#comment-4016</link>
		<dc:creator>bryanl</dc:creator>
		<pubDate>Mon, 03 Nov 2008 20:54:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?page_id=1229#comment-4016</guid>
		<description>Wouldn&#039;t this be much better written in third person?</description>
		<content:encoded><![CDATA[<p>Wouldn&#8217;t this be much better written in third person?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brian</title>
		<link>http://www.pathf.com/blogs/ruby-and-rails-style-guide/comment-page-1/#comment-4015</link>
		<dc:creator>Brian</dc:creator>
		<pubDate>Mon, 03 Nov 2008 20:53:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?page_id=1229#comment-4015</guid>
		<description>If your method is a setter, it should have an equals sign at the end of it.  Otherwise it&#039;s assumed to be getter for an attribute or doing something with the object, depending on the name of the method and other decorators (!, ?).  Further, suggesting get_* and set_* for getters and setters adds inconsistency to ruby code, as the attr_* methods don&#039;t use get_ or set_ prefixes.

As such, my position is: do not use get_ or set_ prefixes, and especially not _getter or _setter suffixes, with the usual caveat of use your best judgment in your situation.</description>
		<content:encoded><![CDATA[<p>If your method is a setter, it should have an equals sign at the end of it.  Otherwise it&#8217;s assumed to be getter for an attribute or doing something with the object, depending on the name of the method and other decorators (!, ?).  Further, suggesting get_* and set_* for getters and setters adds inconsistency to ruby code, as the attr_* methods don&#8217;t use get_ or set_ prefixes.</p>
<p>As such, my position is: do not use get_ or set_ prefixes, and especially not _getter or _setter suffixes, with the usual caveat of use your best judgment in your situation.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic page generated in 0.340 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2010-09-08 21:46:27 -->
