31 ms·
> I would argue part of the problem is that the majority of developers are computer science illiterate. While I wouldn’t argue against that... Sometimes peopl
by bigiain 6y ago
> I would argue part of the problem is that the majority of developers are computer science illiterate.
While I wouldn’t argue against that...
Sometimes people who do know what they’re doing choose slow algorithms knowingly.
I implemented a way finding algorithm that works in O(n^4) a while back. Because I knew the specific use case we needed it for had a max of around 200 for n, and that I could run a brute force of all possible routes for that in less than a minute in unoptimised Python on my laptop, so that I could then cache all the results and just do a very fast lookup from a ~40,000 row database table in production. I was very very clear to everybody concerned that this solution was not a scalable general solution, but it worked like magic for what our customer needed.
- sitkack 6y agoYou applied global optimization, which I wish we could do more often. Part of the type system should encode how long the fn call is allowed to take.