3 ms·
I tend to comment then code, and treat my comments as almost a micro-spec explaining in plain language why the following code does what it does. I've increasing
by taneq 6y ago
I tend to comment then code, and treat my comments as almost a micro-spec explaining in plain language why the following code does what it does. I've increasingly found that if it's hard to explain clearly and precisely what a paragraph of code is doing, you probably don't understand the goal of the code itself well enough and should rethink the code.
If you can explain clearly and precisely but it's a long explanation, then do so. The longer the explanation, the more it's needed. If it's that complicated to explain the first time round, it's gonna suck when you come back to that code five years later.