|
|
|
|
|
by vshan
1742 days ago
|
|
I'd argue the opposite really, re: 'using C/C++ at all is probably "too clever"'. By using modern C++ features it is possible to enforce a Rust-like model of ownership, without any memory management (eg. we don't use 'new' or 'delete' anywhere in our codebase). This helps reduce what the author calls "complicated, Klein-bottle-wannabe tricks", labyrinthine Java classes of GC goodness where you don't know where the code begins/ends. |
|
C++ fans always claim this is possible, but can never say how to determine whether any given codebase follows their rules, or give examples of e.g. popular open-source libraries that follow that approach. So I've stopped believing in it, personally.
> This helps reduce what the author calls "complicated, Klein-bottle-wannabe tricks", labyrinthine Java classes of GC goodness where you don't know where the code begins/ends.
I find that claim extremely dubious. The problems of such code are very rarely due to not having clear directions on any local ownership relationship, and lifetimes are not actually visible in C++ in any case.