phpgroupware-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [phpGroupWare-developers] line lengths


From: Dave Hall
Subject: Re: [phpGroupWare-developers] line lengths
Date: Wed, 30 Apr 2008 08:31:35 +0200

On Tue, 2008-04-29 at 07:18 -0500, Chris Weiss wrote:
> I find 80 too limiting many times, but a target of 100 might be OK for
> readability.  Since code and display are separated it shouldn't be a
> huge issue, multi-part conditionals can easily be put on separate
> lines but exceptions do need to be made for things like Guillaume
> mentioned.  Also for large blocks multiple levels deep, even with
> 4-space tabs once you get a class-method-loop-if-switch-if-if half
> your line is already gone to whitespace.

Yes, but also very long lines can indicate inelegant solutions.  Also we
could look at dropping the requirement of indenting class definitions
one tab, so we have

/**
* Page Block here
*/

/**
* Class block here
*/
class <module>_bo
{
}

// What do people think?

> 
> I'm happy not having a standard, but a target with no limit would be 
> acceptable.
> 
> On Tue, Apr 29, 2008 at 6:45 AM, Guillaume Courtois <address@hidden> wrote:
> > That's true for the code. But if you have lines like the ones with phrases 
> > for
> >  the app, you have to have it on a single line (you know, the ones with
> >  lang('blah-blah') ;-)
> >
> >  I'd say, ask for 80 characters as much as possible, make the lines with 
> > more
> >  than 80 the exception, for special cases.
> >
> >  Andriy Kushnarov (address@hidden) écrivait:
> >
> > >
> >  > Hi all,
> >  >
> >  > As for me length of 80 characters is the best option.
> >  > Even if you use 1920x1200 it's more easy to read short lines.
> >  >
> >  > 2008/4/29, Dave Hall <address@hidden>:
> >  > > Hi all,
> >  > >
> >  > >  I have been playing with PHP CodeSniffer recently ( see
> >  > >  http://pear.php.net/package/PHP_CodeSniffer/ ).  It is a nice tool for
> >  > >  checking compliance with coding standards.
> >  > >
> >  > >  Today we have been discussing using it as part of the ReSight project.
> >  > >  This led me to take a quick look over the phpGW coding standard ( see
> >  > >  
> > http://svn.savannah.gnu.org/svn/phpgroupware/trunk/phpgwapi/doc/coding_standard.txt
> >  > ). I noticed that we haven't define target and maximum line lengths.  I 
> > know this can
> >  > turn into a religious debate, but I am hoping it doesn't :)
> >  > >
> >  > >  I think we have 3 options:
> >  > >
> >  > >  * Agree to not have a standard
> >  > >
> >  > >  * Make it maximum 80 characters - cos a console is only characters 
> > wide,
> >  > >  but this ignores the fact that one shouldn't be hacking on code on a
> >  > >  console a production box :)
> >  > >
> >  > >  * Make it something reasonable for today's technology and match our
> >  > >  existing development approach.  I favour this option, with 100 as the
> >  > >  target and 120 as the maximum.  My laptop is 1920x1200 so I can 
> > handle a
> >  > >  lot more, but it starts to get hard to read at that point.
> >  > >
> >  > >  Please throw your 2 characters in :)
> >  > >
> >  > >  In the coming week or 2, Sigurd will be working on implementing the
> >
> >
> > > >  standard for phpGW in PHP CodeSniffer.  Once it is done, we will be
> >  > >  putting it back into the tree (probably under
> >  > >  phpgwapi/test/code_sniffer).  Then anyone can run the test over their
> >  > >  code - preferably before checking their code in :) (hint hint)
> >  > >
> >  > >  Cheers
> >  > >
> >  > >  Dave
> >  > >  --
> >  > >  Dave Hall
> >  > >  Lead Engineer
> >  > >  ReSight AS
> >  > >  p +61 410 47 42 55
> >  > >  e address@hidden
> >  > >  w resight.no
> >  > >
> >  > >
> >  > >
> >  > >  _______________________________________________
> >  > >  phpGroupWare-developers mailing list
> >  > >  address@hidden
> >  > >  http://lists.gnu.org/mailman/listinfo/phpgroupware-developers
> >  > >
> >  >
> >  >
> >  >
> >
> >
> >
> >  _______________________________________________
> >  phpGroupWare-developers mailing list
> >  address@hidden
> >  http://lists.gnu.org/mailman/listinfo/phpgroupware-developers
> >
> 
> 
> _______________________________________________
> phpGroupWare-developers mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/phpgroupware-developers
-- 
LLLLL
L*LLL
LLLLL
LLLLL DAVE
LLLLL HALL
      CONSULTING

      Open Source
      Business Solutions

      p +61 410 47 42 55
      e address@hidden
      w davehall.com.au
      f +61 3 8610 0029





reply via email to

[Prev in Thread] Current Thread [Next in Thread]