1

Explain to me like I'm retarded why underscores are not desirable in a java class names besides, it's not the common convention.

Context:

FooBarLongClassName_OtherClassNameVisitor for a visitor class. This is the name of a class

Comments
  • 5
    Using descriptive names can be taken too far, for a start.
  • 3
    None, it's just convention.

    But...

    Usually, if you feel the need to write class names *that* long, you've probably, shall we say, deviated from commonly accepted good design somewhere along the way.
  • 2
    If you need a stupidly long name to begin with, your already doing something wrong.

    @highlight show a stupidlily long java list for our freind.
  • 2
  • 0
    @M1sf3t
    I'm pretty sure you mean hyphen, because German QUERTZ is the best.
  • 2
    @C0D4 The beauty of Java is that you can't import Create from package.create as PackageCreate, so people name their class PackageCreate to avoid collision with TemplateCreate. Add a few levels and you get names like CustmerClientPackageCreateVisitorCallback, BackofficeClientPackageCreateVisitorCallback,
    CustmerAPIPackageCreateVisitorCallback, ... It's a total bullshit design, but short of using dot-notation with full package name everywhere there's really not much to do about it (except for ditching Java).
  • 0
    @M1sf3t

    JavaScript is the one place I support pluralized naming. Since it's do loosely typed, doesn't define returns, and documentation is hit or miss at best, it's nice having the function name tell you if you're getting a value or an array.
  • 2
    @M1sf3t once again, JavaScript so I disagree. Name tells you what it's doing, what is getting returned, and what it needs. It's long, but in a language that's already fighting against you, I appreciate the help.
  • 1
    @C0D4 I really hope that doesn't actually work.
  • 0
    @M1sf3t
    Date object has 19 methods start with get.

    getOwnPropertyDescriptors() exists in the root Object.

    JQuery contains .get(), .getJSON(), and .getScript()

    Those are the common, mundane ones. There's no telling how many JS functions people have written that start with get and don't return an element.
  • 0
    In case sensitive languages underscores do not really add any value most of the time since you can make names readable (and shorter) using camel or pascal casing.
Add Comment