4 ms·
This seems like a lot of lost optimization opportunities compared to a language which gets this right out of the box. Also in most cases people's destructors d
by tialaramex 3y ago
This seems like a lot of lost optimization opportunities compared to a language which gets this right out of the box.
Also in most cases people's destructors don't have associated local state, so, they needn't take up space in each object. All C objects have non-zero size, so if you have an object representing the destructor even if it has no state that takes up space. In C++ there's a hack to avoid paying this price, but in C there is not.
- gavinhoward 3y ago> This seems like a lot of lost optimization opportunities compared to a language which gets this right out of the box. Well, yeah, but I hate all other languages [1], and I'm willing to pay the price in C. That same sort of thing allowed me to implement RAII in C, though. [1]: https://gavinhoward.com/2023/02/why-i-use-c-when-i-believe-in-memory-safety/ https://gavinhoward.com/2023/02/why-i-use-c-when-i-believe-i...