3 ms·
Why rely on an external tool? All someone has to do here is #include my header and write their templates with a small suffix and prefix. No need to install, c
by rep_movsd 9y ago
Why rely on an external tool?
All someone has to do here is #include my header and write their templates with a small suffix and prefix.
No need to install, configure, script and so on.
Your argument is similar to saying "Why should an IDE parse your code and underline errors? We can run make everytime"
Another advantage of my approach is that you have access to the parsed template as a data structure - that you can compose or modify as you wish.
The only other way to do this is to parse at runtime - which is definitely slower
- avar 9y agoMost people using gettext get it via their package system. Your library is also an external tool they need to similarly fetch & install. And no, my argument is not similar to your IDE comparison. You'd get the exact same thing, parsing / compiling when you compile your project. You'd just offload slightly more work to make & the linker. You can also get access to the parsed version as a datastructure. This is what the gettext library does with its compiled *.mo files. Anyway, I don't think your thing is a useless approach. It's very hacky in C++ but this sort of thing is the best way to do something like this in many other languages. I was just pointing out that there's decades of precedence for achieving the same results in C, i.e. parsing some custom language out of the project at compile-time and shipping it with the binary. Which you (with your "what else is there" question) seemed to be unaware of.