On Mon, Jan 11, 2016 at 9:45 PM, Travis Griggs <travisgri...@gmail.com> wrote: > >> On Jan 10, 2016, at 9:48 AM, Bernardo Sulzbach <mafagafogiga...@gmail.com> >> wrote: >> >> Essentially, classes (as modules) are used mainly for organizational >> purposes. >> >> Although you can solve any problem you would solve using classes >> without classes, solutions to some big problems may be cheaper and >> more feasible using classes. > > I think, this is often why, for a simple script, OO just kind of gets in the > way. You have a straightforward procedure that you just want to do. The state > (data) is not rich enough to make making it the focal point of your program.
Your answer is quite good. I am not a purist myself (when it comes to Java and C++, I am never going to instantiate a Math class to get a logarithm function), but I understand the value of OO from experience. As I mentioned those "tuples and dictionaries" to pass data around, I would like to add that when a single script has two kinds of tuples or dictionaries, you may be better of using two different classes, as having "dedicated" types simplifies project organization and enhances readability. I have never gone "seriously OO" with Python though. I never wrote from scratch an application with more than 10 classes as far as I can remember. However, I would suppose that the interpreter can handle thousands of user-defined classes simultaneously. -- Bernardo Sulzbach -- https://mail.python.org/mailman/listinfo/python-list