3 ms·
>What I mean is good programmers will find way to solve something using less code. That is very imporant for understandability, maintenance, and long term suppo
by Sir_Substance 12y ago
>What I mean is good programmers will find way to solve something using less code. That is very imporant for understandability, maintenance, and long term support.
It's not about less code, it's about simplicity of code. I have known people who have played code golf with production code, either out of bordom or a desire to generate job security. That's not actually solving the core problem of making it easier for someone to port to a new version of an OS in 5 years time, it only looks that way if you aren't paying attention. Short code can be just as confusing as long code.
Your code should, in all places where it is not necessary to do crazy speed optimisations, be understandable by the average intern. Yes, that means comments, and yes, sometimes it means doing something in one line that is more commonly done in 20 lines and yes, sometimes it means taking 20 lines to do something you could do in one line.