3 ms·
Template specialization means more generated code, which, again, must fit in 2kb. On very old archs (16bits, 8bits), there was no OO, because the code could no
by sixfiveotwo 2y ago
Template specialization means more generated code, which, again, must fit in 2kb.
On very old archs (16bits, 8bits), there was no OO, because the code could not be complex enough to warrant it. It could not be complex because there wasn't room enough.
That being said, there are templated libraries (like fmt...) which may result in zero overhead in code size, so if the thread OP is using C++, then surely he could also use that library...
- ender341341 2y ago> Template specialization means more generated code, which, again, must fit in 2kb. modern compilers are way better about de-duplicating "different types but same instruction" template specializations so it's less of an issue than you may expect , especially if you're coming with template specialization generation from the mid/late 2000's.
- pjmlp 2y agoNo different from copy-paste hard to debug preprocessor code.
- sixfiveotwo 2y agoThis is not my claim.
- pjmlp 2y agoIt actually is, as it is voiced in a way as if preprocessor was better than using templates.
- sixfiveotwo 2y agoYou'll have to quote me, I don't see where I am implying that. But anyway, the point that I am refuting is the use of C++ to write programs for such an extremely constrained runtime environnement, and at the same time refuse to use this library (which is template based afaik).
- pjmlp 2y ago"Template specialization means more generated code, which, again, must fit in 2kb." Have fun, "Rich Code for Tiny Computers: A Simple Commodore 64 Game in C++17" https://youtu.be/zBkNBP00wJE?si=im0ga3rW08mR8g8f https://youtu.be/zBkNBP00wJE?si=im0ga3rW08mR8g8f
- sixfiveotwo 2y agoThat quote does not imply anything about C macro being better in any way, but I am nevertheless delighted that you could prove me wrong somehow. Thank you for this!