speed of array vs list, is one of the most misunderstood thing mouthed by hacker idiots. their speed properties, has nothing to do with math of algorithms, but hardware. more specifically, parallel nature of electronics of memory circuits.

i struggled to understand this for over 10 years. the question is this: why array has constant random access time. (but not list) ask a hacker programer, they'll drivel. (including text books) the real answer is, parallel electronic circuits.

this non-math/algorithm properties of speed in programing languages, is a huge problem. i think the problem is that we don't think of hardware esp in high level langs, such as python haskell. but ALL concrete algorithms must have a machine to work on.

when coding high level lang eg python haskell, we no think hardware, cuz the compiler to machine code is incomprehensible. a solution is for each lang to also specify a pseudo high level hardware, so any algorithmic properties of the lang's constructs r apparent to eyeball.

the entire scott meyers' talk, is a exhibit of the disconnect of programing lang and hardware. youtube.com/watch?v=WDIkqP4Jbk

it's funny. when coding python haskell etc, sequential algorithm in nature, but when you have myArray[99], then suddenly, bang, parallel computing is actually going on. This is all the misinfo and complexity began.

not to mention speculative execution, branch prediction, cache prefetchin etc. meltdown and spectre are 2 consequences of these non-math voodoo.

Sign in to participate in the conversation

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!