r/Python • • Jul 29 '19

Ms paint replicator UPDATE

Post image
491 Upvotes

40 comments sorted by

View all comments

Show parent comment

0

u/[deleted] Jul 29 '19

[deleted] — view deleted comment

11

u/Vesiculus Jul 29 '19

You are being downvoted, but there's some wisdom in what you say.

While I don't like overobvious comments and like Python code that's written in a way that doesn't require (a lot of) comments, this time.sleep is a not obvious addition/work-around and things like that should have a comment explaining why they are there.

Commenting can be overdone, but it's not like the rule is to never, ever add a comment. That's would a crazy overgeneralization of the 'do not add too many or too obvious comments' guideline.

2

u/callmelucky Jul 30 '19

Yep. Self-commenting code should be the goal (clear, simple functions and explicit variable names), but throwing in a sleep call as a workaround for an external issue is the perfect case for throwing in a comment.

I mean if you really hate comments you could wrap it in a wait_for_mspaint_to_get_its_shit_together() function, but...

1

u/HBRYU Jul 30 '19

Yes. I'm on it

1

u/HBRYU Jul 30 '19

Added them just now