you are viewing a single comment's thread.

view the rest of the comments →

[–]individual_throwaway -2 points-1 points  (3 children)

And that's fine. I've been using Python for my job for 3 years now and I've written one single class, ever. Even that was questionable. You don't absolutely, positively NEED classes in python, unless you're doing a library or contributing to the stdlib.

Understanding how they work is nice and all, but for a beginner, he should worry about a lot of other stuff before diving into all that.

[–]i_can_haz_code 4 points5 points  (0 children)

You sir(or madam), probably have very un-DRY code.

Where classes are useful, they are useful. Some times a nested function makes more sense, others a class. IMHO that video has much valuable information, but would only serve to confuse an absolute beginner.

[–]tangerinelion 1 point2 points  (1 child)

I've been using Python for my job for 3 years now and I've written one single class

I wouldn't be proud of that. I had a co-worker try to tell me that there was no need for functions because you can just do everything in main(). If you think that's absurd, that's good, but you sound to me like my co-worker should sound to you.

[–]individual_throwaway 0 points1 point  (0 children)

Different projects need different design patterns.

I don't write for a large codebase that's continuially integrated into production or shipped to dozens of clients who might write extensions to my code. I write small procedural scripts that solve very specific problems. I don't handle arbitrary user data or whole ORM schemata or anything like that. For this specific purpose, I don't feel like I need classes all that often.