News for hackers. Stuff that matters.
Re:In Defense of Linked Lists by mastax on Friday November 04, 2022 @07:52PM (#33475807)
C++'s STL linked list for comparison (libcxx).

https://github.com/llvm-mirror/libcxx/blob/master/include/li...

Re:In Defense of Linked Lists by kortex on Friday November 04, 2022 @08:09PM (#33476011)
Oof. Yeah, standard lib code tends to be harder to read on average than application code. But at least I can mentally parse the Rust code. Heck it even looks like a linked list impl. The c++ code looks barely better than line noise. I'm sure I could wrap my head around it, but ho boy, it's far worse than Rust by a long shot.

And this is with several years cpp experience, and maybe a few months of Rust on and off.

Re:In Defense of Linked Lists by einpoklum on Friday November 04, 2022 @08:31PM (#33476219)
Rust's list only supports a default allocation mechanism. For an actual comparison, you'll want to show us a Rust implementation which is parametrized over allocators.

Having said that - yes, it's not pretty. About the same length though.

Re:In Defense of Linked Lists by mastax on Friday November 04, 2022 @08:38PM (#33476294)
Adding allocator support does add a bit more noise:

https://github.com/rust-lang/rust/pull/103093/files#diff-8bd...