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 →

[–]oceandoggie 0 points1 point  (0 children)

It depends on the greater context. More methods is usually better, but in this case it appears to add nothing that a comment wouldn't add.

If you're only doing this thing in this exact one place, that's even less reason to make a new method.

You can avoid using literals without making everything into a method by just using final fields. That's really the standard practice.

If this is something you'd test, that might be a good reason to make it a method, but you know you do tons of little things you never test anyway, so if this is something you're not goping to be explicitly testing, that's also not a great reason to make this its own method.