develooper Front page | perl.perl6.language | Postings from April 2001

s/./~/g

Thread Next
From:
Branden
Date:
April 23, 2001 12:53
Subject:
s/./~/g
Message ID:
5.0.2.1.0.20010423164049.00ab78a8@genova.procergs.com.br

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?

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!

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?



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!

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...

- Branden


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About