netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: "Jason A. Donenfeld" <Jason@zx2c4.com>
Cc: David Miller <davem@davemloft.net>,
	Stephen Hemminger <stephen@networkplumber.org>,
	Netdev <netdev@vger.kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH v1 3/3] net: WireGuard secure network tunnel
Date: Wed, 22 Aug 2018 02:23:14 +0200	[thread overview]
Message-ID: <20180822002314.GC18444@lunn.ch> (raw)
In-Reply-To: <CAHmME9qriuodvMo3FyfA0TEkRubxu7_Dbs=0aFrF6XOcZZtQfg@mail.gmail.com>

On Tue, Aug 21, 2018 at 04:59:52PM -0700, Jason A. Donenfeld wrote:
> On Tue, Aug 21, 2018 at 4:54 PM David Miller <davem@davemloft.net> wrote:
> >
> > From: "Jason A. Donenfeld" <Jason@zx2c4.com>
> > Date: Tue, 21 Aug 2018 16:41:50 -0700
> >
> > > Is 100 in fact acceptable for new code? 120? 180?  What's the
> > > generally accepted limit these days?
> >
> > Please keep it as close to 80 columns as possible.
> >
> > Line breaks are not ugly, please embrace them :)
> 
> Okay! Will do. Thanks for the response.

Hi Jason

I find the coding style document,
Documentation/process/coding-style.rst makes good arguments about why
it is like this:

   Now, some people will claim that having 8-character indentations
   makes the code move too far to the right, and makes it hard to read
   on a 80-character terminal screen.  The answer to that is that if
   you need more than 3 levels of indentation, you're screwed anyway,
   and should fix your program.

   In short, 8-char indents make things easier to read, and have the
   added benefit of warning you when you're nesting your functions too
   deep.  Heed that warning.

If you were to decided on 100, you might then want to go more than 3
levels deep, rather than heed the warning and refactor the code into
lots of smaller functions.

There is also:

   Functions should be short and sweet, and do just one thing.  They
   should fit on one or two screenfuls of text (the ISO/ANSI screen
   size is 80x24, as we all know), and do one thing and do that well.

It is worth reading the document in full, just for the rationale.

	Andrew

  reply	other threads:[~2018-08-22  3:45 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-31 19:10 [PATCH v1 0/3] WireGuard: Secure Network Tunnel Jason A. Donenfeld
2018-07-31 19:11 ` [PATCH v1 1/3] random: Make crng state queryable Jason A. Donenfeld
2018-08-02 21:35   ` Theodore Y. Ts'o
2018-07-31 19:11 ` [PATCH v1 2/3] zinc: Introduce minimal cryptography library Jason A. Donenfeld
2018-07-31 19:11 ` [PATCH v1 3/3] net: WireGuard secure network tunnel Jason A. Donenfeld
2018-07-31 20:02   ` Andrew Lunn
2018-07-31 20:22   ` Stephen Hemminger
2018-08-21 23:41     ` Jason A. Donenfeld
2018-08-21 23:54       ` David Miller
2018-08-21 23:59         ` Jason A. Donenfeld
2018-08-22  0:23           ` Andrew Lunn [this message]
2018-07-31 20:27   ` Stephen Hemminger
2018-08-03  0:35     ` Jason A. Donenfeld
2018-08-03 14:39       ` Andrew Lunn
2018-08-01  1:21   ` Shawn Landden
2018-08-13 15:40 ` [PATCH v1 0/3] WireGuard: Secure Network Tunnel James Bottomley
2018-08-13 15:53   ` Willy Tarreau
2018-08-13 17:02   ` Jason A. Donenfeld
2018-08-13 17:37     ` James Bottomley
2018-08-13 17:55       ` Jason A. Donenfeld
2018-08-13 18:04         ` James Bottomley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180822002314.GC18444@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=Jason@zx2c4.com \
    --cc=davem@davemloft.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).