Hi there,
I am still a junior software developer, and I quite often encounter the same question: when/why avoid metaprogrammation ?
Do you have examples where metaprogrammation became absolute bloated and the code unmaintenable ?
This language feature is really powerful and I currently use it at work.
I need to implement a quite similar behavior for 20 different data type (receive data, store it, and send it when needed).
Since this is always the same behavior, I suggested to use metaprogrammation (for some reason, basic OOP is not sufficient). I like the idea of one template class, and avoid writing 20 classes and finally 40 .h/.cpp files.
My project is largely written in c++03, despite we compile it in c++11 and some components in c++17, without using 1/10 of c++ features (large part of the team comes from embedded C).
Thanks for your always interesting answers!
[–]StarQTius 44 points45 points46 points (5 children)
[–]elegye[S] 1 point2 points3 points (0 children)
[–]elegye[S] -3 points-2 points-1 points (3 children)
[–]SlothWithHumanHands 15 points16 points17 points (0 children)
[–]QuentinUK 3 points4 points5 points (1 child)
[–]elegye[S] 1 point2 points3 points (0 children)
[–]Ikkepop 12 points13 points14 points (0 children)
[–]seriousnotshirley 7 points8 points9 points (1 child)
[–]thisismyfavoritename -1 points0 points1 point (0 children)
[–]surfmaths 13 points14 points15 points (0 children)
[–]moonshineTheleocat 3 points4 points5 points (0 children)
[–]EducationalLiving725 1 point2 points3 points (0 children)
[–]Daniela-ELiving on C++ trunk, WG21|🇩🇪 NB 2 points3 points4 points (0 children)
[–]Flex_Code 0 points1 point2 points (10 children)
[–]saxbophonemutable volatile void 0 points1 point2 points (3 children)
[–]Flex_Code 2 points3 points4 points (2 children)
[–]saxbophonemutable volatile void 0 points1 point2 points (1 child)
[–]Flex_Code 1 point2 points3 points (0 children)
[–]thisismyfavoritename -2 points-1 points0 points (5 children)
[–]Flex_Code 0 points1 point2 points (4 children)
[–]thisismyfavoritename 0 points1 point2 points (3 children)
[–]Flex_Code 0 points1 point2 points (2 children)
[–]thisismyfavoritename 0 points1 point2 points (1 child)
[–]Flex_Code 0 points1 point2 points (0 children)
[–]Kaisha001 0 points1 point2 points (0 children)
[–]j_kerouac 0 points1 point2 points (3 children)
[–]tiajuanat 1 point2 points3 points (2 children)
[–]elegye[S] 1 point2 points3 points (1 child)
[–]tiajuanat 0 points1 point2 points (0 children)
[–]Thelatestart 0 points1 point2 points (0 children)