4 ms·
C + a set of macros is a more powerful programming language.
by cperciva 4y ago
C + a set of macros is a more powerful programming language.
- JUNGLEISMASSIVE 4y ago[dead]
- Night_Thastus 4y agoAlso a far worse language though. Macros have their place, but trying to do anything complex with them just turns into a total nightmare. They're hard to reason about, walk through, or modify. If heavy macro usage is found, it's definitely time to reconsider the approach.
- cperciva 4y agoIt really depends on how macros are used. If you're just using them to implement "high level language features", it's not a problem; sure, you might have trouble figuring out what STAILQ_INSERT_TAIL does internally, but you're going to have just as much trouble figuring out what the Lisp or Perl or Python "add this item to the end of that list" operations do internally. Macros can be a nightmare, but when they're used properly they're not.
- WalterBright 4y ago> when they're used properly they're not Yeah, they are. Source: Decades of C programming
- cperciva 4y agoYou're not the only person with decades of experience.
- WalterBright 4y agoWe all suffer from this, so it's not personal, but one is too often blind to the shortcomings of one's own code.
- cperciva 4y agoYou must be aware that I'm not the author of BSD sys/queue.h.