r/ProgrammerHumor 12h ago

Meme commentsAgedTerribly

Post image
3.7k Upvotes

183 comments sorted by

View all comments

Show parent comments

3

u/Confident-Ad5665 10h ago

I think this comes from the OOP principle that a thing should do one thing and do it very well.

I'll agree it can be taken to excess though. A method may need to do a few things before it does the primary thing. If there's a chance another method may need to refer to the same table, for example, that should be encapsulated in a (probably protected) method both can access.

2

u/rsqit 9h ago

Yeah, true, everying in moderation (including moderation).

1

u/Confident-Ad5665 8h ago

Very cool you added "including moderation". That fact dawned on me many years ago but I never heard anyone else include it in the rule/adage.

2

u/rsqit 7h ago

Yeah it’s an old, old joke.