Use professional and meaningful names
TL;DR: Don't be informal or offensive
Problems
Readability
Unprofessional work
Solutions
- Choose good and professional names.
Context
Our profession has a creative side.
Sometimes we get bored and try to be funny.
Sample Code
Wrong
function erradicateAndMurderAllCustomers();
//unprofessional and offensive
Right
function deleteAllCustomers();
//more declarative and professional
Detection
[X] SemiAutomatic
We can have a list of forbidden words.
We can also check them in code reviews.
Names are contextual, so it would be a difficult task for an automatic linter.
Naming conventions should be generic and should not include cultural jargon.
Tags
- Naming
Conclusion
Be professional in the way you name things in your code.
Don't be try to be a comedian by giving a variable a silly name.
You should write production code so future software developers (even you) should easily understand.
Relations
More Info
Credits
Photo by Stewart Munro on Unsplash
This ‘users are idiots, and are confused by functionality’ mentality of Gnome is a disease. If you think your users are idiots, only idiots will use it.
Linus Torvalds
![mcsee](https://res.cloudinary.com/practicaldev/image/fetch/s--by_E26Wt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://res.cloudinary.com/practicaldev/image/fetch/s--XvnZDWAZ--/c_fill%2Cf_auto%2Cfl_progressive%2Ch_150%2Cq_auto%2Cw_150/https://dev-to-uploads.s3.amazonaws.com/uploads/user/profile_image/366059/69feb7c3-ab01-4bcd-a6f5-ec38e9300da3.jpeg)
Software Engineering Great Quotes
Maxi Contieri ・ Dec 28 '20
This article is part of the CodeSmell Series.
Top comments (4)
What about
purgeCustomers
?Now, purge could mean either eradicate and murder or delete all.
Since it has a meaning on computer records, it would be fine as well
Naming looks like just a simple thing we do every time we want to create an method or function.. but the right naming is a key for improving our code. Thanks for you articles.
Glad you like them ! :)