Thomas Wittek skribis 2007-05-14 22:20 (+0200): > But I think that the name of an identifier (noun/verb, single/plural, > the meaning of the word) already gives enough context to understand what > type it is.
So is "user_id" a variable or a type? How about "substring" or "document"? Is "new" a function, or a variable? How about "old"? Is "is_valid" a function that determines whether something is valid, or a variable holding the result of this test? When you have "update(delete_random)", where both update and delete_random are functions, does this pass the function "delete_random" to "update", or does it first delete something, and then pass the resulting value to update? Don't forget that one of the important decisions in Perl was that we don't always like to use parentheses, because that clutters code (and you don't want that!!). Given "HTML Element", is HTML the type and Element the variable of that type, or is Element the type, and HTML the variable (for example, to hold the <html> element object)? Is "pid" a variable you used yourself, for example as the return value from "fork", or does "pid" give you the pid of your current process? And if the latter, is that by calling the pid function, or because pid is a variable? Doesn't "count input" look wrong to you? It should, because "count" is a hash! By the way, what would "input" be? And how on earth would you write "object.foo()", where foo is a variable holding a reference to a method, not the name of the method, if you had no sigils? ... ... ... ... ... | So is "user_id" a variable or a type? How about "substring" or | "document"? The Perl Way: $user_id is a variable, $substring is a variable, $document is a variable. user_id is not a variable, substring is not a variable, document is not a variable. | Is "new" a function, or a variable? How about "old"? The Perl Way: $new is a variable, $old is a variable. new is not a variable, old is not a variable. | Is "is_valid" a function that determines whether something is valid, or | a variable holding the result of this test? The Perl Way: $is_valid is a variable. is_valid is not a variable. | When you have "update(delete_random)", where both update and | delete_random are functions, does this pass the function "delete_random" | to "update", or does it first delete something, and then pass the | resulting value to update? The Perl 6 Way: update(&delete_random) passes the function &delete_random to &update. update(delete_random) calls the function &delete_random, and passes whatever it returned to &update. | Given "HTML Element", is HTML the type and Element the variable of that | type, or is Element the type, and HTML the variable (for example, to | hold the <html> element object)? The Perl 6 Way: HTML $Element is a variable of the type HTML. $HTML Element is a syntax error caught early by the compiler. (And that's really great if your native language makes you think the other way around than the programming language wants you to.) | Is "pid" a variable you used yourself, for example as the return value | from "fork", or does "pid" give you the pid of your current process? | And if the latter, is that by calling the pid function, or because | pid is a variable? The Perl Way: $pid is a variable that you set yourself. pid is not a variable. $*PID is a variable, that represents the pid of your current process. | Doesn't "count input" look wrong to you? It should, because "count" is a | hash! By the way, what would "input" be? The Perl Way: %count $input (or %count input) looks wrong, error caught even before compile time, programmer time and energy conserved. | And how on earth would you write "object.foo()", where foo is a variable | holding a reference to a method, not the name of the method, if you had | no sigils? The Perl Way: $object.foo() calls the method called "foo". $object.$foo() calls the method that is in the variable $foo. -- korajn salutojn, juerd waalboer: perl hacker <[EMAIL PROTECTED]> <http://juerd.nl/sig> convolution: ict solutions and consultancy <[EMAIL PROTECTED]>