Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

comment on

( [id://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! ;=)

L*
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.


L*
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

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2024-04-25 21:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found