DEV Community

Discussion on: Meaningful Names (Clean Code) — Why it is important for software developers?

Collapse
 
alissonzampietro profile image
Alisson Zampietro

Great post mate! I've one suggestion, I usually use the "get" as method name when it represents the class name data, it makes the method calling more elegant, for example:

User.get()

instead

User.getUser()

Collapse
 
imtiyazcode profile image
Md Imtiyaz Ahmed

Thanks Alisson fo reading..
There is no problem when you use get() method with Class or object. it will reflect the intent that activeUser.get() means method is calling for an active user. But you can't be sure that get() method will be used always like that, for example, it can be used like this.get() or simply get(). Since you have created the method you may always use with some object or Class, but how will other developers know that and they make a mistake of unclean code while using such existing methods.