A couple folks over on Artima have jumped on me for the "Perl is generally easier for newbs than Smalltalk" comment I made in Ovid's journal, which I was somewhat surprised at.
James Robertson's comments can be found here and here. He mostly seems to focus on sigils.
It seems a strange argument to use the number of sigils as the basis for the "ease" of a language. Your average Perl newb will probably only see about 3 - @, %, $, plus 2 special variables, @_ and $_.
What I guess James doesn't know, or doesn't realize, is that in the case of @, % and $, they are actually meant to *help* readability. If a newb sees @, he knows it's an array. If he sees %, he knows it's a hash, etc.
Unfortunately, I never completed my PhD thesis on "Computer Programming and the Effect of Sigils on the Human Psyche", so I can't say with total certainty that this helps Perl newbs along or not, but I suspect it does. I think it's only when you get into advanced Perl, and advanced data structures in Perl, that the syntax (and sigils) start to get overbearing.
Once I became more versed with Perl, the sigils started to get in the way, and that's one of the reasons why I do more Ruby these days than Perl. I started to realize that I was only using scalars the vast majority of the time anyway, and that scalar could be anything - a simple scalar or a quadruply nested hash reference. The sigils no longer helped, and I found myself using a GUI debugger just to understand the structure's layout. But, that's another story...
To an extent... (Score:1)
To an extent, this is very true. If you have some experience programming.
But, if you don't have any/much experience programming... then this gets very confusing:
Because a newbie sees the sigil and thinks: scalar
Then along comes:
And he thinks: same scalar
And it takes
Re:To an extent... (Score:2)
Most people we teach don't get $hash and $hash{element} confused either. One doesn't have a curly brace after it. This is another thing we emphasize, and we find it very easy to teach.
I can see the problem for people who teach themselves Perl from the
Re:To an extent... (Score:1)
Yep. Makes perfect sense to me. I agree totally.
But... I've got some customers that, after a week, still couldn't tell the difference between those two variables. They (mostly) get the scalar / hash thing... and getting an element of a hash.
But as soon as you give them (the scalar and the hash) both the same name, they fre
Re:To an extent... (Score:2)
You already know they are going to have trouble with that stuff, so you head it off before they have a chance to get confused.
I can use any name (Score:2)
I still have bad nightmares about trying to create a variable named "count" in python.
I still like the sigils (Score:2)
Something I do habitually is to UpperCase objects and compound the name of a variable with what its used for e.g. copy_of_Foo or Foo_remote
Never had a problem, so much so in fact that I find myself needing comments less and less (except when looking at perl golf or scary math).
@JAPH = qw(Hacker Perl Another Just);
print reverse @JAPH;