| ▲ | locknitpicker 4 days ago | |
> The "what" vs "why" distinction breaks down when your code encodes domain knowledge that readers can't infer from context. Your comment is a poor example because you unwittingly wrote "why" comments, not "what".
If anything, you proved the importance of clarifying why things must be the way they are.> The Uncle Bob approach of extractNameMatchingTransfersWithinSettlementWindow() doesn't actually help - now I need to know what settlement windows are anyway, and I've lost the context of why 3 days. You are also completely off in here as well, and I think that your comment shows a deeper misunderstanding of the topic. What you tried to frame as "Uncle Bob approach" actually means implementing your domain in a clear and unambiguous way so that both the "what" and the "why" are clear by looking at the code. Naming conventions are one aspect, but the biggest trait is specifying an interface that forces the caller no option other than doing the what's because of the why's. Without looking too hard into it, whipping out something like this in a few seconds would match the intent | ||