60
Code Smells Catalog (luzkan.github.io)
you are viewing a single comment's thread
view the rest of the comments
[-] Boomkop3@reddthat.com 1 points 19 hours ago

Not sure what your point is here. Of course inconsistent naming is a code smell. Do you want inconsistent names?

Of course not. But in some (uncommon in my experience) cases method names can be unclear or just plain impractically long. In such cases, I would rather see an exception to the rule than having to rely on a comment to explain the name choice.

I had a great example a couple months back, but I can't remember it right now. But here's a (bad) example of such a situation.

An example of this could be a button that triggers a click. You might call it BtnClick. Then the click event for it could be BtnClickClick. In this case, I'd rather see BtnClick_click. Ugly? Yes. Bad example? yes. But the idea is that it's more clear that the _Click action is seperate from the name.

[-] FizzyOrange@programming.dev 1 points 13 hours ago

an exception to the rule

There is no rule. Smells are not rules.

this post was submitted on 05 Jan 2025
60 points (90.5% liked)

Programming

17756 readers
532 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 2 years ago
MODERATORS