🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.prolog
Article #2781

Re: Standard of Prolog code

#2781
From: Stanley Shebs
Date: Mon, 28 Sep 1987 15:54
27 lines
1762 bytes
In article <2265@mulga.oz> lee@mulga.UUCP (Lee Naish) writes:

>Virtually every time someone posts Prolog code to the network I groan.
>I see code like this:
>
>>merge([],[],[]).
>>merge([],List2,List2):- !, fail.
>>merge(List1,[],List1):- !, fail.
>>merge([Head1|Tail1],[Head2|Tail2],[Head1,Head2|R]):- merge(Tail1,Tail2,R), !.
>
>I wince, I tear my hair out, I fall to my knees and bang my head
>against the nearest rock crying; is this the Prolog code people write?
>What happened to logic programming?  Am I wasting my time?

I must be too old and cynical - whenever I see really bad code, my main
regret is that the authors are not in a class I'm teaching, so I can fail
them on that program.  (We have used large red stamps saying "VOMIT" to
good effect, also...)

I would like to see next editions of Prolog textbooks flush all the hype about
Prolog being "declarative" (whatever that's supposed to mean) and replace
it with sections on good style.  I would like even more to see cuts disappear
from implementations entirely, to be replaced by meta-level capabilities,
but I suppose that's a forlorn hope, since everybody wants "efficiency".

							stan shebs
							shebs@cs.utah.edu
Technical Details
Message-ID: <5005@utah-cs.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!husc6!ut-sally!utah-cs!shebs
References: <2265@mulga.oz>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!husc6!ut-sally!utah-cs!shebs
From: shebs@utah-cs.UUCP (Stanley Shebs)
Newsgroups: comp.lang.prolog
Subject: Re: Standard of Prolog code
Message-ID: <5005@utah-cs.UUCP>
Date: Mon, 28-Sep-87 11:54:55 EDT
Article-I.D.: utah-cs.5005
Posted: Mon Sep 28 11:54:55 1987
Date-Received: Tue, 29-Sep-87 05:52:28 EDT
References: <2265@mulga.oz>
Reply-To: shebs@cs.utah.edu.UUCP (Stanley Shebs)
Distribution: world
Organization: PASS Research Group
Lines: 27