Bill Allen wrote:
That raises my next question. Under what sort of programming circumstances
does it make sense?
"It" being object oriented programming.
OO is good for encapsulation and code-reuse. One good sign you should
consider a class is if you start building up many global variables.
Bill Allen wrote:
I know that Python not only supports OOP, but is fundamentally OOP in its
design. Just in using the language and standard library, that much becomes
obvious. However, I do wonder a bit about the practice I have seen of some
Python programmers to implement relatively short bi
I think OOP makes it easy for new programmers to set up programs, and
it can make for some pretty neat English looking code, but a more
functional approach generally makes for much leaner, faster performing
code.
I find them most useful when you have several functions that might
need to share some
On Sun, Feb 20, 2011 at 19:59, Alan Gauld wrote:
>
> "Bill Allen" wrote
>
>
> However, I do wonder a bit about the practice I have seen of some
>> Python programmers to implement relatively short bits of code, that would
>> be
>> quite simple using functions and procedural code, with classes.
>
"Bill Allen" wrote
However, I do wonder a bit about the practice I have seen of some
Python programmers to implement relatively short bits of code, that
would be
quite simple using functions and procedural code, with classes.
OOP is often overkill, but if its the normal way of programming
That raises my next question. Under what sort of programming circumstances
does it make sense?
--Bill
On Sun, Feb 20, 2011 at 19:01, R. Alan Monroe wrote:
> > I'll freely admit that I do not come from an OOP programming
> > background, so designing classes is not my first impulse when
> I'll freely admit that I do not come from an OOP programming
> background, so designing classes is not my first impulse when
> writing code. Am I missing something?
In my book, no, you're not missing something. I refer to it as
"drinking the OO kool-aid". It's not compulsory. I just use it when
I know that Python not only supports OOP, but is fundamentally OOP in its
design. Just in using the language and standard library, that much becomes
obvious. However, I do wonder a bit about the practice I have seen of some
Python programmers to implement relatively short bits of code, that wou