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

Lachie lachiec at gmail.com
Tue Jun 6 19:54:57 EDT 2006


I'm torn now...

underscores makes me think of:

class FooTestCase < Test::Unit::TestCase
    def test_should_really_be_rspeccing_because_writing_all_this_in_a_method_name_is_naff
    end
end

and in use, underscores would break most editors' code completion approaches.

The dots made me look twice at rSpec in the first place, but it was
more because it was such a novel approach.

in the end
+1 Underscore


On 6/7/06, aslak hellesoy <aslak.hellesoy at gmail.com> wrote:
> 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
> >
> _______________________________________________
> Rspec-devel mailing list
> Rspec-devel at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-devel
>


-- 
Lachie
http://lachie.info/
http://www.flickr.com/photos/lachie/


More information about the Rspec-devel mailing list