3 ms·
> Sometimes it’s better to be explicit than abstract. This is a false dichotomy: after all, "open" is explicit and abstract (w.r.t. actual file systems). The
by junke 11y ago
> Sometimes it’s better to be explicit than abstract.
This is a false dichotomy: after all, "open" is explicit and abstract (w.r.t. actual file systems).
The original article from Metz was interesting, but the example here is disappointing. The code was apparently used only once: why generalize?
And if you want to generalize, why not make use of two functions: a new one which implements "touch", and the existing os.Chmod?
- Chris2048 11y agoYou can only generalize if you understand the original functionality. Multiple examples help infer this, but it this case it was initially assumed what was wanted... That's the issue. The original programmer never communicated their intention, so we have to figure out what is required from context.