Hacker News new | ask | show | jobs
by layer8 56 days ago
> Woah, iterating over pointers instead of indexes! […] However, I'm not sure how good an idea that is.

I’d recommend anyone (including the author) wanting to understand C to read K&R’s “The C Programming Language”, which among other things will illustrate how iterating over pointers is idiomatic in C (though not quite in the way the author’s example does it).

1 comments

GLib simple C data structures:

https://docs.gtk.org/glib/data-structures.html#doubly-linked...

GSL GNU Scientific Library for C:

https://www.gnu.org/software/gsl/doc/html/intro.html

In general, no one should be custom building most basic structures in C these days. =3

Disagree. If you stop building it, you lose the knack. Secondly, more dependency centralization confers a degree of "elevation" to early comers that just really chafes my "programming is math" chops.

Then there's the Trust issue. If something goes wrong, it's my fault if I wrote it. I'm not going to argue with people who reach for "You're holding it wrong" reflexively.

t. Has spent time reimplementing basic data structures just because.

In general, there are a lot of platform specific issues that most people will just ignore... rather than address the odd edge-case failure modes or thread safety. =3
Yes. And this is what C++ iterators evolved from.