[typo] A matter of style

Piers Cawley pdcawley at bofh.org.uk
Tue Sep 27 08:30:08 EDT 2005


I've been working on typo and I'm finding the style guidelines suggested on
trac rather insufficient. Have we got definitive rulings how we deal with
breaking long lines (for instance)?

In the code I've been writing that has long arg lists I've been tending to do

  TextFilter.render_text_by_name \
    text, filter_name, controller, filter_params,
    filter_html, text_holder

What do we think? What's best practice? Or should we wait for the Pragmatic
Friday on Ruby Best Practice and just use that style?

Of course, I realise now I should probably change the declaration of that
method to be something like.

   def self.render_text_by_name( \
     text, filter_name, controller,
     optional_params = {} )

And then call it as:

   TextFilter.render_text_by_name \
     text, filter_name, controller,
     :filter_html? => false, :text_holder => text_holder

Hmm... the problem with that declaration format of course is that it's hard to
see where the signature ends and the body begins.

Thoughts?

-- 
Piers Cawley <pdcawley at bofh.org.uk>
http://www.bofh.org.uk/


More information about the Typo-list mailing list