DEV Community

Cover image for Code Smell 105 - Comedian Methods
Maxi Contieri
Maxi Contieri

Posted on • Originally published at

Code Smell 105 - Comedian Methods

Use professional and meaningful names

TL;DR: Don't be informal or offensive


  • Readability

  • Unprofessional work


  1. Choose good and professional names.


Our profession has a creative side.

Sometimes we get bored and try to be funny.

Sample Code


function erradicateAndMurderAllCustomers();

//unprofessional and offensive
Enter fullscreen mode Exit fullscreen mode


function deleteAllCustomers();

//more declarative and professional
Enter fullscreen mode Exit fullscreen mode


[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.


  • Naming


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.


More Info


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

This article is part of the CodeSmell Series.

Top comments (4)

yoursunny profile image
Junxiao Shi

What about purgeCustomers?
Now, purge could mean either eradicate and murder or delete all.

mcsee profile image
Maxi Contieri

Since it has a meaning on computer records, it would be fine as well

bn_geek profile image
Mohcin Bounouara

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.

mcsee profile image
Maxi Contieri

Glad you like them ! :)