Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

foreache

Name: Anonymous 2014-01-20 18:58

what is you're opinion on foreache loops?

i don't like em cuz they ache in the fore

Name: Anonymous 2014-01-24 3:42

>>151
I think you're using ``list'' to mean ``container''. You can use it this way, but I'm not sure its very useful.

This is probably what led you to try to ``improve'' it. More accurately, it's what led me to lead you into ``improving'' it.

Moving on, a more useful definition of ``list'' is when ``list'' means ``linked list'', i.e. a concrete datastructure that comes with one set of tradeoffs with regards to the asymptotic characteristics of the algorithms which operate on it.

O(n) access and length operations are just part of what a list is. Nevertheless, lists have many many many uses where operations on them are efficient for the things which that list represents; stacks are obvious, queues require a bit of cleverness, many different types of graphs and trees. Lists also have low complexity constants (on most hardware) for many algorithms, so for small data sets they're good at things they're not good for ;) e.g. they're a more efficient representation of small sets than hash tables.

I think if you adopt this view on lists, you will not get any ideas that they need ``improvement'' because there is nothing to really improve. Lists are what they are, and you can analyze algorithms over them, and decide what to use lists for and what not to.

If you're interested in pushing lists to their limits, or getting a really deep understanding of programs, datastructures, algorithms, all these neat things, and I mean really deep satori like understanding, I recommend studying Common Lisp. You are intelligent, obviously, but not wise. Common Lisp will give you wisdom.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List