Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^6: Conditional array initialisation? (scalar, !defined)

by BrowserUk (Pope)
on Jul 13, 2013 at 03:28 UTC ( #1044115=note: print w/ replies, xml ) Need Help??


in reply to Re^5: Conditional array initialisation? (scalar, !defined)
in thread Conditional array initialisation?

That is, people were often asking "defined @a" when they meant "is @a empty". The mistake was so common (you appear to have just made that mistake yourself) that "defined @a" was made to complain.

If the use of defined on aggregates doesn't match the common expectation; and the actual meaning is non-useful; doesn't it make sense to make it useful by making it match the common expectation?

That's the question. And I think you've supplied the answer, albeit unknowingly.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.


Comment on Re^6: Conditional array initialisation? (scalar, !defined)
Re^7: Conditional array initialisation? (silent change)
by tye (Cardinal) on Jul 13, 2013 at 05:23 UTC
    If the use of defined on aggregates doesn't match the common expectation; and the actual meaning is non-useful; doesn't it make sense to make it useful by making it match the common expectation?

    Meh. I see little advantage to providing a second, more verbose, less clear way of getting the exact same answer. I much prefer a compile-time notification of "you put 'defined' in there, but that doesn't do a dang bit of good; maybe you should double check that code or reread some documentation". This author may have been trying for some other meaning, even if such is not the majority case. Why leave a bunch of people scratching their heads about why some places use 'defined' and some don't?

    But, even if such were the chosen design decision, it still would have required that first, the old meaning be deprecated. So the current state is required no matter what.

    - tye        

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (17)
As of 2014-07-23 14:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (144 votes), past polls