4 ms·
> How does passing the length as a separate parameter lead to more bugs than having it bundled It boils down to being inconvenient, unreliable, error prone, an
by WalterBright 5y ago
> How does passing the length as a separate parameter lead to more bugs than having it bundled
It boils down to being inconvenient, unreliable, error prone, and difficult to audit. That's why it isn't used and C's #1 problem remains buffer overflows. And so it goes for all the other solutions for C for this problem, except my proposal.
My proposal is how D works, and it's been convenient, reliable, robust and auditable for 20 years. You can still use raw pointers in D, they are fully supported, but the use of the arrays make use of raw pointers rare.