4 ms·
> (I’ve met programmers with years of experience who couldn’t write code to maintain a linked list. FFS, our industry is huge and there are many problem domain
by ahallock 10y ago
> (I’ve met programmers with years of experience who couldn’t write code to maintain a linked list.
FFS, our industry is huge and there are many problem domains and many specialized areas of expertise, most of which don't require you to write linked lists. It's like expecting someone who's building windshield wipers for a car to also know how build an alternator (this analogy may not be great, but you get the idea).
I'm sure if someone spent half an hour brushing up on linked lists, they could easily create one. If you don't do something a lot, you forget. You get rusty. Why is this so hard to understand? This is true in any discipline.
- hughw 10y agoC'mon man. A linked list. edit: To use one, you need a mental model of how they work, so you should be able to write one. Not a great one... just one that works.
- Sharlin 10y agoA linked list is one of those things everybody thinks is trivial to write until they actually try to write one that supports all the normal operations and actually works in all corner cases.
- robotresearcher 10y agoWhich is one of the reasons why we give it has homework in college. Not because you're going to do it in the workplace, but because (a) you see how the implementation entails the big-O behaviour you learned about, and (b) it's simple but tricky, thus training you to consider every aspect carefully. Aspect (b) is why people ask about it in interview questions. You are not expected to remember the details, you are expected to think about them as you go.
- NotSammyHagar 10y agoWhat are all those corner cases and hard problems? I routinely ask interview subjects to write code to manage a linked list (it was a small part of a problem in a previous job), and I've been asked to write a ll class. Writing a linked list is like hiring someone to be a professional driver, and you want to make sure they know that you can change tires, and that one should adjust mirrors to be able to see behind the car.
- ahallock 10y agoI suppose you're right, but really, in what context do you need to do this? I've never had to do this in over 15 years of software development. I remember learning LLs in college, and it's good foundational knowledge -- it teaches you how to solve problems. I'm not saying we shouldn't learn these core concepts and algorithms, just that some people want to feel better about themselves and make others feel inferior when they can't remember something at a moment's notice, especially something they haven't used in over a decade.
- hughw 10y agoI might need you to build something listy on disk, and I would say, "you can give the records two-element headers and make it work like a doubly linked list"... you would know exactly how to do that.
- hughw 10y agoI had to do something like this a year or so ago -- built a malloc in js for managing WebGL memory blocks.