Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
We all know how cool it is (clever, intriguing, sexy, etc) to write Perl code that is highly idiomatic, tersely compact, even ethereally abstracted. But this sort of usage will pose problems for maintenance, especially in shops where Perl is only one of several available tools (and not necessarily the predominant one).

*shudder* Where does that horrid "cleverness" mentality come from, anyway?!? What happened to professionalism; the KISS principle; clean, obvious code that doesn't require wasted thought or effort to maintain?

I see so many would-be clever programmers using complex idioms for the sake of cleverness; playing games with scoping, closures, OO to implement a theoretically elegant solution that's convoluted, hard to maintain, and hard to test.

Sometimes it's simpler to just plain write:

print "Hello, World";
and be done with it, rather than some "sophisticated" mess like:
use Config::Parser; # "clever" in house module to parse config files; +relies heavily on closures, XS, and mutual recursion; contains own le +xer and parser use Language::Gylph::Unicode; # "clever" in house module for unicode; +written in as a clever polyglot of FORTRAN, C, and Assembler, "just i +n case" only one of the languages is available at any given time my $parser; $parser = Config::Parser->new( $ARGV[0] || $ENV{CONFIG} || get_default +_config($0) ); $parser->set_output_device(\*STDOUT); $parser->set_Encoding( Language::Glyph::Unicode->get_encoding( $ENV{LA +NGUAGE} ) ); $parser->set_display_string( $parser->get_data(TYPE=>GREETING)); $parser->output_display_string();
where the hastily written perldocs for the parser claim that only ASCII encoding is currently supported, and the entire target audience speaks only English, and only has access to 7-bit ascii text terminals. And yes, I've seen code that ugly before! :-(

I see sooo much over-engineering, would-be cleverness, and solving of non-problems in my workplace that I'm perhaps oversensitive to it, but I find that "clever" is far too often code for "writing obfuscated code to stroke my own ego, and protect my job security"; my ex-boss did this for several years, and completely destroyed all semblence of maintainable code here at my company. :-( I'd re-write it, but I'm not allowed to until it breaks. :-(

So, perhaps as a reaction to that, I very much prefer the K.I.S.S principle; make it work, and make it obvious. Be clear on your own time; don't waste your co-workers time on ugly idioms unless the idiom is necessary, and not just "cute". "Cute, clever, and tricky" is quite often the opposite of "simple, obvious, and correct", at least in my experience.

In reply to Re^2: seeds... by Anonymous Monk
in thread seeds... by SamCG

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 meditating upon the Monastery: (4)
    As of 2020-11-24 23:24 GMT
    Find Nodes?
      Voting Booth?

      No recent polls found