3 ms·
This is an advice to use C in a way that resembles higher level languages. But it you want to do so, why not simply use a higher level language? The power of C
by rumcajz 11y ago
This is an advice to use C in a way that resembles higher level languages. But it you want to do so, why not simply use a higher level language?
The power of C -- which distinguishes it from most other languages -- is the ability to allocate almost everything statically.
In fact, the older I get the more I appreciate pre-Algol60 way to allocating stack frames statically.
- sortie 11y agoWhether C is appropriate is highly depending on the project and context. Higher level languages offer a lot and should be used when appropriate. But when C is appropriate, and these problems arise, which they will in any C codebase of appreciable complexity, these string creation interfaces are waiting for you, and will help you write correct code. It's usually a worthwhile effort to reconstruct higher level abstractions in C, in a good manner, for the same reasons you use them in higher level languages. Note that statically allocating everything is hardly always possible. See the distinction between bounded and unbounded in the article, the unbounded case is really common.