Re:Guido van Rossum's Performance tips for Python
by axiak on Saturday October 13, 2012 @10:32AM
(#4648655)
I don't know how much experience you have with python.. but you don't need getters/setters in order to gain flexibility. You can always redefine how assignment/accessing works for any property later.
[ Parent
| on HN ]
Re:Guido van Rossum's Performance tips for Python
by ntoshev on Saturday October 13, 2012 @11:29AM
(#4648777)
Even in Java you don't need the trivial getters/setters anymore. Everyone uses an IDE with refactoring capabilities, so the change can be done instantly when necessary. Why uglify your code in advance?
Re:Guido van Rossum's Performance tips for Python
by axiak on Saturday October 13, 2012 @12:37PM
(#4648928)
Of course it depends on who's using your code. In java, if you have an api that other people are using, then you must use getters and setters. In python there is no such restriction.
Re:Guido van Rossum's Performance tips for Python
by rjh29 on Saturday October 13, 2012 @02:22PM
(#4649221)
Not much, so I will ask a question. What's more pythonic - avoiding getters/setters, or having assignment do more than simple assignment without the caller knowing about it?
Or does the issue simply not come up in practice, because you rarely need to redefine how assignment/accessing works?