Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Thanks for intersting read, unfortunately i cannot add nothing about code refactoring or reviewing because all the code i do at work is on my onw, i was never asked to write it nor someone has the ability to read it; i'm the one with the Perl mania..

About clever code. Many times (most? everytimes?) words and senteces hide the real sense or just mislead us about focusing on the right part. If you dismbiguate what 'clever code' can means you'll end with many different things and a bounch of questions.

First: who is clever? the code or the coder. And clever means the same if referred to a human and to a compiler?
When referred to a human a clever code(r) seems more near to tricky, ingenious and skillful: when you afford to understand lines of such code you think 'Oh wow it can be done in such way?' the same sensation as watching to a barman doing cocktails with flying bottles: beautiful, meaningless (in the sense that is not required) and risky. The same goal can be reached in plain, safer way with no downside (apart from the girl/boy impression effect).

By the point of view of a compiler i think that clever code could means: no unnecessary memory allocation and faster computation, no ambiguity. I suspect Perl prefere boring code, verbose and explicit one. You can add to the meaning also simpler, more readable and less typing because normally code writing is issued by humans so interaction is important.

So code is clever when has less requirements, use less memory-disk-network and run faster in the overall. Portabilty, robustness and maintainability also play. In such code the cleverness of the coder is not immediatly appreciable but is deeper and more effective.

That said, as i run on my own, coding in Perl has to be amusing too, so some tricky lines here and there can survive too to the quality inspection.

You said 'quality' please define 'quality'.. .. ooh no! ;=)

UPDATE 27 01 2015: about quality, as found in blindlike's homenode:

As Albert Collins once said,
"Simple music is the hardest music to play and blues is simple music."
I'm trying to write simple code, just as hard as I'm trying to play simple music.

There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

In reply to Re^2: The Boy Scout Rule by Discipulus
in thread The Boy Scout Rule by eyepopslikeamosquito

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others wandering the Monastery: (2)
    As of 2021-04-18 18:23 GMT
    Find Nodes?
      Voting Booth?

      No recent polls found