From: Jules Grosse
Subject: Writing (un)maintanble code
Date: 
Message-ID: <8d844ffa.0301150547.3e2390f8@posting.google.com>
This is great:

LISP is a dream language for the writer of unmaintainable code.
Consider these baffling fragments:
(lambda (*<8-]= *<8-[= ) (or *<8-]= *<8-[= )) 
(defun :-] (<) (= < 2)) 

(defun !(!)(if(and(funcall(lambda(!)(if(and '(< 0)(< ! 2))1 nil))(1+
!))
(not(null '(lambda(!)(if(< 1 !)t nil)))))1(* !(!(1- !))))) 

-- http://mindprod.com/unmaintricks.html

Now the question: can someone give me pointers to "how to write
mantainble code" applied to LISP?

tnx jls

From: Joe Marshall
Subject: Re: Writing (un)maintanble code
Date: 
Message-ID: <iswqwboq.fsf@ccs.neu.edu>
·········@yahoo.ca (Jules Grosse) writes:

> This is great:
> 
> LISP is a dream language for the writer of unmaintainable code.
> Consider these baffling fragments:

> (lambda (*<8-]= *<8-[= ) (or *<8-]= *<8-[= )) 

Just because you *can* use crazy identifiers doesn't mean you
*should*.  The fact that you *can* use these identifiers is a direct
consequence of allowing these sort of identifiers:

    version-8.2
    <random-marker>
    kingdom>phylum>class>order

> (defun :-] (<) (= < 2)) 

This isn't baffling, but I wouldn't hire the programmer who wrote it.  

> (defun !(!)(if(and(funcall(lambda(!)(if(and '(< 0)(< ! 2))1 nil))(1+
> !))
> (not(null '(lambda(!)(if(< 1 !)t nil)))))1(* !(!(1- !))))) 

If you indent it, the only thing baffling is why the programmer is
testing so many constant conditions.  

 (defun ! (!)
   (if (and (funcall (lambda (!) (if (and '(< 0) (< ! 2)) 1 nil)) (1+ !))
            (not (null '(lambda (!) (if (< 1 !) t nil)))))
       1
       (* ! (! (1- !)))))

Any language can be obfuscated this way.

In C and Java, you could wrap arbitrary statements with this:

   do {

    } while (0 == (3 > 69) ? 0 : 42);
     
In assembly sprinkle conditional branches to the next instruction
around.
From: Daniel Barlow
Subject: Re: Writing (un)maintanble code
Date: 
Message-ID: <87y95mbhz1.fsf@noetbook.telent.net>
·········@yahoo.ca (Jules Grosse) writes:

> Now the question: can someone give me pointers to "how to write
> mantainble code" applied to LISP?

www.norvig.com/luv-slides.ps is one place to start


-dan

-- 

   http://www.cliki.net/ - Link farm for free CL-on-Unix resources 
From: Ingo Rohlfs
Subject: Re: Writing (un)maintanble code
Date: 
Message-ID: <pan.2003.01.15.13.33.48.326083@ex-astris.org>
On Wed, 15 Jan 2003 05:47:31 +0000, Jules Grosse wrote:
> This is great:
> 
> LISP is a dream language for the writer of unmaintainable code.
> Consider these baffling fragments:
*PLONK*
From: Donald Fisk
Subject: Re: Writing (un)maintanble code
Date: 
Message-ID: <3E25D2A8.21DBF67C@enterprise.net>
Ingo Rohlfs wrote:
> 
> On Wed, 15 Jan 2003 05:47:31 +0000, Jules Grosse wrote:
> > This is great:
> >
> > LISP is a dream language for the writer of unmaintainable code.
> > Consider these baffling fragments:
> *PLONK*

Chill out.   It's a joke.   Other languages are represented on
the page too, which is well worth a read.

Le Hibou
-- 
Dalinian: Lisp. Java. Which one sounds sexier?
RevAaron: Definitely Lisp. Lisp conjures up images of hippy coders,
drugs, sex, and rock & roll. Late nights at Berkeley, coding in
Lisp fueled by LSD.   Java evokes a vision of a stereotypical nerd,
with no life or social skills.
From: Tim Bradshaw
Subject: Re: Writing (un)maintanble code
Date: 
Message-ID: <ey3smvu5uz0.fsf@cley.com>
* Jules Grosse wrote:

> Now the question: can someone give me pointers to "how to write
> mantainble code" applied to LISP?

Well, number one: choose identifiers which don't look like line noise.

--tim
From: Nils Goesche
Subject: Re: Writing (un)maintanble code
Date: 
Message-ID: <ly4r8aik6q.fsf@cartan.de>
·········@yahoo.ca (Jules Grosse) writes:

> This is great:
> 
> LISP is a dream language for the writer of unmaintainable code.
> Consider these baffling fragments:
> (lambda (*<8-]= *<8-[= ) (or *<8-]= *<8-[= )) 
> (defun :-] (<) (= < 2)) 
> 
> (defun !(!)(if(and(funcall(lambda(!)(if(and '(< 0)(< ! 2))1 nil))(1+
> !))
> (not(null '(lambda(!)(if(< 1 !)t nil)))))1(* !(!(1- !))))) 
> 
> -- http://mindprod.com/unmaintricks.html
> 
> Now the question: can someone give me pointers to "how to write
> mantainble code" applied to LISP?

Don't use smileys as identifiers.  People who can't figure that out on
their own are probably better off with Visual Basic.  In addition,
here is a starting point:

  http://www.lisp.org/table/style.htm

There are other guides on the net, too.  Google.

Regards,
-- 
Nils G�sche
"Don't ask for whom the <CTRL-G> tolls."

PGP key ID 0x0655CFA0
From: Jules Grosse
Subject: Re: Writing (un)maintanble code
Date: 
Message-ID: <8d844ffa.0301160458.f8e5956@posting.google.com>
> Don't use smileys as identifiers.  People who can't figure that out on
> their own are probably better off with Visual Basic.

I take that the harsh tone of this paragraph was because you too the
joke too seriously, right?
 
>   http://www.lisp.org/table/style.htm
> 
> There are other guides on the net, too.  Google.
> 

Google gives me all possible style guides, but doesn't say which one
is better.  Thanks for the ALU URL, though.

jules
From: Tim Bradshaw
Subject: Re: Writing (un)maintanble code
Date: 
Message-ID: <ey3iswp5it7.fsf@cley.com>
* Jules Grosse wrote:

> Google gives me all possible style guides, but doesn't say which one
> is better.  Thanks for the ALU URL, though.

It does say which one is most popular (or has most links to it,
anyway), and this might correlate with better sometimes (though
certainly not always).

--tim
From: Larry Clapp
Subject: Re: Writing (un)maintanble code
Date: 
Message-ID: <c9tb0b.7it.ln@127.0.0.1>
In article <···························@posting.google.com>, Jules Grosse wrote:
>>   http://www.lisp.org/table/style.htm
>> 
>> There are other guides on the net, too.  Google.
>> 
> 
> Google gives me all possible style guides, but doesn't say
> which one is better.  Thanks for the ALU URL, though.

I liked this one:

    http://www.cs.northwestern.edu/academics/courses/c25/readings/lisp-style.html

-- Larry
From: Kaz Kylheku
Subject: Re: Writing (un)maintanble code
Date: 
Message-ID: <cf333042.0301151803.5f10c042@posting.google.com>
·········@yahoo.ca (Jules Grosse) wrote in message news:<····························@posting.google.com>...
> Now the question: can someone give me pointers to "how to write
> mantainble code" applied to LISP?

Due to the regularity of the language, and other reasons, there is
greater concensus on style among Lisp programmers. Thus it's
unnecessary for a Lisp development shop to waste resources developing
documents like local code formatting conventions and whatnot. Pretty
much everyone agrees that special variables should be named with
leading and trailing asterisks, or that predicate functions should
have the p or -p suffix, or that nesting should be closed by clumping
closing parentheses )))) together.

Study some existing Lisp code, and read the FAQ. A good website to
visit is http://www.lisp.org . It has all kinds of useful links.

It's easier to define what is unmaintainable than to define what is
maintainable. Maintainability is a synthesis of all kinds of good
properties, from low-level concerns like code formatting, to higher
level concerns like effective separation of concerns, use of good
abstractions, and factoring out commonality instead of cut and paste,
and so forth.
From: Coby Beck
Subject: Re: Writing (un)maintanble code
Date: 
Message-ID: <b05inn$1uaf$1@otis.netspace.net.au>
"Kaz Kylheku" <···@ashi.footprints.net> wrote in message
·································@posting.google.com...
> ·········@yahoo.ca (Jules Grosse) wrote in message
news:<····························@posting.google.com>...
> > Now the question: can someone give me pointers to "how to write
> > mantainble code" applied to LISP?
>
> Due to the regularity of the language, and other reasons, there is
> greater concensus on style among Lisp programmers. Thus it's
> unnecessary for a Lisp development shop to waste resources developing
> documents like local code formatting conventions and whatnot. Pretty
> much everyone agrees that special variables should be named with
> leading and trailing asterisks, or that predicate functions should
> have the p or -p suffix,

Is this last one that consensual?  I generally prefer ? suffix.

--
Coby Beck
(remove #\Space "coby 101 @ bigpond . com")
From: Jules Grosse
Subject: Re: Writing (un)maintanble code
Date: 
Message-ID: <8d844ffa.0301160456.5de66fe9@posting.google.com>
> 
> Is this last one that consensual?  I generally prefer ? suffix.

As I understand, historical consensus among CLers is -p, while Scheme
people prefer ?

But, of course, live free or die, right?

jules
From: Nils Goesche
Subject: Re: Writing (un)maintanble code
Date: 
Message-ID: <ly8yxlh5bp.fsf@cartan.de>
"Coby Beck" <·····@mercury.bc.ca> writes:

> "Kaz Kylheku" <···@ashi.footprints.net> wrote in message
> ·································@posting.google.com...

> > Pretty much everyone agrees that special variables should be named
> > with leading and trailing asterisks, or that predicate functions
> > should have the p or -p suffix,
> 
> Is this last one that consensual?  I generally prefer ? suffix.

Damned Schemer ;-)

Regards,
-- 
Nils G�sche
"Don't ask for whom the <CTRL-G> tolls."

PGP key ID 0x0655CFA0
From: Simon Katz
Subject: Re: Writing (un)maintanble code
Date: 
Message-ID: <b05us8$m8et1$1@ID-131024.news.dfncis.de>
"Coby Beck" <·····@mercury.bc.ca> wrote in message
··················@otis.netspace.net.au...
>
> "Kaz Kylheku" <···@ashi.footprints.net> wrote in message
> ·································@posting.google.com...
> >
> > Pretty much everyone agrees that [...] predicate
> > functions should have the p or -p suffix,
>
> Is this last one that consensual?  I generally prefer ? suffix.

I've certainly seen much more use of -p than of ?. Perhaps
"consensual" is a little strong, though.

I started out using ?, but I've recently switched to -p having
been convinced by the argument that it's easier to pronounce when
talking to other people (or even to myself).
From: Marco Antoniotti
Subject: Re: Writing (un)maintanble code
Date: 
Message-ID: <3E2704C1.7070505@cs.nyu.edu>
Simon Katz wrote:
> "Coby Beck" <·····@mercury.bc.ca> wrote in message
> ··················@otis.netspace.net.au...
> 
>>"Kaz Kylheku" <···@ashi.footprints.net> wrote in message
>>·································@posting.google.com...
>>
>>>Pretty much everyone agrees that [...] predicate
>>>functions should have the p or -p suffix,
>>
>>Is this last one that consensual?  I generally prefer ? suffix.
> 
> 
> I've certainly seen much more use of -p than of ?. Perhaps
> "consensual" is a little strong, though.
> 
> I started out using ?, but I've recently switched to -p having
> been convinced by the argument that it's easier to pronounce when
> talking to other people (or even to myself).


... not to mention the (maybe not so standard nowadays) use of #\? as a
macro character in theorem provers.


-- 
Marco Antoniotti ========================================================
NYU Courant Bioinformatics Group        tel. +1 - 212 - 998 3488
715 Broadway 10th Floor                 fax  +1 - 212 - 998 3484
New York, NY 10003, USA                 http://bioinformatics.cat.nyu.edu
                     "Hello New York! We'll do what we can!"
                            Bill Murray in `Ghostbusters'.
From: Steve Long
Subject: Re: Writing (un)maintanble code
Date: 
Message-ID: <BA4B77B1.254C%sal6741@hotmail.com>
On 1/15/03 5:47 AM, in article
····························@posting.google.com, "Jules Grosse"
<·········@yahoo.ca> wrote:

> This is great:
> 
> LISP is a dream language for the writer of unmaintainable code.
> Consider these baffling fragments:
> (lambda (*<8-]= *<8-[= ) (or *<8-]= *<8-[= ))
> (defun :-] (<) (= < 2))
> 
> (defun !(!)(if(and(funcall(lambda(!)(if(and '(< 0)(< ! 2))1 nil))(1+
> !))
> (not(null '(lambda(!)(if(< 1 !)t nil)))))1(* !(!(1- !)))))
> 
> -- http://mindprod.com/unmaintricks.html
> 
> Now the question: can someone give me pointers to "how to write
> mantainble code" applied to LISP?
> 
> tnx jls

General guidelines for maintainability are language-independent. Use
meaningful object names (in Lisp, an object can be just about anything) and
organize activities into meaningful components that can be tested
independently and extended as required. Be generous with documentation,
especially code comments...

sl
From: ozan s yigit
Subject: Re: Writing (un)maintanble code
Date: 
Message-ID: <vi465snobfr.fsf@blue.cs.yorku.ca>
Jules Grosse:
? Now the question: can someone give me pointers to "how to write
? mantainble code" applied to LISP?

if you are sufficiently experienced, you may want to start looking around
for large and complex collections of code, and use your own judgement as to
whether the practices you see would lead to maintainable code for your shop.
assume you received that collection and asked to maintain it. what next? if
you had to supress your gag reflex, there is a good chance the programming,
documentation and build practices you see in there will not work for you.
take it from there. ($.02 cdn :)

oz
---
take the long short cut. -- animation rule of thumb (richard williams)