58

Worst part of being a dev. Figuring out names

Comments
  • 3
  • 5
    the length of a variable name should be proportional to its scope. ie. A local variable used only inside a loop could be called x or i or whatever, unless there is an obviously more meaningful name for it. But a constant used throughout the system should have a longer name that explains exactly what it is for, like WebApiSessionExpirationTimeInMinutes or something similar
  • 2
    @HarambeJS I wasn't only talking about variables ;) there are methods to be named, classes, folders and heck even the projects have names as well
  • 5
    @sanse1992 oh i know :) and that gets even harder. you end up with horrible classes with too many buzzwords like FooFactoryBuilderStrategyHelperService :D
  • 1
    This so much! I am at the start of building a massive ERP system, but we have no clue what names to pick for the system! Anyone got any ideas along the lines of traffic, security?
    Consider the fact that the namespace name needs to be reasonably pretty too :)
  • 2
    JustAnotherClass:
    def JustAnotherMethod():
    return JustAnotherVariable
  • 1
    It's easy! Just do

    Var a = "false";

    :P
  • 1
    String nameString = new String;
  • 1
    @HarambeJS this, but also conventions within the domain and within the project allow shorter name for larger scope, since they are informative through common knowledge.
Add Comment