[katello-devel] Updated Ruby style guide

David Davis daviddavis at redhat.com
Mon Oct 15 12:09:36 UTC 2012


80 characters is often the standard used on many projects and in many guides. For example, the Ruby guide we were linking to in our Ruby Conventions page said to limit lines to 80 characters [1] and even the Github style guide that we're linking to now says to use 80 characters. Moreover, 80 characters per line is recommended in our Python wiki pages by way of pep8 [2] and the 80 char limit warning. For me personally though, I often develop in vim or in the console where I have split windows open and can't view more than 80 or so characters.  

That said, there are definitely instances where you can't limit a line to any number of characters like when using regular expressions. 100 characters though still seems reasonable to me--it's more about the lines of 150+ characters we have in katello. Not even github by default shows 150 chars in commit diffs (you have to scroll over after about 120).

[1] http://www.caliban.org/ruby/rubyguide.shtml#style
[2] http://www.python.org/dev/peps/pep-0008/#maximum-line-length

David

----- Original Message -----
> From: "Lukas Zapletal" <lzap at redhat.com>
> To: katello-devel at redhat.com
> Sent: Monday, October 15, 2012 3:22:13 AM
> Subject: Re: [katello-devel] Updated Ruby style guide
> 
> On Fri, Oct 12, 2012 at 02:15:43PM -0400, David Davis wrote:
> > I'm also thinking of reiterating the 80 characters or less per line
> > rule in our style guide. It's currently in the Github guide and I
> > think it's great rule given that it's in our Python guide as well
> > and Github cuts off commits after about 80 characters (you have to
> > scroll over).
> 
> Why you think it's great? I think it's evil, because nobody no longer
> uses fixed eighty columns anymore and it's quite limiting. I mean,
> xterm
> opens up with 80, but everyone can resize it if needed.
> 
> There are many theoretical reasons why to wrap at 80 (like if a line
> is
> that long you should consider refactoring it blah blah). Crap. Give
> me
> practical reasons.
> 
> IMHO longer lines are sometimes better to read. And I personally very
> often need a line between 80 and let's say 100 which is very
> readable,
> but when wrapped it's awful.
> 
> I vote for not giving explicit limit and let it be: use reasonable
> line
> lengths.
> 
> --
> Later,
> 
>  Lukas "lzap" Zapletal
>  #katello #systemengine
> 
> _______________________________________________
> katello-devel mailing list
> katello-devel at redhat.com
> https://www.redhat.com/mailman/listinfo/katello-devel
> 




More information about the katello-devel mailing list