3 ms·
C macros are best left unused when possible. Blame the committee for failing to specify an obvious and widely-demanded feature like named parameters. The only
by CamperBob2 2y ago
C macros are best left unused when possible.
Blame the committee for failing to specify an obvious and widely-demanded feature like named parameters.
The only explanation is that the people in charge of the language don't write much code.
- szundi 2y agoOr they do and don’t want to learn stuff as “everything can be done the old way anyway”
- jimbob45 2y agoThere are a lot of syntactic sugar improvements the committee could make that they simply refuse to. Named parameters and function pointer syntax are compile-time fixes that would have zero runtime costs, yet it's 2024 and we've hardly budged from ANSI C.
- CamperBob2 2y agoExactly. I actually think default parameters are hazardous without named-parameter support. When they added one, IMO they should have added the other as well, so that you can specify exactly which non-default parameters you're passing.
- kevin_thibedeau 2y agoI think this is more an appeasement of the C++ committee because they don't like the order of evaluation to be ambiguous when constructors with side effects come into play. Witness how they completely gimped the primary utility of designated initializers with the requirement to have the fields in order.
- deleted 2y ago[deleted]