Hacker News new | ask | show | jobs
by pjc50 1555 days ago
> If I know that a class will need to be accessed from multiple threads, I am not allowed to use locks, concurrent data structures or lock-free patterns until I add the first test that checks for multiple thread access. When that happens, I need to throw away almost all of the previous implementation. The same happens for any special data structure or algorithm that I know in advance will be necessary to solve the high-level problem, but it takes tens of tests to reach a point where the "simplest solution" no longer works. As an exercise, consider implementing a Union-Find data structure while constraining yourself to never writing a line of code that is not the simplest thing to solve the current test.

Who's imposing that constraint on you? Why? Can't you negotiate your way out of that?

1 comments

TDD. That's the point of TDD and that's what people are arguing against. If you relax this constraint, you get something different.