Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
FutureNerd
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
6 ms
·
1.
▲
by
FutureNerd
17y ago
Some people here think this is about coding without testing. No, it's an example of thinking through before testing, about the kind of thinking that's separate from testing. It's not meant as an example of what all programming is about,
2.
▲
by
FutureNerd
17y ago
No, there's a point to doing the unnatural thing of, "Keep working on it till you're sure you got it right."
3.
▲
by
FutureNerd
17y ago
I have to say that the usual way of writing binary search recursively doesn't help break the problem down. It's already as broken down as it gets, and you're just tweaking the single case. The loop version wins for clarity. I think second
4.
▲
by
FutureNerd
17y ago
Going back to Bentley, the point was not to code without testing but whether you could think through a small piece of code <i>before</i> testing. raganwald says, "It feels very retrograde to try to write the whole thing out
5.
▲
by
FutureNerd
18y ago
I was thinking along eru's lines. The specifics I came up with: 1) Compress sorted lists by encoding the differences between successive numbers using a code that's shorter for smaller numbers. 2) Use in-memory merge sort. That way you don'