3 ms·
A easy way of making code into "paragraphs" with comments is to just move it into a function. So in the end, this large function you're talking about, is just c
by diggan 10y ago
A easy way of making code into "paragraphs" with comments is to just move it into a function. So in the end, this large function you're talking about, is just calling the other ones, creating a paragraph while the functions are just "words". Makes it easy to test and no need for comments :)
- rbanffy 10y agoThis creates the risk of making what you are doing explicit at the cost of obscuring why you are doing something. I frequently catch tests in code reviews that don't make it clear why something is being tested and what the overall expected result is beyond the effects being tested.
- robmcm 10y agoIf the methods you are creating are private and for the purpose of segmenting a block of code, you really shouldn't be testing it directly, as it almost certainly won't be part of your public API.