4 ms·
From my experience, trying to make C type safe is counter productive. It's perfectly possible to do generic vectors in C without twisting the language. This im
by codr7 1y ago
From my experience, trying to make C type safe is counter productive.
It's perfectly possible to do generic vectors in C without twisting the language. This implementation isn't as safe as alternatives in other languages, but plays well on C's strengths.
https://github.com/codr7/hacktical-c/tree/main/vector https://github.com/codr7/hacktical-c/tree/main/vector
- uecker 1y agoWhy would you think this? My implementation is type and bounds safe and nice to use.
- codr7 1y agoBecause that level of (type) safety and C is a bad fit.
- uecker 1y agoI assume you do not want to elaborate why you think it is a "bad fit". IMHO it is perfect.
- codr7 1y agoBecause you're using the pre-processor to create a new language, which we have pretty much agreed is a bad idea. If you want that level of safety, why not use a language that provides it for you?