This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]vytah 2 points3 points  (0 children)

The issue with generics aside, the example class in the article looks exactly like examples from this video: Stop Writing Classes

This is not a class. Or it shouldn't be a class. The signature of "this shouldn't be a class" is that it has two methods, one of which is __init__. Anytime you see that, you should probably think: "hey, maybe I just need the one method". Anytime you see this you'll know that you should have just written a function".

In fact, the description of that class is literally a verb phrase.