🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.misc
Article #4369

Re: Readable Perl (was: Re: Relative Speed of Perl vs. Tcl vs. C)

#4369
From: Jan-Pieter Cornet
Date: Tue, 27 Feb 1996 02:44
104 lines
4363 bytes
In article <4ge7bk$4vq@news.ox.ac.uk>,
David Hopwood <lady0065@sable.ox.ac.uk> wrote:
>In article <4gb3kp$lu7@gaia.ns.utk.edu>,
>Matthew B. Kennel <kennel@msr.epm.ornl.gov> wrote:
>>Randal L. Schwartz (merlyn@stonehenge.com) wrote:
>>: >>>>> "John" == John Viega <jtv2j@mamba.cs.virginia.edu> writes:
>>
>>: John> People bitch about the readability of Perl non-stop.  In fact, I have
>>: John> heard the joke, "Perl, the only language you can uuencode, and not
>>: John> notice" twice this week around the department.
>>
>>: OK, now which do you find most readable...
>
>This (Haskell):
>
>cancount n = "I can count to "++(show n)++"\n"
>concat (map cancount [1..10])

No, you got it all totally wrong. I think this is the best readable
(in Tri-INTERCAL):

	DO ,1 <- #16
	DO :2 <- #6490$#55022
	PLEASE DO (44) NEXT
	DO :2 <- #5631$#54733
	PLEASE DO (44) NEXT
	DO :2 <- #14637$#40039
	PLEASE DO (44) NEXT
	DO :2 <- #58550$#53112
	PLEASE DO (44) NEXT
	DO .1 <- #1
	PLEASE DO (99) NEXT
	DO GIVE UP
(44)	DO REINSTATE COMING FROM
(19)	DO COME FROM (68)
	DO ABSTAIN FROM (19)
(31)	DO COME FROM (34)
	DO ABSTAIN FROM (31)
(88)	DO COME FROM (65)
	PLEASE ABSTAIN FROM (88)
	DO COME FROM (44)
	PLEASE DO (123) NEXT
	DO .3 <- ':2~"#4$#13"'
	DO :2 <- ':2~"#29520$#29511"'
	DO ,1 SUB .1 <- .3
(65)	DON'T GIVE UP
(34)	PLEASE DON'T GIVE UP
(68)	DO NOTE THAT THIS FUNNY CODE ACTUALLY WORKS
	PLEASE RESUME #1
(99)	DO COME FROM (69)
	DO READ OUT ,1
	DO ,1 SUB #1 <- #180
	DO READ OUT .1
	DO .2 <- "?.1$#10"~"#0$#29524"
	PLEASE DO (15) NEXT
(69)	PLEASE DO (123) NEXT
(42)	DO RESUME .9
(123)	PLEASE .8 <- #1
	DO COME FROM (81)
	DO .9 <- '?"V!1~.8'$#1"~#1'~#1
	DO .1 <- "^.1$.8"~"#0$#29524"
	PLEASE DO (42) NEXT
(81)	DO .8 <- !8$#0'~"#9841$#1"
(15)	PLEASE RESUME '?"!2~.2'~#2"$#1'~#1

Now, I think the advantages of this are pretty clear. First, this is
clearly a write-only language. There are only few people insane enough
to actually understand the above drivel, and they wouldn't bother
touching your petty code, as they are too busy filling bathtubs with
brightly colored machine tools.

Anyone else will simply be too scared to touch this code. So you can be
pretty sure nobody changes it behind your back.

In fact, you can be pretty sure you won't change it either after you
wrote it, because you will probably have forgotten how the program
works 5 minutes after you wrote it. So any luser nagging for extra
features afterwards, is SOL.

The other major advantage is... the above code took me about 3 hours
to write. Compare this to the 10 to 30 seconds it takes to write a
similar program in perl, BASIC, Haskell or what have you. But... that
means that when you programmed it in that other language, you'd have to
spend 2 hours 59 minutes and somewhere between 30 and 50 seconds
answering the phone talking to clueless lusers, changing backup tapes,
or doing other boring stuff. While you could have been programming
Intercal instead! Just think about that!

And last, but certainly not least, is: the above code is likely to
impress your boss. Bosses are wont to be impressed by incomprehensible
things. They won't be impressed by a three line perl program that anyone
not wearing a diaper can understand.

So that pretty much proves it.

PS: this article contains some strange usage of the words "best readable"
that you probably weren't previously aware of :)

-- 
Jan-Pieter Cornet  					<johnpc@xs4all.net>
Actual quote: "Linux was made by foreign terrorists to steal money from true
               AMERICAN companies like Microsoft who invented computing as we
	       know it, and are being punished for their success..."
Linux -- "It's computing, Jim, but not as we know it"
Technical Details
Message-ID: <4gtr64$s7h@news.xs4all.nl>
Path: arc1-ca.pugleaf.net!surfnet.nl!sun4nl!xs4all!johnpc
References: <4e3a2u$eoa@wcap.centerline.com> <ukd97hwzkc.fsf_-_@linda.teleport.com> <4gb3kp$lu7@gaia.ns.utk.edu> <4ge7bk$4vq@news.ox.ac.uk>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!surfnet.nl!sun4nl!xs4all!johnpc
From: johnpc@xs4all.nl (Jan-Pieter Cornet)
Newsgroups: comp.lang.misc,comp.lang.perl.misc,comp.lang.tcl,comp.lang.c,comp.lang.java,alt.lang.intercal,alt.test
Subject: Re: Readable Perl (was: Re: Relative Speed of Perl vs. Tcl vs. C)
Date: 27 Feb 1996 02:44:19 GMT
Organization: XS4ALL Internet
Message-ID: <4gtr64$s7h@news.xs4all.nl>
References: <4e3a2u$eoa@wcap.centerline.com> <ukd97hwzkc.fsf_-_@linda.teleport.com> <4gb3kp$lu7@gaia.ns.utk.edu> <4ge7bk$4vq@news.ox.ac.uk>
NNTP-Posting-Host: xs1.xs4all.nl
Summary: hit "n" now! quick!