cover-img

Code Smell 38 - Abstract Names

Avoid too abstract names. Names should have real-world meaning

24 December, 2022

0

0

0

Avoid too abstract names. Names should have real-world meaning

Problems

Implemental Naming

Meaningless names

Broken MAPPER and Bijection to real-world entities.

Solutions

1.

Choose meaningful names.

2.

Find metaphors.

3.

Avoid words like abstract, base, generic, helper etc.

4.

Use rules for naming.

Sample Code

Wrong

Right

Detection

We can set up policies and rules warning for certain words like base, abstract, helper, manager, object etc.

Tags

Naming

Conclusion

Finding names is the last thing we should do on our designs. Unless we have a clear business understanding, good names emerge at the end after defined behavior and protocol boundaries.

Relations

More Info

Credits

There are only two hard things in Computer Science: cache invalidation and naming things.

Phil Karlton
This article is part of the CodeSmell Series.

0

0

0

Maxi Contieri

Buenos Aires, Argentina

🎓Learn something new every day.📆 💻CS software engineer 👷coding👨🏽‍🏫teaching ✍🏾writing 🎨Software Design 🏢SOLID 🌉TDD 👴Legacy 💩Code Smells

More Articles

Showwcase is a professional tech network with over 0 users from over 150 countries. We assist tech professionals in showcasing their unique skills through dedicated profiles and connect them with top global companies for career opportunities.

© Copyright 2024. Showcase Creators Inc. All rights reserved.