3 ms·
Does C really need this? Do languages need to grow in this way? The overriding virtue of C is simplicity.
by worik 2y ago
Does C really need this?
Do languages need to grow in this way?
The overriding virtue of C is simplicity.
- vkazanov 2y agoYes it does, and numerous projects already use variants of this trick.
- fuhsnn 2y agoIncluding Linux kernel https://github.com/torvalds/linux/blob/master/include/linux/cleanup.h https://github.com/torvalds/linux/blob/master/include/linux/...
- pjmlp 2y agoThat was lost long time ago, after K&R C became part of WG14.
- ahoka 2y agoC semantics are far from simple.
- cryptonector 2y ago> Does C really need this? Yes. > Do languages need to grow in this way? Yes. > The overriding virtue of C is simplicity. C is not simple. It used to be, but it's not been for a long time.
- cassepipe 2y agoAbout your last point : https://queue.acm.org/detail.cfm?id=3212479 https://queue.acm.org/detail.cfm?id=3212479
- jefbyokyie 2y ago> Does C really need this? No. > Do languages need to grow in this way? No. > The overriding virtue of C is simplicity. It's no longer simple, especially not with the C11 memory model (which got retrofitted from C++11, and is totally incomprehensible without reading multiple hundreds of pages of PhD dissertations); however, gratuitously complicating C shouldn't be done.
- Quis_sum 2y agoC definitely does not need this - in fact I would go as far and consider it harmful. I agree that a feature like this could be useful, but then there are other useful features which should be added too. Where do you stop? I hope the C standards committee does not succumb to the feature bloat trend we see in many other languages (hand on heart: how many people fully understand/master all of C++/23's features?). Need proper arrays instead of pointers to contiguous parts of memory which are interpreted as arrays? Proper strings (with unicode)? Etc. - use a different language suitable for the job. We really need to let go of the notion that complex software must be written in a single language. Use C for the low level stuff where you do not need/want an assembler or where you want full control. For everything else there are more suitable tools.