5 ms·
Which of these are scandalous, exactly? If the OP is aggrieved by the operation of cpp, perhaps they could have explained in each of their points what cpp is d
by joosters 6y ago
Which of these are scandalous, exactly?
If the OP is aggrieved by the operation of cpp, perhaps they could have explained in each of their points what cpp is doing wrong, and how they would improve the standard. Instead, they just list 'odd' behaviour, with no comment about why it is wrong and how it could be better.
- klyrs 6y agoThis document immensely valuable in enumerating pitfalls in the spec and in how the spec is interpreted by various implementations. I would wager that most good-faith* C programmers are weary of overusing cpp, and use a limited subset of its capabilities. This is a great resource to throw at a junior who gets too excited about macros, for example. * where I'm defining "bad-faith" C programmers as using it for sadistic purposes like IOCCC, golf, etc > perhaps they could have explained in each of their points what cpp is doing wrong, and how they would improve the standard. This is a fairly toxic attitude, and possibly the reason that your comment is unpopular. A child can correctly observe that an emperor is not wearing clothes, and bring that up without possessing the skill to make the emperor a suitable outfit.
- joosters 6y agoI just found the article odd; it starts off by declaring the behaviour of cpp to be objectionable, but then it just lists different aspects of its actions. At no point does the OP complain that cpp is doing the wrong thing - indeed, they point out in several places that it couldn't really be changed to do anything else because either it would break existing code, or would be just as odd if it behaved in another way. So I'm wondering just what it was they were scandalized about? I'm not demanding that they fix cpp themselves! At least the child told people that the emperor was wearing no clothes; a more apt analogy with this article would be as if the child merely said "that's scandalous!" without telling anyone about the missing clothes...
- klyrs 6y ago> 1) No Comprehensive Standard Here the "scandal" is that the "standard" is poorly specified, and therefore isn't much of a standard. This seems to be the root of the scandal, and all else appears to flow from here. > 2) Context Free, Just Kidding! Here the "scandal" is regarding to context sensitivity -- the author vacillates about the status of the "scandal" but still, it seems clear that they're identifying context-sensitivity as scandalous. > 3) Whitespace Insensitive, Just Kidding! Here the author considers irregularities in how "whitespace sensitive" cpp is -- both in the "spec" and in implementations, with an example of non-portability between gcc and clang. et cetera
- asjw 6y ago> A child can correctly observe that an emperor is not wearing clothes Not wearing clothes is what CPP does by default And it's hardly an emperor, it's more the guy who makes copies
- asveikau 6y agoA bunch of these can't really be changed without breaking massive amounts of existing code, either. Other languages whose designers were not pleased with C macros either avoided use of a preprocesor entirely, or, like c++, came up with alternative means of compile time flexibility. (Like templates)