4 ms·
Exactly, and C is the worst offender for boilerplate code. There isn't even a list abstraction! It's surprising that there's an array abstraction and that peopl
by sid0 16y ago
Exactly, and C is the worst offender for boilerplate code. There isn't even a list abstraction! It's surprising that there's an array abstraction and that people aren't just forced to use pointer arithmetic.
- geoka9 16y agoThis is not fair. C was (and still is) intended for situations where writing your own list abstractions is the right thing to do. Unlike lists, the array abstraction doesn't cost anything, as it's just straightforward pointer arithmetic underneath. This is why it is in the language.
- Peaker 16y agoThere are list abstractions in libraries. See the Linux kernel's list.h for a very nice and generic linked-list implementation.