DEV Community


Discussion on: Stop Using "data" as a Variable Name

dcwither profile image
Devin Witherspoon Author

Yes, I should have pointed out the context of that particular rule. It’s been a long time since I’ve worked with OOP, but you’re definitely right that these can be full method names for well named, well purposed classes.

vlasales profile image
Vlastimil Pospichal

It was a long and difficult journey before I came to this knowledge. Unfortunately, many developers in OOP do not share this idea.

However, I do not have it as a dogma, but rather as a guide to clean code.

The next level is class names and namespaces. I prefer to combine a maximum of two words in classes, one word for one namespace element. I avoid the general words domain, manager, controller, infrastructure, etc.