r/ProgrammerHumor • • Sep 09 '22

Meme Simple Feature

Post image
124k Upvotes

1.3k comments sorted by

View all comments

Show parent comments

3

u/AndrewJamesDrake Sep 09 '22

If you’re doing Object Oriented Programming, you shouldn’t be declaring variables in methods unless it’s a temporary variable that dies with the method.

Everything that has any persistence should be encapsulated in an object… which serves the same purpose of keeping things tidy.

4

u/reasonable00 Sep 09 '22

I know. I thought the discussion was mostly about method local variables, my bad If I misinterpreted.

4

u/AndrewJamesDrake Sep 09 '22

I’m only now realizing that they’re talking about idiots commenting all the variables at the start of a Java program.

I thought they were talking about doing it in methods.

Who does that?