News for hackers. Stuff that matters.
Re:Why do arrays start at 0? by ZephyrBlu on Wednesday August 24, 2022 @07:57PM (#32587518)
What do you consider "high-level code" and in what way does deeply understanding how a computer works influence your approach?
Re:Why do arrays start at 0? by iopq on Thursday August 25, 2022 @02:18AM (#32590222)
In college, I optimized the array removal routine from O(N^2) to O(N) by using INVARIANTS

But it probably ran in like 100us anyway

Re:Why do arrays start at 0? by aspyct on Thursday August 25, 2022 @03:24AM (#32590672)
Ugh, invariants...

Anyway, complexity stays relevant, no matter what language you use. That's the real deal.

Re:Why do arrays start at 0? by iopq on Friday August 26, 2022 @05:17AM (#32604967)
It only stays relevant if the JavaScript is too slow. In the case of removing two elements from an array of length 8, it's not too slow to remove them one by one since, again, it runs in microseconds