Better HN
topnewbestaskshowjobs
Log inSign up

asdguinui

3 karma · joined Mar 17, 2023 (3y ago) · 1 submissions

Submissions

comment 3y ago · link · parent

In fairness to the scene, this was the code in question:

https://stackoverflow.com/questions/65753731/why-searching-a...

Hardly clean, I think you'd agree.

In any case, you shouldn't use explicit iteration to solve this problem without a good reason. Every language should have both linear and binary search as part of its standard library.