Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
MIT course
#1
I was looking little at the new MIT course that been publish on Youtube.
It's been a while now since MIT switch from Java to Python.

Video from here,teaching about getters and setters.
A little further in the video,is strongly advice to always use getters and setters and not access data attribute directly.
I disagree with this,what is your's option on this?
No use string formatting in 2016/2017 all + Dodgy 

So if someone has not read this article from 2004 Python is not Java.
Quote:Getters and setters are evil. Evil, evil, I say! Python objects are not Java beans. Do not write getters and setters. This is what the 'property' built-in is for. And do not take that to mean that you should write getters and setters, and then wrap them in 'property'. That means that until you prove that you need anything more than a simple attribute access, don't write getters and setters. They are a waste of CPU time, but more important, they are a waste of programmer time. Not just for the people writing the code and tests, but for the people who have to read and understand them as well.
Reply


Messages In This Thread
MIT course - by snippsat - Feb-16-2017, 10:06 PM
RE: MIT course - by ichabod801 - Feb-16-2017, 10:13 PM
RE: MIT course - by Larz60+ - Feb-16-2017, 10:54 PM
RE: MIT course - by Ofnuts - Feb-17-2017, 07:42 AM
RE: MIT course - by snippsat - Feb-16-2017, 11:37 PM
RE: MIT course - by micseydel - Feb-17-2017, 07:13 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020