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

Re^6: Convert undef to empty string in a hash

by Anonymous Monk
on Jan 16, 2015 at 09:38 UTC ( [id://1113465]=note: print w/replies, xml ) Need Help??


in reply to Re^5: Convert undef to empty string in a hash
in thread Convert undef to empty string in a hash

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re^7: Convert undef to empty string in a hash
by eyepopslikeamosquito (Archbishop) on Jan 16, 2015 at 10:29 UTC

    I'm sure I did understand DRY
    Still waiting for a supporting citation.

      I'm sure I did understand DRY. Still waiting for a supporting citation.

      Its the same citation you used

      Um, its exactly the same source as yours, it says every line ... repeating $foo two or three times in one line is not what they're talking about

      Perl will catch the typos

      Have you read the chapter in the book?

      This whole discussion of which is more DRY: foo++; foo++; versus foo = foo + 2; versus foo += 3; ... they're all the same from a DRY perspective, foo is the single canonical source of information, the single canonical reference, they're all equally DRY

      Take a look at a very similar question, http://stackoverflow.com/questions/3898862/variable-value-assignment-operation-duplication, OP asks which is more DRY, using  this.changed = true; versus  dirty(); when this example from the book is about how to violate DRY and limit the scope -- which violation of DRY is more DRY? DRY doesn't care how verbosely you violate it

        Eyepops originally said:

        > from the perspective of DRY, this one is "better"

        DRY is a ideal to avoid redundancy not an absolute rule.

        The art of optimizing between somehow contradicting principles shows the good developer.

        For instance strictly speaking MVC shouldn't allow any code logic in templates.

        That's hardly practical.

        Some authors like to propagate their principles like biblical commandments, of course that's naive at best.

        Cheers Rolf

        PS: Je suis Charlie!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1113465]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2024-04-19 23:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found