linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexey Dobriyan <adobriyan@gmail.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Netdev <netdev@vger.kernel.org>,
	linux-arch <linux-arch@vger.kernel.org>,
	NetFilter <netfilter-devel@vger.kernel.org>
Subject: Re: [PATCH] linux++, this: rename "struct notifier_block *this"
Date: Sat, 20 Jun 2020 10:57:32 +0300	[thread overview]
Message-ID: <20200620075732.GA468070@localhost.localdomain> (raw)
In-Reply-To: <CAHk-=whz7xz1EBqfyS-C8zTx3_q54R1GuX9tDHdK1-TG91WH-Q@mail.gmail.com>

On Fri, Jun 19, 2020 at 11:37:47AM -0700, Linus Torvalds wrote:
> On Thu, Jun 18, 2020 at 2:06 PM Alexey Dobriyan <adobriyan@gmail.com> wrote:
> >
> > Rename
> >         struct notifier_block *this
> > to
> >         struct notifier_block *nb
> >
> > "nb" is arguably a better name for notifier block.
> 
> Maybe it's a better name. But it doesn't seem worth it.
> 
> Because C++ reserved words are entirely irrelevant.
> 
> We did this same dance almost three decades ago, and the fact is, C++
> has other reserved words that make it all pointless.

The real problems are "class" and "new" indeed.

> There is no way I will accept the renaming of various "new" variables.

I'm not sending "new".

> We did it, it was bad, we undid it, and we now have a _lot_ more uses
> of 'new' and 'old', and no, we're not changing it for a braindead
> language that isn't relevant to the kernel.
> 
> The fact is, C++ chose bad identifiers to make reserved words.
> 
> If you want to build the kernel with C++, you'd be a lot better off just doing
> 
>    /* C++ braindamage */
>    #define this __this
>    #define new __new
> 
> and deal with that instead.

Can't do this because of placement new.

> Because no, the 'new' renaming will never happen, and while 'this'
> isn't nearly as common or relevant a name, once you have the same
> issue with 'new', what's the point of trying to deal with 'this'?

I'm not sending "new".

There is stuff which can be merge without breaking source compatibility
and readability of C version:

	private		=> priv
	virtual		=> virt
	this		=> self (in some contexts)

and those which can not. I'm not sending the latter.

  reply	other threads:[~2020-06-20  7:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-18 21:06 [PATCH] linux++, this: rename "struct notifier_block *this" Alexey Dobriyan
2020-06-19  7:46 ` Christoph Hellwig
2020-06-19 10:28   ` Jan Engelhardt
2020-06-19 18:37 ` Linus Torvalds
2020-06-20  7:57   ` Alexey Dobriyan [this message]
2020-06-20 18:16     ` Linus Torvalds

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=20200620075732.GA468070@localhost.localdomain \
    --to=adobriyan@gmail.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=torvalds@linux-foundation.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).