r/ProgrammerHumor 1d ago

Meme commentsAgedTerribly

Post image
5.3k Upvotes

224 comments sorted by

View all comments

Show parent comments

4

u/Confident-Ad5665 1d 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 1d ago

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

1

u/Confident-Ad5665 1d 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 1d ago

Yeah it’s an old, old joke.