I strongly object promoting such a thing as a general "Style Guide". It can be
a help or last resort if you are forced to work with improper tools (a
situation that’s rather frequent in practice though). As such it is well
chosen and practical.
But basically, it shows several things:
* you are using a global namespace
* you deal with way to fat interfaces
* you mix deployment metadata (a version/compatibility check) with functional
code
All of this indicates some design style breakage, so it would be preferable to
fix the design if possible.
The only part I’d like to support as a Style Guide is the rule of using the
"verb+object" pattern for creating function names
— Ichthyostega
Probably needs little explanation:
* you are using a global namespace
This is only about C for names which get exported, C only has a global
namespace and we need some way to get unique names. The
Lumiera/DesignProcess/AllPluginInterfacesAreC already uses
better/smaller namespaces by defining interfaces as C structs. The full blown
long names explained here are technically not needed when we use the plugin
system as proposed, I just shown them here for completeness. Next, when we
decide for alternative linking methods like static builds we would need to
declare all "verb+object" functions static, else there is a high probability of
clashes.
-
you deal with way to fat interfaces
How can you tell that? This is only a nameing style. No interfaces mentioned
here. I am all after small well defined specialized interfaces.
-
you mix deployment metadata (a version/compatibility check) with functional
code
Yes, I cant figure out how to do it better but still lightweight in C. the
_version thing is something I added here after the interfaces proposal. I work
on a example how this will be used in a more friendly way.
Note again that this is a "nameing system", it is intended to be very verbose
and give unique declarative names. It is not about design! Design is done as
usual and only when things have to be exported as C symbols (both, exported and
C!!) this applies. This has zero implication for C++ code, zero implication
for C functions which are not exported (while I personally still prefer this
style) and finally when we do the interfaces thing like I proposed, then the
naming can be much simpler, see examples there or in my repository.
— ct
Thanks, your explanation together with the example in git made the usage
pattern much more clear. I think the _version postfix is esp. helpful on the
names of the plugin interfaces (structs in C), and probably it will be a good
practice, to have one such common plugin interface on every "plugin extension
point", i.e. every point in the sytem, that can be extended by plugins.
— 217.110.94.1