sofa-framework / sofa

Real-time multi-physics simulation with an emphasis on medical simulation.
https://www.sofa-framework.org
GNU Lesser General Public License v2.1
934 stars 312 forks source link

BaseObject::init "call super" code smell #785

Open guparan opened 6 years ago

guparan commented 6 years ago

All Components in SOFA need to call Inherit1::init() in their init() to propagate the init process to base classes.

A solution to this problem was proposed in #754 but not accepted. Better solution has been implemented in https://github.com/guparan/sofa/tree/fix_call_super_code_smell and needs a final (big and boring) work to be ready: removing all existing init super calls.

To be done during a sprint...


Suggested labels:

epernod commented 6 years ago

not possible by a script?

guparan commented 6 years ago

I did a dumb one here but it is far from covering all possible cases.

damienmarchal commented 6 years ago

Hello,

Nice work Guillaume,

In sofa I often see the use of first uppercase to indicate static method...so 'I'nit() is misleading. cannot use a different naming scheme (or stop using uppercase to indicate static method ;).

guparan commented 6 years ago

Note from a dev meeting: what if we create a doInit() method instead of meta Init() ?

hugtalbot commented 4 years ago

This is linked to #274