What's up with this obsession of some people who prefix every freaking class with company name.
I even worked for a guy who forced me to name libraries prefixed with his last name.
egomaniacs...
weird obsessionWhat's up with this obsession of some people who prefix every freaking class with company name.
I even worked for a guy who forced me to name libraries prefixed with his last name. egomaniacs... Probably just trying to avoid naming collisions with existing classes.
Many old 'C' programmers do this. It's an attempt to prevent "name space clashes" when your application gets 'large' (more than 10,000 LOC or so).
With C++, it's not as necessary, but some people still do it "just in case". In a similar vein, I've had old 'Fortran' programmers declare almost all veriables 'global' to emulate their old "COMMON" variable space. And more ridiculous if you blend in Hungarian notation.
I guess it's ok, I'm just in a bitchy mood, because I'm going through 5+ years old code written by someone who's of course long gone and it doesn't make me happy..
Usually -- I say, USUALLY -- I find 2 all capital characters to be sufficient.
And I'm NOT FOND of the Java tendency to make class or especially METHOD names of 40 characters or more, all words strung together. Like MyClass.ConvertASignedStringIntoAnUnsignedString. Sheesh. Get a couple of 'nested' calls going, or even try to do a code review, and it becomes hard to keep straight what's going on. Sorry, that's "2 all-caps LEADING characters to be sufficient".
I agree.
This is a nice one I just found: CompanyName_CleanAndValidateEmailAddressString wtf, just put the whole logic loosely worded in the name, why not. CompanyName_LoopThruAllTheRecordsOnEachOneDoSomethingAndThenDoSomethingElseAndThenDoSomethingElseAndThenCreateANewObjectUsingCompanyName_ObjectFactory
Awee, it killed it. Apparently 3-4 lines without a single line break or space pisses it off.
It even culminated in DoingSomethingAndThenCreateNewObjectUsingCompanyName_ObjectFactory...
This comes from some people taking their college professors too literally when they said "use a descriptive name".
And only weenies use Hungarian notation. If you can't tell what the variable is, you skipped an important design step. I prefer that to wrkstcltmtd.cpp, though. Presumably there's a happy medium somewhere.
Oh, poor Hungarian Notation.
When Simonye created it, it had a purpose. And it was pretty simple, too. By the time Microsoft got done with it in the Win32 API, it was a mess. Then VB got ahold of it, and different VB programmers used it differently. The result was an ambiguous puddle of mis-used type identifying letters. When it was created in the early days of 'C', it helped to know if something was an 'int' or 'long int' or 'char *' or 'zero terminated string'. Making them prefixes seemed to be pointless though. But soon after the Ansi-C compiler and prototypes and a strongly typed VB made the whole thing irrelevant -- but it survived for another 10 years. we do that here and i do find it annoying. thankfully, it's only three letters.
Be careful about Hungarian, there are two flavors: Systems Hungarian and Apps Hungarian. One is unreadable and unnecessary in a strongly typed language, the other is very useful. Daddy knows best:
http://www.joelonsoftware.com/articles/Wrong.html |
|
|