I completely agree. A more appropriate name like DoItNow
would do wonders ;-) In all seriousness reading this
stuff makes me cringe. I've been bitten way to many
times by the "creative programming" of
others.
I like "Execute()" - I promptly rename
it "ExecuteMe()" =)
I am currently maintaining an application that follows
along the same lines.. "copy and paste
inheritance" is what I call it.. instead of
inheriting functionality from a base class, you copy it
to every method of every class that might need that
functionality.. end result 2 million lines of code that
doesn't do much except throw up bugs.
There is an up-side.. for every bit of functionality I
have to add, the codebase gets 2000 lines smaller :-)
Refactoring is a wonderful thing!
By the time I am finished this release, it might vbe
down to as little as 150,000 lines of code. There's my
silver lining, even if it is only me that recognises it.
Great post.
Too often, programmers forget that code is meant to be
read by humans, not by machines. The machine would be
perfectly happy to have us write IL in binary,
Methods called "Doit" are a clear
separator between the hobby programmer and the
professional. Or, should be.
Another annoying thing is two versions of a function
that essentially do the same thing a different way. In
the system I took over, there is a function AddParameter
and SetParameter. AddParameter is more verbose, but
problematic. Both are used everywhere, but they can't be
used together in the same function.
They (the lazy contractors that designed this) also have
exact same function in multiple places with different
names. A custom number formatting function in one page
is called "FormatNumber", while in
another place it has it again, this time called
"MyFormatNumber".
I think these guys hadn't heard of
"re-use" a whole lot.