6 ms·
I’m definitely missing the point, but reading the article, I kept thinking "This would’ve been so much easier in C."
by Enthouan 1y ago
I’m definitely missing the point, but reading the article, I kept thinking "This would’ve been so much easier in C."
- deleted 1y ago[deleted]
- trealira 1y agoI don't see how it would be easier. Whatever you can do in C, you can do in C++. That said, I was also a bit confused, since I guess I don't keep up with the latest C++ updates enough.
- quotemstr 1y agoNo, it would be impossible in C, the "it" here being the automatic conversion of a struct to an array of the struct's fields. Sure, you can do that pretty easily by hand in C, but you can also do it easily by hand in C++, so whatever. The point of the article is the metaprogramming.
- zahlman 1y agoI get the impression that ("pure") C programmers say things like that because they don't get themselves into situations where they feel they'd want the metaprogramming.
- quotemstr 1y agoThey might think that they don't need metaprograming, but like everyone else, they eventually do. That's how we get monstrosities like https://github.com/freebsd/freebsd-src/blob/master/sys/sys/queue.h https://github.com/freebsd/freebsd-src/blob/master/sys/sys/q... (plenty of Linux equivalents --- e.g. the tracepoint stuff) Better to use a language with thoughtful metaprogramming than tack it on badly later.
- em-tg 1y ago[dead]