[Rspec-devel] should_be_nil or should.be.nil

aslak hellesoy aslak.hellesoy at gmail.com
Tue Jun 6 19:25:24 EDT 2006


On 6/6/06, Evgeny <evgeny.zislis at gmail.com> wrote:
> Dots! :)
>
> well, dots are more consistent anyways,
> since x.y.z.q.w.e.r.t.y is better than x.y.z_q_w_e_r_t.y
>

Can you elaborate on why you think dots are better?

And since I didn't elaborate on my own opinion when I voted, so here I go:

Underscores mask the fact that we're dealing with several chained method calls.
This is - IMO - A Good Thing, since it allows the reader/writer of the spec code
to focus more on readability than implementation. Underscored methods is a
well-established convention in the Ruby community. Many dots is not - and it
reminds me of a kind of code I have a strong disliking for - code that
violates the
tell/don't ask principle. Also known as the Law of Demeter, or "more
periods than a girl's locker room". I'm concerned that if RSpec
advocates long dotted calls, people might
be less inclined to avoid it in their own code. By using dots we're on
a slippery slope - advocating a bad practice.

Aslak

> On 6/7/06, Michael Granger <ged at faeriemud.org> wrote:
> > On 6-Jun-06, at 2:28 PM, aslak hellesoy wrote:
> >
> > > RSpec supports both dotted and underscored syntax.
> > >
> > > While users can choose whichever they like, I think the documentation
> > > and examples we provide for RSpec should consistently use one style.
> > > Right now it's rather confusing.
> > >
> > > To avoid confusing the users.
> > >
> > > Shall ve vote? Please reply to the latest reply - that makes
> > > counting easier.
> >
> > Underscores.
> >
> > --
> > Michael Granger <ged at FaerieMUD.org>
> > Rubymage, Architect, Believer
> > The FaerieMUD Consortium <http://www.faeriemud.org/>
> >
> >
> >
> >
> > _______________________________________________
> > Rspec-devel mailing list
> > Rspec-devel at rubyforge.org
> > http://rubyforge.org/mailman/listinfo/rspec-devel
> >
> _______________________________________________
> Rspec-devel mailing list
> Rspec-devel at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-devel
>


More information about the Rspec-devel mailing list