News for hackers. Stuff that matters.
Re:“Clean” Code, Horrible Performance by joaonmatos on Tuesday February 28, 2023 @06:32PM (#34976471)
Are you even manually implementing sorts frequently?

Even languages that are notorious for having tiny libraries, like C and JS, have built-in sorts.

Re:“Clean” Code, Horrible Performance by mattgreenrocks on Tuesday February 28, 2023 @07:37PM (#34977136)
It’s less about accidentally writing n^2 sorts and more about not accidentally creating n^2 algorithms.
Re:“Clean” Code, Horrible Performance by whstl on Tuesday February 28, 2023 @10:16PM (#34978337)
Not sorting, but very simple algorithms that can't afford having O(n^2) performance? That's common even in CRUD apps.
Re:“Clean” Code, Horrible Performance by dagw on Wednesday March 01, 2023 @04:42AM (#34980474)
Perhaps not sort so much, but certainly with search I've seen people roll their own inefficient search functions many times.
Re:“Clean” Code, Horrible Performance by joaonmatos on Sunday March 05, 2023 @05:11AM (#35028300)
It is the exact same situation, though. Most people can just chain a sort and a binary search to do it, and both are included in most languages. Or just put it into a tree map, if your language has it.