Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Perl is more intuitive

by Anonymous Monk
on Aug 19, 2005 at 12:28 UTC ( [id://485100]=note: print w/replies, xml ) Need Help??


in reply to Perl is more intuitive

Most languages don't use sigils for their variables, and they aren't massively abandoned because they are 'cryptic'. Python and Java are often considered to be less cryptic language than Perl - which is often seen as quite cryptic, or even shell, which can be quite cryptic as well.
Which are the variables and which are the function words?
You know, if context cannot tell, and if you are only looking through a peephole (that is, seeing a few lines of code, and not a declaration of the variable or function), it usually doesn't matter. If one sees:
print foo;
in a language where parenthesis aren't required after a function call, it really doesn't matter whether foo is a variable, or a function. It's printing the value of foo.

In fact, understanding programming in general becomes a lot easier if you view scalars, arrays and hashes as functions. A scalar is just a function that returns a fixed value (although you can later change what the value is). An array is just a function that takes an integer as argument, while a hash is a function that takes a string as argument.

I find sigils handy because they allow me to do interpolation. But for me, that's their only use. It doesn't make programs more cryptic or less cryptic.

Replies are listed 'Best First'.
Re^2: Perl is more intuitive
by radiantmatrix (Parson) on Aug 19, 2005 at 15:40 UTC

    Python and Java are often considered to be less cryptic language than Perl - which is often seen as quite cryptic.

    I've always wondered about the "more cryptic" vs. "less cryptic" comments. There are clearly cryptic languages, like this little nuisance, but the rest really seems more a matter of whether or not a language is more or less compatible with an individual's way of thinking.

    For example, I have good friends that are Python programmers and cannot grok Perl. To quote them, "Perl is too disorganized for me: Python works like I think." I, on the other hand, can't stand Python{1} (all that significant whitespace, the lack of sigils, and not using braces for blocks all scare me) because Perl works exactly how I think.

    That doesn't mean one is "more cryptic" than the other; rather, it just means that different programmers find different approaches and syntax to be intuitive.

    1: I still use Python, and it does have some nifty things I wish were built into Perl, like the set() function(s).

    <-radiant.matrix->
    Larry Wall is Yoda: there is no try{} (ok, except in Perl6; way to ruin a joke, Larry! ;P)
    The Code that can be seen is not the true Code
    "In any sufficiently large group of people, most are idiots" - Kaa's Law
Re^2: Perl is more intuitive
by kiat (Vicar) on Aug 19, 2005 at 15:26 UTC
    I'm not sure if this related but imagine nouns in English weren't marked for plurality:

    one child->many child
    one apple->two apple

    1) The apple are good.
    2) The apple is good.
    3) Many apple are good.
    4) One apple is good.

    You then probably have to use quantifiers (one, many) or verbs (is, are) to indicate whether you mean a singular instance of the item or many instances.

    Additional note:

    OTOH, maybe there's some redundancy there. Because the verbs already tell you whether you're talking about a singular entity or a plural one (a case in point: The sheep is still alive vs The sheep are still alive.).

    In Chinese, nouns themselves are not marked for plurality. Instead, quantifiers are used to do the job.

      Oblig. The Simpsons reference: "We all know Pi(R)**2, but today, pie are justice: I welcome it." (Frederic Tatem)

      <-radiant.matrix->
      Larry Wall is Yoda: there is no try{} (ok, except in Perl6; way to ruin a joke, Larry! ;P)
      The Code that can be seen is not the true Code
      "In any sufficiently large group of people, most are idiots" - Kaa's Law

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2024-04-23 12:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found