Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

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

by karlgoethebier (Abbot)
on Jan 16, 2015 at 18:11 UTC ( #1113535=note: print w/replies, xml ) Need Help??


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

"...is better written as..."

Yes and no. I'm a bit unsure about this. Please see Assignment and increment operators (like += and ++ in C)" for a pascalish or adaistic point of view about this - as you like:

"Ada provides these computations, of course, but not as special operators. Their exclusion is a judgement call. In some cases, they can make individual statements simpler to read. Overall, most code is clearer and more reliable without them. It's easy to misread "x += expression" as "x := expression" instead of "x = x + expression", especially if this line is buried in a sequence of assignments with varying assignment operators. Further, typos are less likely to result in valid (but erroneous) code. Note that "+" and "=" are on the same key on most keyboards, and "-" is next to it. "+=" and "-=" are easy fumbles for "=", or for each other."

Best regards, Karl

«The Crux of the Biscuit is the Apostrophe»

  • Comment on Re^4: Convert undef to empty string in a hash

Replies are listed 'Best First'.
Re^5: Convert undef to empty string in a hash
by Anonymous Monk on Jan 16, 2015 at 18:44 UTC
    Ada is dead, but Pascal (Free Pascal and Delphi) does have += and stuff :)
      "Ada is dead..."

      Yes sure. And my cell phone is stronger than your fax machine.

      Regards, Karl

      «The Crux of the Biscuit is the Apostrophe»

Re^5: Convert undef to empty string in a hash
by Anonymous Monk on Jan 17, 2015 at 01:08 UTC

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2021-05-09 13:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Perl 7 will be out ...





    Results (100 votes). Check out past polls.

    Notices?