Hi all,

I agree with Daniel's analysis and solution, as enforcing snake_case for 
namespaces would probably make everyone happy.
We could in theory adopt namespace aliases for backward compatibility, to 
transition smoothly from one "convention" (PascalCase for namespaces is not 
mentioned in our coding style) to the other, but I think it will complicate 
things even further.

Kind Regards

Giacomo

> -----Original Message-----
> From: Jason Lowe-Power via gem5-dev <gem5-dev@gem5.org>
> Sent: 03 May 2021 21:27
> To: gem5 Developer List <gem5-dev@gem5.org>
> Cc: Jason Lowe-Power <ja...@lowepower.com>
> Subject: [gem5-dev] Re: gem5 namespace
>
> Hey Daniel,
>
> Sorry, I didn't mean to add to the confusion :). I may have gotten my case
> names confused! Also, I really appreciate the thoughtfulness and effort
> you're putting into this conversation! I believe I agree with your email 
> below.
>
>
> I think that most people don't care that much (which is why we haven't heard
> from many). From my experience, our users only care when they get merge
> conflicts :D. That said, I'm not sure if "straightforward" is a way most of 
> our
> users ever feel about merge conflicts. IMO, stability and ease of update
> should be high priority. If we are going to be changing names, etc. in a way
> that means external users of gem5 will have compiler errors, we should
> probably provide backwards compatibility and warnings. Most of our users
> are not software engineers and do not have as much experience with git,
> compilers, etc. as we do.
>
>
> Cheers,
> Jason
>
>
> On Mon, May 3, 2021 at 12:40 PM Daniel Carvalho via gem5-dev <gem5-
> d...@gem5.org <mailto:gem5-dev@gem5.org> > wrote:
>
>
>       I'm confused, Jason. I thought you were in favor of adopting snake
> case as a "general convention" (i.e., "the google way"), so by adopting snake
> case we would be adopting the "general convention", not forging our own
> path. However, if by "general convention" you mean "the convention vastly
> adopted by gem5", I don't have the exact numbers, but I'd guess it is 70%
> pascal, 30% snake case - i.e., IMHO, not a "general convention", just a
> preference. Adding "gem5" or "Gem5" would only extend this mess, not add
> an exception.
>
>       Regarding changing the name of the variable, indeed, it is not a
> necessary step.
>
>       Again, as stated before, I don't care which solution is taken. The
> important thing is to come to a decision that appeases most community
> members; however, it is hard to reach a consensus when we seem to have
> strong opinions on both sides, yet we only have 5 votes. That is why I have
> suggested officially adopting snake case namespaces: it would solve the
> "gem5 VS Gem5" problem, it is feasible to do it without having exceptions (at
> least as of now), Giacomo expressed preference towards lowercase
> namespaces, Jason suggested affinity with the google approach (snake case)
> and "gem5", Bobby prefers "gem5", and Gabe and I like consistency/patterns.
> The (huge) downside to this solution is that it would affect users, but 1) 
> we'd
> already be affecting users anyway with the new namespace, and 2) solving
> the merge conflicts would be straightforward if the patches were created
> with that in mind.
>
>
>       Regards,
>       Daniel
>
>       Em segunda-feira, 3 de maio de 2021 15:44:46 BRT, Jason Lowe-
> Power <ja...@lowepower.com <mailto:ja...@lowepower.com> >
> escreveu:
>
>
>       Just a few quick replies below. Overall, I think we're being too
> focused on "standards" and not on enough on ease of use. It's not a problem
> if there are exceptions to guidance, if there's good reasons for the
> exceptions.
>
>
>       On Mon, May 3, 2021 at 11:36 AM Daniel Carvalho via gem5-dev
> <gem5-dev@gem5.org <mailto:gem5-dev@gem5.org> > wrote:
>
>
>               As mentioned by Gabe in the Jira issue, some of the
> namespaces using snake declared in the codebase case are defined as parts
> of a standard, and thus cannot be modified. Realistically, this means that if
> we wanted to follow a namespace naming convention, it'd be snake case:
> despite having way more occurrences of pascal case namespaces, they are all
> "ours"; this means that, although inconvenient, it would be doable to
> standardize all of them.
>
>
>
>       If we just say "all namespaces should be PascalCase. gem5, the name
> of this project, is an exception" would be OK with me.
>
>
>
>               Would you be willing to adopt to enforce a snake case
> namespace naming convention? From the previous replies to this thread, it
> seems that this solution would appease most - if not all - participants.
>
>
>       I really don't think this is too important. I would definitely prefer to
> follow the *general* conventions rather than forging our own path.
>
>
>
>
>               For this change to take place, we need to (not necessarily
> sorted):
>               1) Rename the python variables named "gem5" in
> src/systemc/tlm_bridge/TlmBridge.py (or remove them - I don't remember
> finding where they are used);
>
>
>       Why does this need to be done? These are class names, not
> namespaces.
>
>
>
>               2) Add a section to our coding style mandating snake case for
> namespaces;
>
>
>               3) Change all existing namespaces to snake case;
>
>
>               4) Create a verifier to enforce this convention.
>
>
>               5) Rename/Move elements starting with gem5X/m5X as
> gem5::X
>
>
>
>               Finally, regarding macro names, we could improve the
> corresponding Jira issue by listing all current macros so that we can start
> applying the change and raise objections to particular instances.
>
>
>               Cheers,
>               Daniel
>
>
>       _______________________________________________
>               gem5-dev mailing list -- gem5-dev@gem5.org <mailto:gem5-
> d...@gem5.org>
>               To unsubscribe send an email to gem5-dev-le...@gem5.org
> <mailto:gem5-dev-le...@gem5.org>
>               %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
>
>       _______________________________________________
>       gem5-dev mailing list -- gem5-dev@gem5.org <mailto:gem5-
> d...@gem5.org>
>       To unsubscribe send an email to gem5-dev-le...@gem5.org
> <mailto:gem5-dev-le...@gem5.org>
>       %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

IMPORTANT NOTICE: The contents of this email and any attachments are 
confidential and may also be privileged. If you are not the intended recipient, 
please notify the sender immediately and do not disclose the contents to any 
other person, use it for any purpose, or store or copy the information in any 
medium. Thank you.
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to