Is Programming Poetry?
medium.com
medium.com
This is an article about learning programming from Alan Perlis in 1983—a rich topic. "Is programming poetry?" was obviously not meant to be taken literally: the subtitle is "yes and no" and the text makes clear that Perlis was being provocative. The article deserves deeper attention than this. It's about learning programming from a master who used unconventional methods, and a first-hand report on what Perlis himself wrote about in http://www.jsoftware.com/papers/perlis77.htm.
Edit: I had to look up pou sto. Turns out it's Archimedes' "place to stand" from which he could move the earth. In other words, the best possible foundation. A high aspiration for a programming language course.
BEFOREHAND: close door, each window & exit; wait until time.
open spellbook, study, read (scan, select, tell us);
write it, print the hex while each watches,
reverse its length, write again;
kill spiders, pop them, chop, split, kill them.
unlink arms, shift, wait & listen (listening, wait),
sort the flock (then, warn the "goats" & kill the "sheep");
kill them, dump qualms, shift moralities,
values aside, each one;
die sheep! die to reverse the system
you accept (reject, respect);
next step,
kill the next sacrifice, each sacrifice,
wait, redo ritual until "all the spirits are pleased";
do it ("as they say").
do it(*everyone***must***participate***in***forbidden**s*e*x*).
return last victim; package body;
exit crypt (time, times & "half a time") & close it,
select (quickly) & warn your next victim;
AFTERWARDS: tell nobody.
wait, wait until time;
wait until next year, next decade;
sleep, sleep, die yourself,
die at last
# Larry Wall
https://en.wikipedia.org/wiki/Black_Perl #!/usr/bin/perl
APPEAL:
listen (please, please);
open yourself, wide;
join (you, me),
connect (us,together),
tell me.
do something if distressed;
@dawn, dance;
@evening, sing;
read (books,$poems,stories) until peaceful;
study if able;
write me if-you-please;
sort your feelings, reset goals, seek (friends, family, anyone);
do*not*die (like this)
if sin abounds;
keys (hidden), open (locks, doors), tell secrets;
do not, I-beg-you, close them, yet.
accept (yourself, changes),
bind (grief, despair);
require truth, goodness if-you-will, each moment;
select (always), length(of-days)
# listen (a perl poem)
# Sharon Hopkins
# rev. June 19, 1995There are some aspects to programming that have an aesthetic very similar to that of poetry. It is not in vain that we talk of "elegant" solutions to a problem, or say that [your favourite language] is "beautiful". So in that sense, yes, code can be a poem.
However, there are other areas where the two are worlds apart. First and foremost their purpose: code is meant to cause action (on the part of a computer). Any beauty is a side effect. Poetry is meant to be beautiful, to evoke feelings. If the reading of a poem causes an action in a reader, that is usually a side effect. So in that sense, no, code is definitely not poetry :D
William Carlos Williams
On poems as machines made out of words
"To make two bold statements: There's nothing sentimental about a machine, and: A poem is a small (or large) machine made out of words. When I say there's nothing sentimental about a poem, I mean that there can be no part that is redundant.
Prose may carry a load of ill-defined matter like a ship. But poetry is a machine which drives it, pruned to a perfect economy. As in all machines, its movement is intrinsic, undulant, a physical more than a literary character."
A program is written to perform math, and it is generally considered bad to waste space with needless things. It doesn't aid the reader or the compiler or the execution to add unused variables. It's really bad in a program to do things in an unclear way.
Poetry can have ambiguities, good software can't.
They do both share some amount of necessity of context. Both often have abstraction. I would say poetry is kind of a playful use of language, whereas programming is really more of a clever use of math.
Now that is inspirational.
I've managed to spend my software development career mostly writing programs that I feel are meaningful and useful, and I'm very thankful for that. But nothing I've written is going to last more than 10 or 20 years. I would love to produce an artifact that lasts centuries some day.
So far, discounting stuff that only lives because of some legacy hardware system, we've got maybe LINPACK and... what else?
Oh, code doesn't just express emotion- it instigates it. Usually pure, infernos of anger at the damned bastard who wrote it.
[1] http://www.masswerk.at/spacewar/inside/insidespacewar-pt1-ep...
I still remember with how much pleasure I read Edi Weitz' cl-ppcre - as a print-out, in bed.
More than once I did minor changes to programs that I attributed to my OCD just to get positive feedback from peers that I made the program more readable (say, changing (let ((x ..)) (when x ....)) to (when-let ((x ...)) ....)).
Have you ever read a poem by T.S. Eliot? A brilliant poet with an incredible gift for language, but I've been reading his "The Four Quartets" repeatedly for over a year and still don't understand much of it...
Good poetry is not necessarily readily understandable (and coming to think of it, neither is a good program). But once you have understood it you see that yes, "every word is exactly where it belongs".
map or filter procedures in Scheme or Haskell (written in terms of fold) are worth to be framed and posted on a wall.)
I guess it's _possible_ to write poetry in programming language, but the only times I've seen someone try the result was forgettable (it looked like a non syntactical mix of a number of languages and sucked as poetry).
Real code is only poetry in the Vogon sense.
"Mathematics is a language where truth rhymes".
capitalization and punctuation lol
On the top of Cummings, I have occasionally felt like I was faced with an incomplete set of instructions when reading certain of his poems. Of course, there's no particular reason to liken them to computer instructions; I've never seen anything in the poems to suggest a connection. Anything to link one art with another is a stretch—if we even accept that coding is an art.
(I think code can be, though it isn't as a rule. In the same way, writing can be artful but is typically workaday and unremarkable. This post, for an example.)
Poetry is an entirely separate discipline with a long list of associated skills, some of which overlap with those possessed by a good programmer. You're not a poet unless you're a poet, so just call yourself a good coder for fuck's sake. It's not like it's less prestigious.
source: published poet who works as a software engineer.
For the lack of a nail,
throw new HorseshoeNailNotFoundException("no nails!");
For the lack of a horseshoe,
EquestrianDoctor.getLocalInstance().getHorseDispatcher().shoot();
For the lack of a horse,
RidersGuild.getRiderNotificationSubscriberList().getBroadcaster().run(
new BroadcastMessage(StableFactory.getNullHorseInstance()));
For the lack of a rider,
MessageDeliverySubsystem.getLogger().logDeliveryFailure(
MessageFactory.getAbstractMessageInstance(
new MessageMedium(MessageType.VERBAL),
new MessageTransport(MessageTransportType.MOUNTED_RIDER),
new MessageSessionDestination(BattleManager.getRoutingInfo(
BattleLocation.NEAREST))),
MessageFailureReasonCode.UNKNOWN_RIDER_FAILURE);
For the lack of a message,
((BattleNotificationSender)
BattleResourceMediator.getMediatorInstance().getResource(
BattleParticipant.PROXY_PARTICIPANT,
BattleResource.BATTLE_NOTIFICATION_SENDER)).sendNotification(
((BattleNotificationBuilder)
(BattleResourceMediator.getMediatorInstance().getResource(
BattleOrganizer.getBattleParticipant(Battle.Participant.GOOD_GUYS),
BattleResource.BATTLE_NOTIFICATION_BUILDER))).buildNotification(
BattleOrganizer.getBattleState(BattleResult.BATTLE_LOST),
BattleManager.getChainOfCommand().getCommandChainNotifier()));
For the lack of a battle,
try {
synchronized(BattleInformationRouterLock.getLockInstance()) {
BattleInformationRouterLock.getLockInstance().wait();
}
} catch (InterruptedException ix) {
if (BattleSessionManager.getBattleStatus(
BattleResource.getLocalizedBattleResource(Locale.getDefault()),
BattleContext.createContext(
Kingdom.getMasterBattleCoordinatorInstance(
new TweedleBeetlePuddlePaddleBattle()).populate(
RegionManager.getArmpitProvince(Armpit.LEFTMOST)))) ==
BattleStatus.LOST) {
if (LOGGER.isLoggable(Level.TOTALLY_SCREWED)) {
LOGGER.logScrewage(BattleLogger.createBattleLogMessage(
BattleStatusFormatter.format(BattleStatus.LOST_WAR,
Locale.getDefault())));
}
}
}
For the lack of a war,
new ServiceExecutionJoinPoint(
DistributedQueryAnalyzer.forwardQueryResult(
NotificationSchemaManager.getAbstractSchemaMapper(
new PublishSubscribeNotificationSchema()).getSchemaProxy().
executePublishSubscribeQueryPlan(
NotificationSchema.ALERT,
new NotificationSchemaPriority(SchemaPriority.MAX_PRIORITY),
new PublisherMessage(MessageFactory.getAbstractMessage(
MessageType.WRITTEN,
new MessageTransport(MessageTransportType.WOUNDED_SURVIVOR),
new MessageSessionDestination(
DestinationManager.getNullDestinationForQueryPlan()))),
DistributedWarMachine.getPartyRoleManager().getRegisteredParties(
PartyRoleManager.PARTY_KING ||
PartyRoleManager.PARTY_GENERAL ||
PartyRoleManager.PARTY_AMBASSADOR)).getQueryResult(),
PriorityMessageDispatcher.getPriorityDispatchInstance())).
waitForService();
All for the lack of a horseshoe nail.ps: among the APL examples from the article, I'd add most of the IOCCC submissions.
That can only be because you don't understand APL or its principle of condensed simplicity. This is one of those cases where the reflexive judgment is completely wrong. We're so used to code being sprawlingly complex that APL and its derivatives seem obviously perverse, when in fact they are lyrical, and the problem is with us and our 'obvious' preconceptions.
If APL were a matter of intentional obfuscation you would never hear a student speak like this 30 years later: https://news.ycombinator.com/item?id=10481967.