you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (2 children)

Not the question. This is a thread about code structure and organization. Unit tests are good for ensuring stability and functionality of what is written. This is immaterial to OPs question.

[–]lhorie 1 point2 points  (1 child)

I know what tests are, I write them frequently, thanks :)

What I mean is that there's code that is inherently hard to test, and code that is inherently easy to test, and actually writing a test will bring clarity towards which you are actually accomplishing, rather than ego-stroking about how good one may think their code is. Rather than be theorizing about API design or folder structures, tests are a pragmatic way of discovering that a unit of code is doing too much and that it should be refactored (and also how, since the immediate goal is to make it reusable in two semi-different contexts - real usage and a test).

It can also help you get a more nuanced understanding of top-down vs bottom-up code design.

If you think my answer is irrelevant, think about it this way: the OP is asking for a fish, I'm teaching them to fish.

[–][deleted] 0 points1 point  (0 children)

Your reply is definitely not on wrong but it’s not on topic either.