4 ms·
If someone says it's too complex, they may not be in possession of 100% of the facts; if the code is actually too complex, the author will probably work that ou
by strken 7y ago
If someone says it's too complex, they may not be in possession of 100% of the facts; if the code is actually too complex, the author will probably work that out when asked to explain.
Consider a PR using mutexes instead of channels in a go project. Is the code in the hot path, and has it been benchmarked? How many mutexes are there, and are they hidden from external callers? Is the PR implementing an existing algorithm, or an algorithm with some desired behaviour which would be more difficult with channels? Which way is consistent with the rest of the codebase?
This is not an adversarial encounter between a defender of the codebase and a filthy peasant seeking to corrupt all that is pure and good, it's two programmers trying to solve a problem, and neither is likely to have 100% of the available information, so you should talk to each other and work out what's going on. Assuming that you're right will bias you towards your existing opinion, which will cause worse code to make it to production.