Skip to content

Comment on Intrusive linked lists (2019)

Comments

Is this sort of thing no longer part of a standard computer science or software engineering undergrad curriculum?

When did you last encounter or use a linked list ? :)

Linked lists fell out of fashion once the cpu/memory latency gap opened up towards the end of the 1990s. For most use cases it's simply better to use a tightly packed array, even use cases where linked lists would intuitively make more sense.

Every day, all day. It is a myth that linked lists fell out of fashion.

Of course, "it depends". There are things that better live in tightly-packed arrays (large lists of free-standing objects), but there are things that are almost impossible without linked lists. In these cases, being "intrusive" has massive advantages.

I guess you can spend an entire coder career without having to use linked lists, and then you cannot imagine why anybody would ever use them (and make it a meme). The linked lists that do exist in your programs may be abstracted away from your visibility.

Therefore: sure, an article about linked lists will spawn numerous HN comments from such coders who don't know the shoulders they're standing on. It's linked lists all the way down... below the flat surface of high-level frameworks.

Anything where you use a state machine that has to remember the parent state is effectively an intrusive linked list (even if they rarely have more than two elements); similarly the most obvious implementation of undo/redo. In these uses it's less complex and more understandable than having an explicit container, and constant-factor performance is irrelevant since we're talking about spending a few clock cycles to retrieve information in response to a human-speed GUI interaction.

You might also note that TFA is much more recent than "the end of the 1990s" and describes one of the most important software systems out there, which to the best of my knowledge still uses these techniques in the same way.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.