On Sun, Nov 2, 2014 at 8:02 AM, Bill Ricker <[email protected]> wrote: > On Sun, Nov 2, 2014 at 10:14 AM, Greg London <[email protected]> wrote: > >> My experience has been that having a page instance be mangled >> in some way to behave like a book is almost always going to be >> a regrettable coding decision. >> > > Nice analogy. Agreed. > > As to Ben's comments on Linked lists vs Perl arrays, linked lists tend to > be more flexible for insertion/deletion in the middle for highly dynamic > lists. List::Utils etc and Perl6 give us syntax to splice arrays, but > that's not efficient if doing a lot of that on truly large lists. * List > structures also the starting point for building tree structures (Tree nodes > have N of what list nodes have 1 of ... likewise the algorithms).
Yes, in theory and for very large data structures, this is true. However the performance difference between built-in native operations and code written in Perl is sufficiently large that it is hard to find practical use cases where this is demonstrable in practice. This is even more true when you add Perl's slow method calls on top. Furthermore even when it is, there is no point in complicating your code with them unless there is a demonstrated performance problem. And if there is a demonstrated performance problem, you're probably getting close enough to Perl's limits that I would recommend writing that in a different language. So my experience is, "Arrays are a better answer than linked lists in Perl except when Perl is a bad choice of language." _______________________________________________ Boston-pm mailing list [email protected] http://mail.pm.org/mailman/listinfo/boston-pm

