[Tutor] Pair 'o dimes wuz: Volunteer teacher

avi.e.gross at gmail.com avi.e.gross at gmail.com
Sun Jul 24 13:00:40 EDT 2022


At the risk of not answering the question, I am responding to the thoughts
others express here.

Object-Oriented programming is a fairly meaningless idea as it means a
little bit of everything with some people focusing on only some parts. Other
ideas like functional programming have similar aspects.

As Alan pointed out, one major goal is to solve a much larger problem pretty
much in smaller chunks that can each be understood or made by a small team.
But it does not end there as implementations have added back too much
complexity in the name of generality and things like multiple inheritance
can make it a huge challenge to figure out what is inherited in some
programs.

I would beware books and resources that have an almost religious orientation
towards a particular use of things. The reality is that most good programs
should not use any one style but mix and match them as makes sense. If you
never expect to use it in more than one place, why create a new class to
encapsulate something just so you can say it is object oriented. I have seen
students make a class with a single variable within it and several instance
functions that simply set or get the content and NOTHING ELSE. True, you may
later want to expand on that and add functionality but why add overhead just
in case when you can change it later?

I have seen books that brag about how you can do pretty much anything using
recursion. But why? Why would I even want to decide if a billion is more or
less than 2 billion by recursively subtracting one from each of two
arguments until one or the other hits zero?

If your goal is to teach the principles of object-oriented approaches, in
the abstract, you still end up using a form of pseudo-code. Picking an
actual language can be helpful to show some instantiations. And python can
be a good choice alongside many others and also can be a bad choice. It now
supports pretty much everything as an object including the number 42.

I did a quick search for "object oriented programming in python" and then
substituted "java", "c++", "R" and others. There aplenty of such matches and
the big question is which fits YOUR class and needs.




More information about the Tutor mailing list