Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Can you link to an implementation you would consider great?

I would just like to compare them. I too find Uncle Bobs “clean code” book very much overrated.

My understanding of the “design” aspect of TDD is, that you start from client code and create the code that conforms to your tests. Too often I worked in a team with other developers and I wanted to use what they wrote, and they somehow coded what was part of the spec, but it was unusable from my code. Only because I was able to change their code (most often the public API) I was able to use it.



It stores it as a collection of edges? Why not use adjacency list representation?

You iterate through all of the edges every time to find a nodes neighbors?

idk, this code just looks terrible to me.


But TDD (the main topic being discussed here) has nothing to do with that, right? I mean, how on earth is TDD going to help you decide between a) using a simple data structure like a collection and b) a more sophisticated data structure like the adjacency list, if you have no idea what an adjacency list is?


Yeah I was only commenting on what was being discussed in this particular subthread about whether this was good code/design.


But now you have the tests to be able to refactor the implementation and improve it.

I’ve been in too many projects where devs almost never write tests. They cut corners by neither writing tests nor documentation because of time pressure. Then the code breaks in production with simple edge cases like NullPointerException and they need to fix it, so they don’t have time to write unit tests for the next feature. And it’s definitely harder to write tests after you implemented something.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: