3 ms·
Depends on what you mean. In one sense, it's the most common thing in the world, because Common Lisp source code is made of linked lists, so every Lisp program
by mikelevins 6y ago
Depends on what you mean.
In one sense, it's the most common thing in the world, because Common Lisp source code is made of linked lists, so every Lisp program makes extensive use of them. But that doesn't have any necessary relationship to the efficiency of running programs, because the compiled code doesn't have to traverse linked lists just because that's what the source code is made of.
In another sense, it's still pretty common because linked lists are a standard feature of the language with extremely convenient surface-level support, and because linked lists are sufficiently flexible to represent arbitrary data structures (albeit not necessarily efficiently). Those characteristics make it really convenient to use lists for modeling data while you're figuring out how you want things to work, and I personally do that all the time.
Again, that doesn't have any necessary relationship to efficiency in your completed program. I commonly use lists to knock together speculative data models and figure out access patterns. That doesn't mean I'll stick with them once I figure out the needed access pattern. It depends on the access pattern.
If it happens to be the case that linked lists are close to optimal for the access pattern I discover, then I'll stick with them. Why wouldn't I? If not, I'll use another data structure. Lisp makes it easy to design APIs that are agnostic about the data structures they operate on, which makes it easy to swap out one structure for another once you figure out which is the right one.