Branden writes:
: I'm starting to be a bit worried with what I'm reading...
:
: 1) Use $obj.method instead of $obj->method :
:
: The big question is: why fix what is not broken? Why introduce Javaisms and
: VBisms to our pretty C/C++-oid Perl? Why brake compatibility with Perl 5
: code (and Perl 5 programmers) for a zero net gain?
It's not zero net gain, and I'm going to ignore the next person who says it.
: 2) Use $a~$b instead of $a.$b :
:
: The same argument, only stronger now. This one still poses another problem:
: for $a = $a ~ $b, the syntax would be $a ~= $b. Now read these two quickly
: and tell me what's the difference
:
: $a~=$b;
: $a=~$b;
:
: It's not only hard to teach the =~ operator, imagine teaching that there
: are two of them... Imagine if a programmer writes the wrong one, how long
: you'll have to wade through that code until find the bug!
We have lots of operators you wouldn't want to reverse by accident.
: 3) Introduce := and deprecate = :
:
: Ok, nobody told = would be deprecated, but I've actually read that := would
: do everything = does, so that = could be forgotten. Now, why not extend =,
: instead of adding this Pascal-ism to Perl?
That's still a possiblility.
: I agree that Perl should get ideas from the maximum of languages,
: including, of course, Java, VB, Pascal. I just don't see why introduce
: syntatical elements of those languages, since the ideas could be done with
: Plain Old Perl Syntax, that one inspired in the language for real
: programmers, C, as it has always been through time.
:
: What I mean is, when I first say Ruby, I thought: That looks like a cool
: language, it has most features of Perl, and supports some neat things Perl
: doesn't... But when I saw it's Java-like syntax, I thought: Forget about
: it! Perl syntax rules!
What is it about . that seems to inspire allergic reactions in people?
Surely it's not the . itself, but the requirement that you fit everything
into that one syntactic mold. Perl's not going to do that.
: The bottom line is: please don't change the syntax, unless it's
: unavoidable. It will cost many time of reading code until finding bugs
: because of operators that used to work and don't work anymore...
That is a consideration, but there's no such thing as absolutes here.
All change is avoidable at some price. I don't intend to pay that price.
Larry