←back to thread

271 points mithcs | 1 comments | | HN request time: 0s | source
Show context
khaledh ◴[] No.45953354[source]
The problem with macro-laden C is that your code becomes foreign and opaque to others. You're building a new mini-language layer on top of the base language that only your codebase uses. This has been my experience with many large C projects: I see tons of macros used all over the place and I have no idea what they do unless I hunt down and understand each one of them.
replies(3): >>45953891 #>>45954270 #>>45954282 #
1. naasking ◴[] No.45953891[source]
I think this can be fine if the header provides a clean abstraction with well-defined behaviour in C, effectively an EDSL. For an extreme example, it starts looking like a high-level language:

https://www.libcello.org/