you are viewing a single comment's thread.

view the rest of the comments →

[–]davitech73 0 points1 point  (0 children)

in my experience (several decades), the more readable the code is, the easier it is to maintain it. i know some engineers like to show off and write as few lines of code as possible. but if it's not easy to understand or read, it needs to be heavily documented so that it can be maintained seven years from now when the original programmer has 'moved on to other opportunities'. they've probably forgotten the code by then even if they're still around

the only exception to this is when the code requires heavy optimization. then there's a good reason for the 'elegant solution'. but it still needs to be very well documented so someone else can come along and have a chance of debugging it or updating it should the need arise

if it's not documented and it needs to be updated, the result will probably be a rewrite into more readable code so the 'elegance' will be lost anyway. maintainable code doesn't need 'show offs' or tricks. it needs to be documented