procmail
[Top] [All Lists]

Re: syntax enhancement dreams

1997-08-26 19:24:36

"David" == David W Tamkin <dattier(_at_)wwa(_dot_)com> writes:

terry> It's easier for everyone to learn (don't tell me you have to be
terry> a programmer to understand a bit of perl, or that it's harder
terry> to understand some nice perl than some of the obscure procmail
terry> recipes that float around here), and no-one needs to strap on
terry> another layer of syntax to procmail.

David> Slow down, Jones.  Perl is easier to learn than procmail?  Only
David> if you al- ready are familiar with C!  I learned procmail code
David> by studying examples and trying things out; but perl remains
David> gibberish to me, and every perl proponent who has touted it as
David> a snap to master has ended up conceding, yeah, well, perl's
David> syntax is derived from C's, and he or she just assumed that all
David> humans are born fluent in C, but since I'm a non-C-speaking
David> freak, he or she can see how perl would be opaque to me.


ok. i said "a bit of perl", not the whole thing... i meant that i
think it is easy for people to learn to do things in perl the way you
learned to do things with procmail. i think the procmail recipe syntax
is far more opaque (especially looking at the ways people bend over
backwards to implement some things that are VERY straightforward in a
programming language).

btw, i first read the perl "manual" in 1988 or so. it was about 25
pages. i now have about 3 perl books. i still swear and curse at it,
and often look at the info pages. i still just don't get perl 5's
modules very well (not to mention other things), and find some of it
very poorly documented (try understanding how the format command
works, just for example) and bloody hard to understand. the perl that
i did learn, i learnt from looking at examples, building upon them,
and scrounging around in books. it took me years to get into the habit
of writing perl scripts (rather than cobbling together 10 other
utilities), and i'd only do that when i knew for sure that doing it in
perl was going to save me time, including the time it would take me to
re-learn what little i had formerly known.


so i'm CERTAINLY not claiming that perl is easier to learn than
procmail recipes.

what i am claiming (and i'll use one of your example responses below
to illustrate this) is that something like this:

  if ((A || B) && (C || D)){
    action;
  }

is vastly easier for people to look at, vaguely understand, and build
upon than your equivalent:

  :0
  * !A
  * !B
  { }
  :0E
  * !C
  * !D
  { }
  :0E
  action

which is basically gobbledygook with a refresher course in De Morgan's
laws thrown in for added obscurity.

   !(!A && !B) && !(!C && !D) is the same as (A || B) && (C || D) for
   people who just don't get what David did in the above recipe (for
   disaster?).


what i am claiming that given a set of examples of each, that the perl
would be simpler for novices to understand, copy, and modify, once you
began to push the basic procmail syntax (provided, of course, that you
supply a reasonable set of pre-set variables in perl that contain the
pieces of the mail message (as procmail does)).



cheers,
terry.

<Prev in Thread] Current Thread [Next in Thread>