software design (was Re: [geeks] perlish disgruntlement, java considered, sun hardware sought)

David Cantrell david at cantrell.org.uk
Mon Apr 8 08:00:36 CDT 2002


On Mon, Apr 08, 2002 at 07:58:49AM -0400, alex j avriette wrote:
> On Monday, April 8, 2002, at 06:33 AM, David Cantrell wrote:
> > Did you bother benchmarking your nested maps against my solution using a
> > single foreach?

That would be the nested maps code which DIDN'T EVEN WORK.

> no, and i dont have to for reasons i'll explain in a moment here.

Hmmm ...

> > And you mean \S, not the harder-to-read [^\s].
> >
> > If you're going to pontificate on perl style, it's a good idea to learn 
> > the language first.
> yes. but code written on a mailing list to indicate a point (i guess 
> with the exception of a patch) is hardly worth judging anyone on.

You found it necessary to make judgements about my code written on a mailing
list as a demonstration.

And if you are trying to make a point, it is good practice to actually make
that point, not make amateurish errors like the above.

> >> your c professor would fail you for making system calls in code.
> > I don't give a rat's arse what your C professor would do.  This isn't C,
> > and I'm not a student.
> perhaps i should refrain from figurative speech and sarcasm and other 
> forms of humor on-list. that having been said, you missed the point.

So what *was* the point?  If you refer to the lack of error-checking, then
I did in fact not miss it at all.  If you think there's some other bug,
then do please enlighten me.

> >> if youre not writing code that is *fit* to be passed from person to
> >> person, you shouldnt be writing code.
> > so if the shell porogramwhich I use for publishing my website is a dog's
> > breakfast, I shouldn't have written it at all?  How, pray, is one meant
> 
> no. again, youve missed the point. you should have written it well to 
> begin with.

I decided that I needed to teach myself some more shell programming.  So I
picked a task which seemed suitable, and implemented it.  Without knowing
much shell programming in advance, it wasn't possible to write it in the
most elegant and 'correct' way.  I knew all along that I wasn't writing the
best shell code in the world ever, but that was not the point of the
exercise.  It is *you* who doesn't get it.  The point was to bootstrap my
shell skills so that I could get it right next time.  Without doing that,
I would never be able to get shell programming right at all.

>              i never sit down to write _any_ code without "designing" it 
> first. i figure out what the needs of the application are.

As do I.

>                                                             i start 
> working on "compartments" of code based upon those requirements, and i 
> further compartmentalize those individual compartments if i can.

That would be over-designing for this particular task.  All it has to
do is rsync a bunch of files, parse the plain-text that rsync spews out
to STDOUT and STDERR, update another file appropriately (the changelog),
and upload that.

> it makes me *sick*, literally, to write code that is ugly or unportable 
> or breaking an API or without an API.

Then you have my sympathy.  Perhaps you should steer yourself away from
commercial programming, as you won't be able to avoid it there.  Although
from what I hear, academic programming is just as bad.

>              i learned from one of the best perl programmers there is -- 
> Jeff Pinyan -- as I went along. i went along with the rules i learned in 
> college in CS:

Ahhhh, there's the problem.  You think of computing as a science, which
should be kept pure and virginal and unsullied by the real world.  I think
of it as engineering, which is grubby and dirty and has sharp edges just
waiting to gouge chunks out of the back of your head when you stand up.
And in engineering, you just *know* that however much effort you put in,
you'll never be good enough to satisfy either the suits or the scientists.

> > but I have learnt from it.  My next shell program will be better.  That
> > one though - I can't be bothered to fix it, cos it does the job *and* is
> > for my use only so no-one else needs to understand it.  Hell, *I* don't
> > need to understand the code any more.
> you will continue to tell yourself that until the time you need to 
> rewrite or replace it. then you'll spend an entire weekend (week?) on it 
> instead of an hour or two with a cup of coffee.

No, to rewrite the existing functionality will be all of ten minutes work,
most of which will be testing.  The fun bit will be adding the new features
like making it do version control.

> so i'll ask again, why is it we own suns and sgi's if its simply okay to 
> "get the job done?"

Errm, because they get the job done whereas PC crap doesn't :-)

-- 
Grand Inquisitor Reverend David Cantrell | http://www.cantrell.org.uk/david

  attractivating: inducing the quality of being attractive,
     especially to members of the appropriate sex.  -- Henrik Levkowetz



More information about the geeks mailing list