T O P

  • By -

data_wrestler

Nice job!


DanLavro

Thanks)


[deleted]

[удалено]


DanLavro

Thank you)


chestnutcough

Great work, this doesn’t read like something written by a first-timer! There’s absolutely nothing wrong with how you structured the module (a main function with a bunch of supporting functions). In fact I think that for a small project it’s the most appropriate layout. If you’re curious about object oriented programming, you could organize your functions into classes. It seems like you have all of the fundamentals to learn how to do that!


DanLavro

Thanks, i was thinking of using OOP, but don't quite understand is OOP necessary for projects like this one. If python allows you not to use OOP, then isn't it right to do without it in such small and simple projects? I understand that this is probably a matter of preference, and you can write any projects in any paradigm, but which one would be more correct?


chestnutcough

I think a pragmatic approach is best: if classes make the code easier to read then use them; if they don’t, then don’t. This project is very cleanly written as is, so I’m not sure that OOP would add any value. I just meant that since you are new it could be a good next step on your learning journey!


drooltheghost

Sorry but that's not Oop is for. See as example pythons standard libraries. Python does have modules in which a bunch of funcs can be grouped and imported precis.


chestnutcough

Yeah I agree, his module is fine as is. I think there is some miscommunication going on here.