Saturday, July 11, 2015

Superficially ugly code is irrelevant. Pretty formatting--or lack thereof--has no bearing on whether...

Superficially ugly code is irrelevant. Pretty formatting--or lack thereof--has no bearing on whether the code works and is reliable, and that kind of mechanical fiddling is better left to an automated tool.

http://ift.tt/OKXTdu

I disagree with the beginning, but not the end. Programs are messages that we write to future maintainers that also are executed, and superficially ugly code is also unreadable messages. If it really works and is reliable, we read the messages less often, but being able to read and understand it is important.

To some extent, yes, you can automate that. I tend to run PerlTidy a lot on my code, with my own ideosyncratic Perl style, neither K&R nor GNU, which some people hate. (Use your own .perltidyrc if you must!) But you can put unclear, ill-considered, incoherent ideas into grammatically-correct sentences full of spell-checked words. That doesn't mean the message makes sense. 

No comments:

Post a Comment