[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] Re: HUMOR: you have to see this code!



On Sun, Nov 07, 1999 at 12:37:03PM -0500, Jeff Boes wrote:
> To the "professionals" on this list: If he bills himself out at $200 a day
> and can create a functional script, and you bill yourself out at $1000 a day
> (but can create the same functionality in 20% the time), aren't his skills
> worth the same as yours to the end customer?

No.  Writing a "working" program is only part of your job as a
programmer.  What is equally important is having a program which has a
life:

	It -truly- works.  Meaning it works under the current conditions
and test cases and will continue to work under increasingly demanding
conditions.  [the only two obvious examples I see in this code is
get_days_since_new_year() which will break next Feburary and the
busted $LOCK_* constants which only happen to work out of dumb luck
($LOCK_SH and $LOCK_EX are correct by co-incidence, the rest are wrong
but he never uses them).]

	It -must- be readable and maintainable.  This holds -triple-
for contractors.  When you leave, someone else has to be able to sit
down, read and understand your code in a reasonable amount of time and
be able to make simple changes without worry about that change
rippling through the rest of the code.  If I was asked to maintain
this code it would be faster to throw it away and re-write it from
scratch, thus the company's original investment was wasted.  Its not
worth the money if it costs $200 up front to write the program,
then 40 hours to add & debug every change.

	It must at least attempt to be efficient.  This doesn't mean
you have to go nuts optimizing, but at least think about it.  Just by
looking at this code I know it won't be.  A 40 line routing to
subtract minutes from a date?  The flatfile parsing routine looks like
its O(n^2) (I may be wrong, the logic is so convoluted).

	It should be well documented.  Again, this aids readabilty and
lowers future maintainence costs of the program.  It also avoids
misuses of the program.

	It should provide its own, simple to run, testing suite.  Just
some basic regression tests to make sure the thing works and to make
sure the important parts continue to work after each change.

My $.02.  Now if you'll excuse me, I'm late for Willy Wonka.


BTW Variable names like $sc_db_lib_was_loaded smells like he learned
from Selena Sol.  Its funny, the useless comments, the massive yet
undescriptive subroutine boilerplates (they talk so much about a
routines usage, inputs and outputs but never say what the routine
-does-), the verbose variable names, the weird indenting style... if I
didn't know otherwise I'd think this person -was- fresh out of
college!


(For the record, I failed out of college)

-- 

Michael G Schwern                                           schwern@pobox.com
                    http://www.pobox.com/~schwern
     /(?:(?:(1)[.-]?)?\(?(\d{3})\)?[.-]?)?(\d{3})[.-]?(\d{4})(x\d+)?/i

==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe