3 ms·
The way I do this is by still writing tests.
by rovr138 1y ago
The way I do this is by still writing tests.
- darkwater 1y agoDo tests let you understand a codebase you have not written?
- koolba 1y agoThey can. Particularly if you use them to validate your assumptions about the code.
- intrasight 1y agothis desire to understand code will be soon be seen as rather anachronistic. What's important is that you understand your tests. Let the AI generate the code. The spec and the test are your human contribution.
- darkwater 1y agoI understand your point of view but I think it's too "optimistic", i.e. it will not happen soon, at least not outside AI maximalists.
- chasd00 1y agoyou're describing TDD and it never turned into the panacea that was promised. I'm excited to try claude code, i even have a decent little personal project lined up for it but someone somewhere will always need to understand the code because tests are never 100% exhaustive and major flaws come up.
- two_tasty 1y agoAh yes, can't wait to tell my auditor / regulator "I don't understand the code because Claude wrote it, but it's fine, because understand the code is for boomers." That will get a big laugh in a deposition.
- intrasight 1y agoThat'll be anachronistic too obviously. Your tests will be audited.
- jimbokun 1y agoIf the tests are written with sufficient detail that you don't need to look at the code, the implementation of the code is such a small part of the overall work that you are gaining very little in terms of overall productivity.
- intrasight 1y agoI agree
- jimbokun 1y agoI would say yes. To have useful tests, you must write the APIs for the functions, and give examples of how to wire up the various constructs, and correct input/output pairs. Implementations of those functions that pass the test now have significant constraints that mean you understand a lot about it.
- theshrike79 1y agoThat’s called Test Driven Development. First you write the tests, then you write code until tests pass.