Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Classes VS Namespaces #7434

Closed
RiccardoRossi opened this issue Sep 8, 2020 · 1 comment
Closed

Classes VS Namespaces #7434

RiccardoRossi opened this issue Sep 8, 2020 · 1 comment
Assignees
Labels
C++ Consensus Consensus has been reached about the current issue

Comments

@RiccardoRossi
Copy link
Member

RiccardoRossi commented Sep 8, 2020

Description

In PR #7039 a discussion started about exporting to python free functions as part of new user specified namespaces.

After discussion in @KratosMultiphysics/technical-committee we reached the consensus to keep the current usage, that is, to have static methods exported as members of classes and not as free functions within specific namespaces

The rationale of this is

  • classes allow private members and methods while namespaces don't
  • classes can be templated
  • KRATOS_API has to be added only once

On the other hand the @KratosMultiphysics/technical-committee agrees in principle about adding a limited number of namespaces, on the line of "internal", "utilities", "processes" in order to better organize the code and to benefit of better code suggestions by modern editors. However to avoid the proliferation of such namespaces we require that this is agreed to by the @KratosMultiphysics/technical-committee

We shall also observe however that adding such namespaces for existing classes, for example for processes and utilities, would imply a very large effort, so we would need to consider this carefully before actually doing it.

This message should be ported to our coding style guides.

@roigcarlo
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C++ Consensus Consensus has been reached about the current issue
Projects
None yet
Development

No branches or pull requests

4 participants