develooper Front page | perl.perl6.language | Postings from December 2004

Re: Python is not Java...but will Perl 6 be?

Thread Previous | Thread Next
From:
John Siracusa
Date:
December 3, 2004 11:48
Subject:
Re: Python is not Java...but will Perl 6 be?
Message ID:
BDD62CB8.1DA44%siracusa@mindspring.com
On Fri, 3 Dec 2004 20:37:40 +0100, Juerd <juerd@convolution.nl> wrote:
> John Siracusa skribis 2004-12-03 14:05 (-0500):
>> From http://dirtsimple.org/2004/12/python-is-not-java.html
>> 
>> "In Java, you have to use getters and setters because using public fields
>> gives you no opportunity to go back and change your mind later to using
>> getters and setters. So in Java, you might as well get the chore out of the
>> way up front. In Python, this is silly, because you can start with a normal
>> attribute and change your mind at any time, without affecting any clients of
>> the class. So, don't write getters and setters."
>> 
>> I'd like to be able to s/Python/Perl 6/ above, but after many discussions on
>> this topic, I'm still not sure if I can.
> 
> Anything can be anything. I'm sure that despite the ability to run all
> the code you want upon reading/writing an attribute, some people will
> still write setters and getters.

I guess I wasn't asking if it would be "possible" (I think that's been
established), but if it would be "easy", "reasonable", or "clean" (as it
appears to be in Python, although I'm just going by what the quoted web page
says).  I recall some discussions about the "best" way to this in Perl 6,
but don't recall if it converged on anything nice.

Anyway, I thought it was interesting to see the ease of "forward
compatibility" for simple attributes touted as a feature of Python.  I'd
like to tout it as a feature of Perl 6 too, because I also hate writing
getters and setters... :)

-John



Thread Previous | 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