3 ms·
It's remarkable that people will say that doing this kind of thing is better than learning a language which actually lets you enforce this with the type system.
by pjc50 2y ago
It's remarkable that people will say that doing this kind of thing is better than learning a language which actually lets you enforce this with the type system.
(or even just insist that users use the version of the language which supports "constexpr"!)
- oguz-ismail 2y agoWhat language is that? Is it available everywhere (everywhere) C is?
- mitthrowaway2 2y agoIndeed, usually if I'm using C these days it's because I only have access to a c compiler for my target platform, or because I'm modifying an existing C codebase.
- uecker 2y agoI do not think anybody said this. The point is that these macros work for early versions of C. If you need to support early versions of C, learning another language is not a solution. If you don't have to, you can use C23's constexpr.
- trealira 2y agoC used to seem like a beautiful and simple language to me, but as I used it and learned more about it, it seemed more complex under the surface, and kind of janky as well. It's just utilitarian.
- wat10000 2y agoLearning such a language doesn’t mean I can use it.
- o11c 2y agoThe problem is that no such language exists. There are many languages that provide one particular feature that C doesn't provide, but they do this at the cost of excluding numerous other features that C widely relies on.
- kjs3 2y ago"I have no idea what problem you're trying to solve, what the constraints are, what the use cases might be, what tools are available on the platform, what the job or regulations require, what the skillsets of the people involved are, what the timeline is...but I'm absolutely, unshakably certain that I have a magic bullet that will make all your problems go away." FTFY.