3 ms·
Poor programmers are optimistic: * computers will always run my code fast * infrastructure problems will not happen * our team will always have plenty of tim
by 29athrowaway 7y ago
Poor programmers are optimistic:
* computers will always run my code fast
* infrastructure problems will not happen
* our team will always have plenty of time to understand my code
* users are not malicious and the libraries I depend on are not malicious
* I will always have to plenty of time to diagnose and fix problems in this code
The author covers some of that.
But you can care about those, and still be a poor programmer: being too pessimistic is problematic. You need to pick your battles and spend your time mindfully.
Now, I have a problem with this:
> Naive programmers think that design means “don’t make functions or classes too long”. However, the real problem is writing code that mixes unrelated ideas.
How do you enforce that policy using a linter? How do you audit a large project for these issues? You can count characters in a line, you can count lines of code in a function or file, and you can count import statements. All those are indicators of coupling unrelated ideas together.
- aksx 7y ago>Poor programmers are optimistic completely agreed, just had a long conversation with a junior engineer about how adding a cache would not solve a complex architectural problem and just add more complexity. > All those are indicators of coupling unrelated ideas together. once useful tool i have found is using automated tools to spot indicators like these. In java using checkstyles cyclomatic complexity checks and class fan out is a strong indicator (not proof though).
- 29athrowaway 7y agoThat's different. That engineer is just mistaken, but at least is acknowledging that a problem exists, that's a good starting point.
- machiaweliczny 7y agoYou don't. (to both questions) I don't know about you - but I can spot it by glancing through MR and just expect code provider to explain his solution in description or be "obvious" to me. So sulution to not having these problems is code review. And if you have this problem then well, you have bigger problem (bad CR). But fixing it all at once is bad idea. Just fix modules you are working with/at. EDIT: I spot it by checking imports/exports and API surface, so could be automated.
- 29athrowaway 7y agoYou cannot do CR retroactively.