3
OPM46
5y

In my whole carrier as developer. I never felt so helpless as in naming things.

Could be class, method, file name. The worst thing is it become hard as the code base increase.

How you overcome this?

Comments
  • 5
    You just call it what it is 🤷‍♂️
  • 1
    This might not work for everyone for obvious reasons, but if I have to think too hard, I set a temporary name and a comment describing what something is for or what it should do. I later rename that when I have progressed with the code as I usually will have an idea for a understandable name.
  • 0
    I just watched a talk by Joe Armstrong yesterday, he suggests to use hashes (sha1 for example) instead of arbitrary names which are always incorrect. Think about it! Git uses also hashes, why shouldn't we use them somewhere else?
  • 1
    If it's a function or class I just all it what it does
  • 0
    Decide on a naming scheme and use it.
  • 1
    @inaba that’s so long though
  • 1
    @fordtaunus I ran out of words and whenever we come up with logical name, it already exist.

    Classes do solve it at some level, but still sometimes we get situation where function name already exist.

    And, as other suggested I go with whatever comes in mind but then seniors laugh as It seems stupid.
  • 0
    Two hard problems I'm computer science: naming, cache invalidation and off-by-one errors.

    You are not alone.

    Often times a lack of a concise names indicates that your thing is doing too much. It may also indicate that you don't understand your business domain and don't have found ways to describe them, yet, and you are operating on a too technical level due to that.

    That being said, I often implement foo and fnord methods, and once I understand what I am doing, I refactor.

    When working within a team I often stop and ask people "how should we call X" and discuss options and decide as a team.
Add Comment