http://www.perlmonks.org?node_id=606986


in reply to Re: Should I leave behind beautiful code or readable code?
in thread Should I leave behind beautiful code or readable code?

You took the words right out of my mouth. Not that I'd have used the orignal snippet as an example of beautiful code...

It's time we snap out of this. If a maintainer can't understand code as simple as this, it's time for him to get educated. People should stop wasting time writing verbose code, and learn more elegant ways to do the same things. It's time they start to learn to recognize the typical Perl idioms, and stop trying to write a shadow of C in Perl.

Who in his right mind would dare to call lines like

for($i = 0; $i<$max; $i++) { ... }
"simple" and understandable? It's verbose, it's ugly, it's impossible to read, and the only reason why people think it's readable is because they have learned to read it. And to be honest, it probably took them a relative long of time to learn it.

It's time to learn something else.

Replies are listed 'Best First'.
Re^3: Should I leave behind beautiful code or readable code?
by Preceptor (Deacon) on Mar 30, 2007 at 10:44 UTC
    Isn't this the point of comments? I mean, so you can write code, which ... well is almost by definition not natural language, to do something, and then put a comment by it to explain how and why it does it?

    I don't care what a line of code does. I do care, that someone's taken the time and effort to document or comment what that bit does, if there's _any question at all_ about whether it's easy to understand or not.