DEV Community

Alexey Voinov
Alexey Voinov

Posted on

2 1

A little rant on naming things

Oh, how I'd love to forbid usage of info, data, and context in variable and class names. Looks like everybody is using it without understanding what they really means. Who's able to tell the difference between accountData, accountInfo and just account? Especially if they're in the same method. Or maybe what the hell is 'fieldContext' if that's the property of the field, and not something defining environment, where the field is used (or evaluated). Or maybe difference between three classes all named SearchContext, with nothing in common. And yes, they're all used in the same project and sometimes even in the same packages.

One other thing I like so much about naming: it is handle or process in the method names. Especially when this method is several hundred lines long. For me it is just like the giant sign above the method: "I don't know the hell what this method does or should do. Sincerely yours. Author."

Sorry, I think I need to go try some Vulcan meditation techniques now.

AWS GenAI LIVE image

How is generative AI increasing efficiency?

Join AWS GenAI LIVE! to find out how gen AI is reshaping productivity, streamlining processes, and driving innovation.

Learn more

Top comments (0)

AWS GenAI LIVE image

Real challenges. Real solutions. Real talk.

From technical discussions to philosophical debates, AWS and AWS Partners examine the impact and evolution of gen AI.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay