[Tutor] Creating class / OOP structure

Walter Prins wprins at gmail.com
Wed Nov 6 10:26:48 CET 2013


Hi,


On 6 November 2013 08:58, Mark Lawrence <breamoreboy at yahoo.co.uk> wrote:

> On 06/11/2013 02:19, Steven D'Aprano wrote:
>
>> On Tue, Nov 05, 2013 at 03:55:05PM -0800, Johan Martinez wrote:
>>
>>> I need help in modifying my program. Right now it looks as follows:
>>>
>> [snip code]
>>
>>> Can someone help me in improving my code?
>>>
>>
>> Yes! The first thing to do is get rid of the unnecessary class. This is
>> not Java where you have to write classes for everything. From the sample
>> code that you show below, using OOP here accomplishes nothing except
>> making the code more complicated and less efficient.
>>
>>
> Big +1 from me :)



To belabor the point further, watch this video by Jack Diederich from Pycon
2012 entitled "Stop writing classes":
http://www.youtube.com/watch?v=o9pEzgHorH0

(Don't get me or this video wrong -- classes have their uses but too often
developers try to fit stuff into class structures when the code/problem
really isn't asking for/suits it.)

Walter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20131106/af992a5d/attachment.html>


More information about the Tutor mailing list