On 2014-01-06, at 19:28, Patrick McManus <mcma...@ducksong.com> wrote:

> I strongly prefer at least a 100 character per line limit. Technology
> marches on.

Yes.  I’ve encountered too many instances where 80 was not enough.

Good identifier names are hugely important, no matter what the language, which 
means sometimes that you need three words.  With a meagre indent of 3 levels, 
having to wrap to make a line fit 80 columns hurts readability far worse:

      PeerConnectionIdp peerConnection = 
PeerConnectionIdp::CreateInstance(domain, type);

Or in JS, a case that I’ve encountered several times:
      
      _classMethodName: function 
ReasonableClassName__classMethodName(argument1, argument2) {

BTW, @12pt, emacs shows 360 columns on my 27" monitor (easily 4x80), on my 13" 
one, it shows 233.  That seems plenty enough to me.

On the other points:

Hungarian notation = unnecessary and costly (technology fixed this problem 
years ago, for member vs. local most editors can do syntax highlighting; plus, 
it’s easier to type and read without it).

Braces always = net win.  Consistency + bug resilience > any aesthetic 
preference (which is trained anyway).

Here’s a few other things that I think should be added:

function and file length limits:

I think that 32 lines is enough for JS, and maybe 50 for C/C++ due to the 
increased need for error checking stuff.
1000 lines is enough for any single class/file.

I’m certain others will want much longer :)  Why so short?  Function names are 
great just-in-time help, and long functions suffer from tl;cr (too long; can’t 
read).

cyclomatic complexity limits:

I like 8 for JS and probably 15 for C/C++ due to the impact of error checking.  
Again, I’m sure others will want more.



_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to