104 reputation
4
bio website pazziaumana.blogspot.com
location
age
visits member for 10 months
seen Dec 10 '13 at 22:39

Jun
30
awarded  Supporter
Jun
1
comment Is it useful to use encapsulation in dynamic typed, interpreted programming language?
Ok, now I've understood what you mean. Can you update your answer using your last comment, and citing also Giorgio's comment? :)
Jun
1
comment Is it useful to use encapsulation in dynamic typed, interpreted programming language?
@Asaf: +1, this is the same consideration done by Giorgio's comment to tdammers' answer.
May
31
awarded  Commentator
May
31
comment Is it useful to use encapsulation in dynamic typed, interpreted programming language?
@Giorgio: +1, I think this is a very good reason to use encapsulation, in particular if the language has weak typing :)
May
31
comment Is it useful to use encapsulation in dynamic typed, interpreted programming language?
@RobertHarvey: I edited that part to explain better what I mean :)
May
31
comment Is it useful to use encapsulation in dynamic typed, interpreted programming language?
@user61852: a. that sentence obviously refers to the first reason, since it's written in the first observation; b. you can use an API even if you don't know the source code if it's documented, see the win32 API for example; c. I edited that part, thank you.
May
31
comment Is it useful to use encapsulation in dynamic typed, interpreted programming language?
@RobertHarvey: but I can do that even if I don't encapsulate the class making attributes and method private, I think. See also my comments to Kilian Foth's answer.
May
31
revised Is it useful to use encapsulation in dynamic typed, interpreted programming language?
added 86 characters in body
May
31
comment Is it useful to use encapsulation in dynamic typed, interpreted programming language?
I don't understand your example... I can do what you described without the need of making attributes private and using setters. I can make public them all and the result is the same. About the second part, read my 3th comment to the Kilian Foth's answer.
May
31
comment Is it useful to use encapsulation in dynamic typed, interpreted programming language?
But this can't be done simply documenting the class? I mean, if I simply write do not touch this ^^ (or I start my identifier with an underscore as Pythonists do), it's not more simple that making the attribute private?
May
31
comment Is it useful to use encapsulation in dynamic typed, interpreted programming language?
About the first part: okay, but if I've written my framework with a interpreted language, the client programmer can see and change the code, so (s)he can turn an attribute or method from private to public, no? About the second part, I'm not sure if I've understood what you mean, can you give me an example?
May
31
comment Is it useful to use encapsulation in dynamic typed, interpreted programming language?
@user61852: have you some suggestion to improve it?
May
31
awarded  Editor
May
31
revised Is it useful to use encapsulation in dynamic typed, interpreted programming language?
added 256 characters in body
May
31
comment Is it useful to use encapsulation in dynamic typed, interpreted programming language?
@delnan: excuse me, you're right. I've read it somewhere, but it's wrong, since the single underscore attributes and methods are simply not imported by from mypackage import *. On the contrary methods and attributes that start with a double underscore are in a sort of "class namespace". Read stackoverflow.com/questions/70528/… and docs.python.org/3/tutorial/classes.html
May
31
comment Is it useful to use encapsulation in dynamic typed, interpreted programming language?
@Asaf: I know only getters and setters, can you give me an example?
May
31
awarded  Student
May
31
asked Is it useful to use encapsulation in dynamic typed, interpreted programming language?