On Thu, Aug 22, 2013 at 10:12 AM, Matthew Ngaha <chigga...@gmail.com> wrote: > On Thu, Aug 22, 2013 at 2:52 PM, Chris Down <ch...@chrisdown.name> wrote: >>I would doubt that anyone has told you "don't ever use classes", because >> that's nonsense; you've probably misread a dissuasion from that path in a >> single instance as applying more broadly than was intended. > > I am being totally honest here. I was very confused at the time and i > said i didn't agree because it's what i had put so much effort into > learning. They went on to say at some well known Python talks speakers > have stated why using OOP (especially inheritance, but not excluding > any others) is very bad design and the same thing can always be > achieved without it. To be clear they said every use case OOP is the > worst option. I asked what about GUIs which their design is strongly > based around OOP? and they sad GUIs are badly designed to begin with > so it proves the point about OOP. > _______________________________________________ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > http://mail.python.org/mailman/listinfo/tutor
Discussions among developers concerning the suitability of global variables have been going on at least since the 1970s. In my view they are the data equivalent of the 'goto' statement which has pretty much disappeared from acceptable coding practice. Think of them this way: Take a group of housemates who all use the same refrigerator. They all work different hours, spend time with different friends, and never talk to each other. When Bob buys beer, and later comes home to find there is no beer in the refrigerator it frustrates him. He doesn't even know who to complain to because anyone in the house could have taken it -- even a visitor. So, globals seem like a great idea to start with. But over time they cause trouble. I think you should write your code with globals if you think its best. Probably your code isn't that important, and it won't matter what you did in this program in a year or two. Anyway you will be learning. If your code is important for work, or some other purpose, over time it will be changed, and expanded, and problems will arise. Then you, or worse some one else, will have to figure out what is going wrong. That's where you will rue the day you sprinkled globals here and there. -- Joel Goldstick http://joelgoldstick.com _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor