From: Simon Marchi via Gdb-patches <gdb-patches@sourceware.org>
To: Luis Machado <luis.machado@linaro.org>,
John Baldwin <jhb@FreeBSD.org>,
Simon Marchi via Gdb-patches <gdb-patches@sourceware.org>
Subject: Re: Coding standards proposal, usage of "this"
Date: Mon, 16 Aug 2021 13:31:45 -0400 [thread overview]
Message-ID: <09fc59b5-aa7b-d364-47b3-8d9ba43b4c4f@polymtl.ca> (raw)
In-Reply-To: <1fd0ea1c-7226-62a0-0568-6793a41ab9a7@linaro.org>
> My 2 cents. I wouldn't mind the change, but having to remember when to use "this" and when not to use it is worse to me than spending a couple minutes trying to figure out why the code is the way it is.
Hmm, I think that when the rule is logical and you know the rationale,
it's pretty obvious when to use it or not. In my original proposal:
- does the identifier name contains something that makes it obvious
it's a member (the m_ prefix)? No need for `this`.
- otherwise? Use `this`.
> I suppose it is just the nature of C++. Some constructs are just not great when trying to read/parse them. I think the same happens with some templates and lambda's. It might take a little bit to figure out where the functions are defined.
>
> Given GDB's code base is a mix of C and C++, wouldn't we risk having yet another mix of new coding standards with old coding standards?
Yes, but in my opinion we shouldn't refrain of adopting new rules and
standards that we find useful because the existing code doesn't follow
the new rule. Otherwise we could never introduce any new rule /
guideline / standards.
Simon
next prev parent reply other threads:[~2021-08-16 17:32 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-13 14:26 Simon Marchi via Gdb-patches
2021-08-13 14:46 ` Paul Koning via Gdb-patches
2021-08-13 14:51 ` Simon Marchi via Gdb-patches
2021-08-13 14:47 ` Andrew Burgess
2021-08-15 13:34 ` Lancelot SIX via Gdb-patches
2021-08-16 16:40 ` Christian Biesinger via Gdb-patches
2021-08-16 16:59 ` Simon Marchi via Gdb-patches
2021-08-18 11:43 ` Ruslan Kabatsayev via Gdb-patches
2021-08-16 17:06 ` John Baldwin
2021-08-16 17:11 ` Simon Marchi via Gdb-patches
2021-08-16 17:23 ` Luis Machado via Gdb-patches
2021-08-16 17:31 ` Simon Marchi via Gdb-patches [this message]
2021-08-17 10:01 ` Andrew Burgess
2021-08-16 17:28 ` John Baldwin
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=09fc59b5-aa7b-d364-47b3-8d9ba43b4c4f@polymtl.ca \
--to=gdb-patches@sourceware.org \
--cc=jhb@FreeBSD.org \
--cc=luis.machado@linaro.org \
--cc=simon.marchi@polymtl.ca \
/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