Back to previous post: A Death in the Family

Go to Making Light's front page.

Forward to next post: More Push-polling

Subscribe (via RSS) to this post's comment thread. (What does this mean? Here's a quick introduction.)

December 27, 2007

The root of all evil
Posted by Avram Grumer at 09:43 PM *

It was through one of O’Reilly’s books on perl (camel or llama, I’m not sure which) that I first encountered the Three Great Virtues of Programmers: laziness (which makes you write useful programs to save repetitive effort), impatience (which makes you write your programs so that they’ll anticipate your needs), and hubris (which makes you write programs well so you won’t be embarrassed later).

I’d always thought this notion was original to Larry Wall, till just a moment ago, when I discovered that part of it is a centuries-old Christian idea. According to Wikipedia, a 16th-century theologian named Peter Binsfeld associated each of the Seven Deadly Sins with a demon. The demon for sloth was Belphegor, who was believed by demonologists to help people make discoveries and suggest to them ingenious inventions.

Comments on The root of all evil:
#2 ::: Kevin Riggle ::: (view all by) ::: December 27, 2007, 10:56 PM:

The only reference on Peter Binsfeld's Wikipedia page is to a book published by iUniverse -- not what I'd consider a trustworthy source. (Insert rant about printed references here.)

#3 ::: Avram ::: (view all by) ::: December 27, 2007, 11:01 PM:

Kevin, the Belphegor page cites a 1999 edition of Merriam-Webster's Encyclopedia of World Religions.

#4 ::: James D. Macdonald ::: (view all by) ::: December 27, 2007, 11:15 PM:

One day came walking in the door
A creature named Baphalmagor.
It brought a book called Ninety-two
Entirely Wicked Things To Do.

-- Amphigory Too

#5 ::: Michael Turyn ::: (view all by) ::: December 28, 2007, 06:28 AM:

I'm not surprised that things that make life better (to my eyes) are deemed rooted in sin. There is a strain in religion that holds that we deserve all the pain we suffer and that to attempt to escape it is sinful (see: cures for V.D.s).

The ability to say otherwise is strongly connected to the ability to treat our bodies and environment as matter that can be manipulated into something not quite what it was before, as opposed to shadows of some ideal or special creations each with an inbuilt telos that defines and limits its possibile state.

A long-winded way of saying, "Without God, all things are possible," or even "Everything possible to occur is permitted to occur, no thing has a true form," to severely paraphrase Hassan i'Sabbah's grandson.

Another virtuous sinP:
Is insomnia a sin? In the case of coding, it
might be construed as a misuse of sleeplessness more fitted to vigils, or contemplation of one's sins, or of the destruction of the Temple.

("Why is the sky blue, Daddy?"/"Because you've been bad.")

I have written both my best and worst code in the middle of the night, things that made me later think "This is better than my stuff," and things that made me say, "Who wrote this and how could it possibly work?" Sometimes the only difference between the two is adequate documentation in comments and variable/field/method names.

(Tonight, unfortunately, I'm not coding; our router started severly misbehaving and the resultant dyspepsia has kept me awake long past my eventual fix, which was as usual, reset to factory defaults...all this the result of trying to convince Norton that a VPN client is not a worm.)

#6 ::: Charlie Stross ::: (view all by) ::: December 28, 2007, 06:40 AM:

It's absolutely no surprise that Larry Wall would take his inspiration from such sources -- after all, he originally trained as a missionary, before getting side-tracked into JPL and writing software.

One of the books I really want to get signed one of these days (but am not likely to) is my bog-eared, battered, copy of "Programming Perl". First edition, first printing, bought new, and it earned me a living for more years than I care to think about.

#7 ::: Chaz Brenchley ::: (view all by) ::: December 28, 2007, 07:00 AM:

The man who taught me letterpress printing when I was a kidling used to say "It's the lazy man who takes the most trouble." Took me years to understand him, but yes. Belphegor.

#8 ::: Linda Lindsey ::: (view all by) ::: December 28, 2007, 07:34 AM:

And on Saturdays, he masquerades as the patron saint of efficiency.

#9 ::: Lance Weber ::: (view all by) ::: December 28, 2007, 08:59 AM:

Is that why we call them daemon processes? :)

All of my temp threads are going to be named 'belph' from now on. And yes, I'm one of those programmers who names his buffers 'buffy'...

#10 ::: MattF ::: (view all by) ::: December 28, 2007, 09:32 AM:

Note also the sense in which 'Sloth' is Insufficient Enthusiasm.

#11 ::: Bruce Cohen (SpeakerToManagers) ::: (view all by) ::: December 28, 2007, 09:47 AM:

Michael Turyn @ 5
Sometimes the only difference between the two is adequate documentation in comments and variable/field/method names.

Programming has taught me that Platonism is flat wrong: names matter immensely, but only to the programmer*; the program doesn't care.

* and hir successor, who has to maintain the code.

#12 ::: Bruce Cohen (SpeakerToManagers) ::: (view all by) ::: December 28, 2007, 10:06 AM:

Lance Weber @ 9

I think we ought to start calling some of them phoenix processes, the ones that are coded to start again when killed.

#13 ::: Schadenjoy ::: (view all by) ::: December 28, 2007, 10:07 AM:

My dad: "To find the most efficient way to do a task, give it to a lazy man"

#14 ::: rea ::: (view all by) ::: December 28, 2007, 10:23 AM:

Wasn't Belphegor also the Curse of Rondoval? I leave it to more erudite Zelazny fans than me to asnwer this question . . .

#15 ::: albatross ::: (view all by) ::: December 28, 2007, 10:34 AM:

I've seen this idea bounced around before, though I'm not sure where. I think one of Harry Browne's books (_How I Found Freedom in an Unfree World_) discussed how traditionally "bad" emotions/drives like fear, greed, and sloth mostly led you to do very sensible things like avoid danger, save back some money for rainy days, and find labor-saving ways of doing things. And of course, there's the story of the Man Who Was Too Lazy to Fail in Heinlein's _Time Enough For Love_. But my favorite variation of this idea is from Shaw:

Reasonable men adapt themselves to their environment; unreasonable men try to adapt their environment to themselves. Thus all progress is the result of the efforts of unreasonable men.

#16 ::: Lee ::: (view all by) ::: December 28, 2007, 10:34 AM:

Michael, #5: WRT cures for VD being "sinful", this generally only holds true when the victim is female -- witness the current fuss about the HPV vaccine. I've never heard anyone argue that syphilis or gonorrhea treatments shouldn't be available for men. (Which doesn't mean it doesn't happen, only that I have no examples ready to hand.)

#17 ::: xeger ::: (view all by) ::: December 28, 2007, 10:35 AM:

Schadenjoy @ 13 ...
My dad: "To find the most efficient way to do a task, give it to a lazy man"

Alternately - "A lazy man will spend more effort spending less effort than a smart man"

#18 ::: Steve B ::: (view all by) ::: December 28, 2007, 10:38 AM:

Belphegor was obviously the demonic influence behind "The Tale of the Man Who Was Too Lazy to Fail" in Heinlein's _Time Enough For Love_.

#19 ::: Dave Langford ::: (view all by) ::: December 28, 2007, 10:49 AM:

#14: the Curse of Rondoval is called Belphanior.

Let me also mention R.A. Lafferty and "Eurema's Dam".

#20 ::: Xopher ::: (view all by) ::: December 28, 2007, 10:54 AM:

Many years ago, in a previous life in which I was a programmer (using dBase II, III, IV, later what is now called "Old C," and many other abominations and things of beauty), I opined that the best philosophy for a programmer was "enlightened laziness." That is, the ability to think long term about the amount of work one would do.

I remember having this conversation with a classmate back in Fortran IV class:

Him: How long did it take you to write the [homework assignment] program?
Me: Oh, I spent about six hours on it.
Him: Ha! I wrote it in half an hour.
Me: Good for you. How many tries did it take you to get it to work?
Him: (confused) I haven't gotten it to work yet.
Me: Mine worked on the second try.

At that point he'd spent more than twice as much time working on the program that he'd "written" so quickly.

Unfortunately I adhere to the same practice in writing fiction, where it's MUCH less effective. :-(

#21 ::: Joel Polowin ::: (view all by) ::: December 28, 2007, 11:17 AM:

There's a quotation I've been trying to track down for some time; perhaps the local group mind can point me in the right direction. A military leader comments to the effect that:

"We have four kinds of men in our army. A few are smart and energetic -- we make them the generals, the leaders. Some are smart and lazy; we make them the sergeants. They'll figure out the way to get something done as efficiently as possible, to minimize the work. Then we've got the dumb, lazy ones; they're our regular soldiers. Finally, we've got the ones who are stupid and energetic. We try to shoot them before they cause too much damage."

#22 ::: Adrian Smith ::: (view all by) ::: December 28, 2007, 11:29 AM:

Rommel, sounds like, though it seems to have mutated a bit.

#23 ::: Joel Polowin ::: (view all by) ::: December 28, 2007, 12:08 PM:

That looks about right (though nobody on the various sites with the quotation seems to be able to provide a source for the attribution). Thanks.

#24 ::: Tim Pratt ::: (view all by) ::: December 28, 2007, 12:10 PM:

I can't remember where I first read about Belphegor -- Davidson's Dictionary of Angels maybe? I've always liked him, though, and he appeared in a couple of my early fantasy stories as an idiot savant inventor-demon. Great name, too.

#25 ::: Michael Turyn ::: (view all by) ::: December 28, 2007, 01:00 PM:

Bruce Cohen (...)::5

Actually, names can matter: I'm sure there are a lot of stories like the one I heard about hacking up a hand-held, speech-enabled, game in the early '90s or late '80s for a demo, fitting all the BASIC into 64k...they had to make a frequency table for their variables and assign them names: a,b,...,z,aa.... u.s.w.. I've always assumed that opitmising compilers might do the same, e.g. for the RAM-shy phones with which I contend these days.

The best way I've found to make sure that your code is comprehensible to its next maintainer is to remember that it might well be _me_.

Lee::16
I'm pretty sure I've heard of objections to VD cures for both sexes; I hadn't wanted to bring up the resistance to anaesthesia for child-birth because I didn't want to spawn a discussion (or, worse yet, a "discussion") of natural versus inorganic child-birth...we might end up mired in that maze, la?

The HPV vaccination resistance has at least one foot _firmly_ in the abstinence movement: I've at least once heard a recording of an abstinence proponent (chastitease?) triumphantly dragging out the incurability and unpreventability of HPV for a trump card. (The other foot is in resistance to giant government programmes in general, or giant government-subsidised drug trials more specifically; I have mixed feelings, but my guess is that I'll jump at the chance to try the American Teleomerase Hack early on no matter who's paying---getting older isn't bad, but greater infirmity is, and we were in no way "meant" to suffer it despite what some religious figures have said [bringing us back to the original thread-topic].)

#26 ::: Steve Downey ::: (view all by) ::: December 28, 2007, 01:58 PM:

SpeakerToManagers @ 11 - "Always code as if the person who will maintain your code is a violent psychopath who knows where you live"

& @12 - There's a technique in C++ known as the Phoenix Singleton, where the singleton will rise from the ashes if it is referenced after having been destroyed. Unfortunately it can also produce an anti-deadlock as two singletons Alphonse & Gaston each other.

#27 ::: Steve Downey ::: (view all by) ::: December 28, 2007, 02:04 PM:

Kevin Riggle @ 2
There's a footnote in a document hosted at the Hanover Historical Texts project (http://history.hanover.edu/texts/trier.html)

[6] Binsfeld, suffragan bishop and real head of ecclesiastical affairs in the diocese, was doubtless the prime mover in the punishment of Loos. He had himself written a book, De confessionibus maleficorum et sagarum (Trier, 1589), to prove that the confessions of witches were worthy of all faith.

Most of the references I've found online are a bit more dubious, and largely self-referential.

#28 ::: Network Geek ::: (view all by) ::: December 28, 2007, 04:58 PM:

@13: Schadenjoy, my father told me the same thing, just after I graduated from college and got a job. I wish I'd known that while dealing with projects *in* college!

@15: Albatross, thank you for that Shaw quote! I'm adding it to my sig rotation!!

#29 ::: Seth Breidbart ::: (view all by) ::: December 28, 2007, 06:08 PM:

Steve #26, the way I've used the first is "Document your code as if it will be maintained by a homicidal maniac who knows where you live BECAUSE I DO."

My standard used to be "Document your code as if, two years after the last time you thought about it, you'll need to update it because the world changed out from under it." I was wrong; it was five years.

#30 ::: Bruce Cohen (SpeakerToManagers) ::: (view all by) ::: December 28, 2007, 06:32 PM:

Lee @ 16

I think Michael was referring to the nature of the cure being a penance for the sin committed in getting the disease. For instance, ISTR that at one time the 'cure' for syphillis (or maybe it was gonhorrea) in males consisted of running a stiff brush up the urethra. Now this sounds incredibly painful to me, but not particularly effective in any medical sense. So the discomfort may have been the main intent.

#31 ::: Lee ::: (view all by) ::: December 28, 2007, 06:37 PM:

Michael, #25: Anesthesia during childbirth is a much better argument, because the resistance to that was absolutely based on one particular phrase in the Bible. It took Queen Victoria's accouchement to make the easing of labor pains socially acceptable.

WRT the soi-disant "abstinence movement", you will notice that, despite a certain amount of lip-service in the direction of gender equality, it is in practice ALL directed specifically at women. Men are equally subject to HPV (in fact, many properly-chaste women get it from their not-so-chaste husbands!), but they're only screaming about the vaccine being given to girls. What they're really saying here is, "I'd rather see my daughter dead of cervical cancer than have her be sexually active in ways I don't approve."

#32 ::: Bruce Cohen (SpeakerToManagers) ::: (view all by) ::: December 28, 2007, 06:40 PM:

Lee @ 31

I suspect the abstinence motivation is yet more hypocritical than that: "I'd rather see my daughter dead of cervical cancer than for it to be publicly known that she is sexually active in ways others won't approve."

#33 ::: abi ::: (view all by) ::: December 28, 2007, 06:56 PM:

Lee @31:
It took Queen Victoria's accouchement to make the easing of labor pains socially acceptable.

So it did; she asked Edinburgh physician James Young Simpson† to administer ether.

He had been experimenting with various gases to induce unconsciousness, and had a most peculiar way of testing them. He would try them out on his dinner guests. When, after breathing ether and passing out, they all came round some time later, he knew he had a winner.

My elder child was born in the Simpson Maternity Pavilion at the old Royal Infirmary in Edinburgh*. My younger was born in the new Royal, where the maternity ward was not intended to have a name. After enormous outcry from all levels of Edinburgh society, it was named the New Simpson.

-----
† Simpson was going to be a lawyer when he entered Edinburgh University, but became fascinated by medicine after attending dissections by Dr Robert Knox. Knox was later famous for buying corpses from Burke and Hare, no questions asked (in the absence of other suitable candidates for dissection)

* My husband was also born in the old Simpson. On coming to visit, my mother in law's comment was, "Huh. They haven't redecorated, I see."

#34 ::: protected static ::: (view all by) ::: December 28, 2007, 07:14 PM:

Joel @ 21 --

I've found a variant attributed to Schlieffen. *shrug* Dunno. I seem to recall it being attributed to an American Civil War leader, too...

(Oh, and to return to the thread, I'd like to enter a plea of no contest to the charge of programming while consorting with Belphegor.)

#35 ::: Bob Oldendorf ::: (view all by) ::: December 28, 2007, 08:06 PM:

#21, #22, #34: And I heard it attributed to Field Marshall Kurt von Hammerstein-Equord:

"I divide officers into four classes -- the clever, the lazy, the stupid and the industrious. Each officer possesses at least two of these qualities. Those who are clever and industrious are fitted for the high staff appointments. Use can be made of those who are stupid and lazy. The man who is clever and lazy is fit for the very highest commands. He has the temperament and the requisite nerves to deal with all situations. But whoever is stupid and industrious must be removed immediately."

#36 ::: P J Evans ::: (view all by) ::: December 28, 2007, 09:07 PM:

My theory tended to be 'let the computer (or gravity, depending) do the work.'

May I also plead no contest?

#37 ::: CHip ::: (view all by) ::: December 28, 2007, 09:28 PM:

Turyn@25: I saw that; don't think you're going to get away with a bit of coaching or panting.

#38 ::: heresiarch ::: (view all by) ::: December 28, 2007, 09:47 PM:

If you give a man a fish, you feed him for a day. If you teach him to fish, you feed him for a life-time. If you teach him to teach others to fish, you feed a nation. If you teach him to teach himself whatever he needs to know, then you can go and enjoy the beach somewhere nice.

#39 ::: Rob Rusick ::: (view all by) ::: December 28, 2007, 09:57 PM:

abi @33: Re: James Young Simpson. How did he deal with the dinner guests who never recovered consciousness? Aside from never inviting them again...

#40 ::: Michael Turyn ::: (view all by) ::: December 28, 2007, 10:11 PM:

A low-powered search using Google, Inc.'s page produced this on Canadian Amazon (my U.S. Amazon login worked for it):
http://www.amazon.ca/No-Magic-Bullet-History-Venereal/dp/0195042379
...in which there seems to be dismissive reference by reformers to the idea of V.D. as divine punishment, so it is possible that the sentiment actually was abroad or that they were constructing a straw-man.

Another reference further down
http://tinyurl.com/yw6tm3
mentions the idea of V.D. as a punishment for the destruction of the proper social order, seemingly the particular face of a General Judgement.

I am also surely reflecting my suspicion of what I see as rampant they-got-what-they-deserved-ism in our culture from way back; I think the suspicion is well grounded, but it 's not the same as evidence.

#41 ::: Henry Troup ::: (view all by) ::: December 28, 2007, 10:17 PM:

#38 - if you teach him to fish, you'll need an entire government department to license and regulate his fishing. Most likely both provincial and national departments, even.

(Not enough lazy people in most governments!)

#42 ::: Henry Troup ::: (view all by) ::: December 28, 2007, 10:22 PM:

Anyone notice the Google ads on this thread? I'm offered exorcism in one, and proof of demonic possesion in another.

#43 ::: John A Arkansawyer ::: (view all by) ::: December 28, 2007, 10:41 PM:

I don't know about other STDs, but the idea that AIDS was divine punishment is promoted by evil and believed by the ignorant.

#44 ::: James D. Macdonald ::: (view all by) ::: December 28, 2007, 11:20 PM:

Up the close an' doun the stair,
But an' ben wi' Burke an' Hare;
Burke's the butcher, Hare's the thief,
Knox the boy wha' buys the beef.

#45 ::: Adrian Smith ::: (view all by) ::: December 29, 2007, 12:45 AM:

Heresiarch@38: If you give a man a fish, you feed him for a day. If you teach him to fish, you feed him for a life-time. If you teach him to teach others to fish, you feed a nation. If you teach him to teach himself whatever he needs to know, then you can go and enjoy the beach somewhere nice.

Where you may find yourself noticing that there don't seem to be quite as many fish as there used to be.

Cynic's version (via someone on a.p):
"Give a man a fish and you establish a relationship which centres upon your predisposition to kindness and your control of the fish supply. Teach a man to fish and you must then find something else to do."

#46 ::: albatross ::: (view all by) ::: December 29, 2007, 01:42 AM:

#43 John:

I've heard/seen the "AIDS is a plague from God" argument a fair number of times. (For some reason, God apparently really has it in for hemophiliacs. And Man, does He ever dislike the wives and children of truck drivers in Sub-Saharan Africa.)

I think all kinds of beliefs evolved around the idea of making suffering somehow noble or restorative, during time when that suffering was simply unavoidable. Perhaps it makes you feel better, as you're suffering from advanced syphlis, that your suffering is atonement for how you got it. (Assuming that you got it from your own misbehavior, rather than your spouse's or rapist's misbehavior.) And this developed over time into the idea that there was something good about that suffering, leading to the awful idea that it would be bad to prevent or ease that suffering.

But the idea that suffering is divine punishment is pretty obviously nonsense, since we live in a world full of undeserved suffering. Hospitals are full of suffering people, many of them children, who are pretty obviously not any more guilty than any random selection of people off the streets. There's also a bit of the New Testament that directly contradicts the idea that having some disaster befall you implies some special guilt on your part, which I wish had more effect on people running with this idea.

I think there's this deep wish for most of us to see a universe in which bad things don't happen to good people, but of course that's not the world we live in. Every one of us will die sooner or later, and that's not because of anything we did, it's just being human. Over our lives, we'll all suffer pain sometimes, and loss, and all kinds of other things, again just because we're human.

#47 ::: Lee ::: (view all by) ::: December 29, 2007, 02:26 AM:

Michael, #40: You're probably quite right; I did say that I just couldn't recall any immediate examples. And John at #43 has provided one very definite example, but I'd still like to see more of them directed at straight men; the culturally-unquestioned right of men (especially men of privilege) to have sexual access to women's bodies (especially those of women of lower social status) is a very strong counterweight against the notion of male VD as "God's will" or "a punishment from God".

Albatross, #46: One of my all-time favorite quotes:
I used to think it was terrible that life was so unfair. But then I realized, wouldn't it be even more terrible if life WERE fair, and all the awful things that happen to us came because we actually deserved them? So now I take great comfort in the general hostility and unfairness of the Universe."
- Marcus Cole on Babylon 5

#48 ::: Gar Lipow ::: (view all by) ::: December 29, 2007, 03:22 AM:

Albatross #46

>There's also a bit of the New Testament that directly contradicts the idea that having some disaster befall you implies some special guilt on your part, which I wish had more effect on people running with this

I knew that is a major point of Job. So there is a part of the Christian testament that reiterates that lesson?

#49 ::: bryan ::: (view all by) ::: December 29, 2007, 04:56 AM:

All this really depends on your definition of laziness. I could give counter examples of laziness that would take up quite a bit of time posting, but they were not the most efficient ways to do things. The obvious rejoinder is that they were not true examples of laziness because they were inefficient implementations of the task at hand. Maybe what is needed is laziness and intelligence at the same time.

#51 ::: heresiarch ::: (view all by) ::: December 29, 2007, 08:01 AM:

albatross @ 46: "I think all kinds of beliefs evolved around the idea of making suffering somehow noble or restorative, during time when that suffering was simply unavoidable."

I struggle sometimes with the fact that, while following Buddhist principles of detachment and harmony have dramatically improved my happiness level, it's only the crazy, irrational struggle against "unchangeable" conditions that actually improves the world. It's hard to reconcile the two.

#52 ::: Manny Olds ::: (view all by) ::: December 29, 2007, 10:40 AM:

In "Cheaper by the Dozen", the author talks about his parents' efficiency business. When they went into a plant, the first thing they did was ask to be shown to the laziest man. He would have found ways to do things that required less effort.

(I read it when I kid but I still remember the method Mr Gilbreth taught his kids for efficient bathing.)

#53 ::: Faren Miller ::: (view all by) ::: December 29, 2007, 10:48 AM:

For years I've been lazy (and miserly) enough to accept a slightly balky computer -- made slower online by dial-up -- but now I think my laziness requires something easier. Defrag has just stopped working, after being fine last week, the Scan Disk I'm told to use to fix this stalls while "checking file allocation tables", and the nice gentleman who used to make house calls and help with such problems is no longer available.

I'm not asking for diagnoses here, since what I really need is a new machine. Any recommendations on something relatively cheap (I still want to pinch pennies) and reliable?

By sometime in the coming year, I might even break down and get wireless, and then Serge will have to stop teasing me about the confounded thing!

#54 ::: Faren Miller ::: (view all by) ::: December 29, 2007, 11:12 AM:

PS to my previous comment: I ran two anti-virus checks, the second with the very latest AVG update, and they found no virus. The problem is more likely to be an aging mechanism limping its way into entropy.

#55 ::: Michael Turyn ::: (view all by) ::: December 29, 2007, 11:22 AM:

Faren::53:

I won't recommend a computer beyond a standard "keep in mind for what use you're buying the machine, and don't bother getting one twice as powerful as that". If you work for a large institution that allows its employees to piggyback their purchases on the corporate, it's a good idea to try; selection may be limited.

I will, however, strongly recommend that you back up what you've got as soon as possible; your drive _might_ be on its last legs, and it sounds like you've got a few years' work on the machine. I'd recommend backing up everything on your machine, then exporting your registry (which might include product registration codes you'll need) to the disc and then backing that up.

The above stood me in good stead last summer; writing down registration codes by hand in a file would have been a good plus, since looking for them in the registry dump, or in ancient e-mail files, can be boring.

I'm not sure about the board-specific netiquette about recommending specific brands and shops in this public forum, so I'll send such by another channel.

#56 ::: Xopher ::: (view all by) ::: December 29, 2007, 12:18 PM:

Gar 48: Yes, Luke 13:1-5.

There were present at that season some that told him of the Galilaeans, whose blood Pilate had mingled with their sacrifices. 2 And Jesus answering said unto them, Suppose ye that these Galilaeans were sinners above all the Galilaeans, because they suffered such things? 3 I tell you, Nay: but, except ye repent, ye shall all likewise perish. 4 Or those eighteen, upon whom the tower in Siloam fell, and slew them, think ye that they were sinners above all men that dwelt in Jerusalem? 5 I tell you, Nay: but, except ye repent, ye shall all likewise perish.
In other words, bad things don't happen to people because they're bad, but because they're bad AND unlucky. It's weird to me that he seems to be promising that if they truly repent nothing bad will happen to them, but I don't think that's a correct interpretation.

#57 ::: DaveL ::: (view all by) ::: December 29, 2007, 01:07 PM:

I'm reminded of a subsection of Heinlein's Lazarus Long book: "The Man Who Was Too Lazy To Fail."

It appeared semi-autobiographical at the time. I suspect Heinlein would have liked Perl.

(That's not a compliment, by the way.)

#58 ::: Charlie Stross ::: (view all by) ::: December 29, 2007, 06:40 PM:

DaveL, let me assure you, Perl does not reward excessive laziness. In fact, it bites you hard if you're excessively lazy.

On the other hand, if you make the effort to do it right, it's a delight and a joy (and it will take you approximately one-fifth as many lines of code to accomplish any given task as C/C++/Java or similar lower-level traditional languages).

#59 ::: Michael Turyn ::: (view all by) ::: December 29, 2007, 10:20 PM:

Halting State: Mary-Sue Reed, the brightest young Python-hacker in the fleet....

O.K., Perl isn't Python, (...
http://xkcd.com/353/
...), but they're close enough in niche, different from Java or C++ or MSJava---excuse me, I meant "C#"---excuse me, I meant "protectors".

(I've done Python, but only for money, so it doesn't mean I'm really "that way". It was o.k., I didn't need and avoided the object bits, but....whitepace? I've done a little Perl for fun; I liked it, but I have to wonder how much of the affection for it is rooted in how abusive it is at the beginning to you, as per the Marines, the Foreign Legion*, &c..)

(What I want in a language is very simple: a great IDE, a good UI builder, and for it to be Smalltalk...o.k., I'll settle for something else, but in practice I find that making it easy to notice my typing mistakes and to quickly find APIs and old code to steal matters more than the particular grammar and reserved symbols...mind you, the less automagical stuff and alchemy [and I'm not talking about The Laundry here, Charles] the better. Then again, I'm not a programmer: I'm a physicist/problem-solver who programs when he can find work; note the query string in my URI.)

*An informant told me that his first day consisted of loading 100kg cement bags into a ship in the middle of the summer; sixty years later he was still in some ways a Legionnaire.

#60 ::: Bruce Cohen (SpeakerToManagers) ::: (view all by) ::: December 30, 2007, 12:07 AM:

Michael Turyn @ 59

I am a programmer, and I agree completely about Smalltalk. For me, though, the object parts are the tastiest bits. I started using Python recently, and, though I"m quite put out by the whitespace nonsense (I spent 2 hours chasing tabs around one of my modules the week before last), it's got a nice object model, and a very nice metaobject model. But I agree, the simpler the lexical and syntactic model, the better. And any language that's got a lambda is usable.

#61 ::: Christopher Davis ::: (view all by) ::: December 30, 2007, 01:11 AM:

Like Charlie (#6) I have an original first-first of Programming Perl, though mine is signed (by Randal, but not by Larry); I also have a copy of the second edition (first printing) signed by Randal, Larry, and Tom.

I started with Perl in the days of 3.0.18 or thereabouts, and used it heavily for many years. I, too, looked at Python and wondered about its usability because of the whitespace issue.

Now I do as much as possible in Python (though I still fall back on Perl for the ++awk sort of tasks that are most easily done with a line or two using perl -p -e).

Since I use a syntax-aware operating system editor, I've never had the problems I feared I would with whitespace in Python. Given the number of times I had to use indent-region to figure out where my Perl was missing a closing curly brace, having whitespace meaningful in and of itself is actually an improvement!

#62 ::: xeger ::: (view all by) ::: December 30, 2007, 02:24 AM:

I've been frustrated by python - I find myself repeatedly asking if the [awkward|backward|odd|annoying] way that I'm doing something is -really- the 'right' way to do things. I won't claim that perl hasn't driven me around the bend in it's own, inimitable way, but at least there's more than one way to do it!

Beyond that, python seems to suffer from the bootstrapping problem - the documentation[0] presumes that you already have a grasp of python, and is thus deeply unhelpful until you've passed the point of initial frustration.

All that aside (and I'm sorry - "syntax error" as the response for a whitespace problem is deeply poor HCI), python feels to me like a fledgling dancer, all awkward angles and misplaced limbs, with occasional flashes of potential[1].

[0] Which is available online, with the python distribution
[1] Perl leads me to wonder about how many of the core perl developers are cthulhu, marine biologist, or hentai fans

#63 ::: xeger ::: (view all by) ::: December 30, 2007, 02:24 AM:

I've been frustrated by python - I find myself repeatedly asking if the [awkward|backward|odd|annoying] way that I'm doing something is -really- the 'right' way to do things. I won't claim that perl hasn't driven me around the bend in it's own, inimitable way, but at least there's more than one way to do it!

Beyond that, python seems to suffer from the bootstrapping problem - the documentation[0] presumes that you already have a grasp of python, and is thus deeply unhelpful until you've passed the point of initial frustration.

All that aside (and I'm sorry - "syntax error" as the response for a whitespace problem is deeply poor HCI), python feels to me like a fledgling dancer, all awkward angles and misplaced limbs, with occasional flashes of potential[1].

[0] Which is available online, with the python distribution
[1] Perl leads me to wonder about how many of the core perl developers are cthulhu, marine biologist, or hentai fans

#64 ::: Charlie Stross ::: (view all by) ::: December 30, 2007, 06:06 AM:

If you're having trouble finding missing brackets in Perl, you're using the wrong editor. Just bounce on the percent key in vi and it'll show up soon enough. IDEs are for WIMPs (although I'll give you a pass for a source level debugger, as long as you don't overuse it).

Yes, you're right, I never got the hang of these new-fangled GUI things. But there's nothing like the fun of writing a Perl module where the only defined method is AUTOLOAD and it contains a case construct that figures out what to do based on the number and kind of arguments you feed it ...

#65 ::: Lance Weber ::: (view all by) ::: December 30, 2007, 09:54 AM:

IDEs are for WIMPs

I'd modify the sentiment slightly to say that someone who can only produce code using an IDE is a wimp. As an extremely lazy programmer, I like having features such as templating, code completion, refactoring, syntax highlighting, SCM, dependency graphing, reference mapping, etc all bundled into a GUI.

Yes, yes, I know you can do all of that in vi/emacs, and I grew up in a shell & prompt world...but I find that my overall effectiveness is higher in an IDE for complex projects.

#66 ::: Erik Nelson ::: (view all by) ::: December 30, 2007, 11:14 AM:

It is my theory that The Fool is the Tarot card of C programmers, because
a) it's card # 0 and you start counting at 0.
b) The fool is depicted walking off a cliff and this signifies that if you don't check your own bounds you will crash.

#11: programming and Platonism:
Don't you go all world-of-Forms and everything if you get into object-oriented stuff? In Python all objects are extensions of the featureless object, for example.

#67 ::: Michael R. Bernstein ::: (view all by) ::: December 30, 2007, 11:55 AM:

Ah, the conversation has turned to an area in which I am confident in my expertise.

Michael Turyn @ #59: Regarding IDEs, there are several available for Python, some free, some commercial: Boa Constructor, Dr. Python, Stani's Python Editor (SPE), Eric Python IDE, PyPE, Komodo, Wing IDE, and others. Your best bet is to try them all to see which strike the best balance for you between features and simplicity[1].

Bruce Cohen @ #60: One of the main advantages of Python's syntactic indentation is that it completely eliminates a whole class of argument about indentation style (of course, you can still have arguments about naming conventions: camelCase vs. CapWords vs. underscore_separated, etc.).

The mixed tabs and spaces problem is solved by using an editor that can be set to insert spaces (typically 4) when you hit the tab key, and has a function or menu option to convert tabs to spaces. Most decent editors can be configured to treat Python files in this way.

Xeger @ #62: The best way to figure out what the 'Pythonic' approach would be is to read other people's Python code[2]. Fortunately, the standardizing effect of the syntactic indentation makes reading other people's code easier.

Regarding the documentation, are you saying that the tutorial[3] at the beginning of the Python documentation wasn't a good introduction?

Charlie @ #64: If vi is your tool of choice, I've recently found a nice GUI wrapper for it called Cream[4] that provides a 'best of both worlds' experience for some folks. I recommended it to Cory recently, but he got hung up on the lack of a 'search-and-replace within the selection only' feature[5].

[1] http://wiki.python.org/moin/IntegratedDevelopmentEnvironments

[2] http://aspn.activestate.com/ASPN/Python/Cookbook/

[3] http://docs.python.org/tut/tut.html

[4] http://cream.sourceforge.net/

[5] http://www.boingboing.net/2007/11/16/droid-sans-mono-a-sw.html#comment-83162

#68 ::: xeger ::: (view all by) ::: December 30, 2007, 12:37 PM:

Michael R. Bernstein @ 67 ...

Ironically enough, the whole reason I was using python -was- reading other folks python code[0].

Yes - that tutorial, which is filled with information, but not helpful :) Strictly speaking, it reminds me of some comp sci textbooks...

Probably wandering too far into geekery for makinglight, but I still have some unease about python's memory management capabilities (and, iirc, global namespaces). Python ate me out of house and home[1], due to only having ~1G of memory to serialize a 10Mb (or was it 1Mb?) file. That was... annoying.

[0] Anaconda, the first time, which was enough to put me off python for years, and both debugging bits and pieces, and working with a colleague the most recent time.
[1] Never did finish parsing the sucker, either - it simply couldn't figure out anything to swap out/around/whatever, in order to actually finish.

#69 ::: John A Arkansawyer ::: (view all by) ::: December 30, 2007, 01:02 PM:

Christopher Davis @ 61: I can do better than that. I have a wrist cast signed by pretty much every Perl luminary at OSCON 2002 except Nat Torkington, who had to leave before this brilliant idea occurred to me. Perhaps it could be auctioned for charity.

Gawd, it was fun going back to work after that! It almost made up for the injury...but not the bill. No, not the bill.

Michael R. Bernstein @ 67:

One of the main advantages of Python's syntactic indentation is that it completely eliminates a whole class of argument about indentation style

Heh. I'd never seen that argument before. Heh. Heh heh heh. Heh heh ha ha ha Ha HA HA HA HA HA!

I'm stealing it.

#70 ::: Bruce Cohen (SpeakerToManagers) ::: (view all by) ::: December 30, 2007, 01:22 PM:

Micheal R. Bernstein @ 67

it completely eliminates a whole class of argument about indentation style

That argument has had the major salutary effect of using up the energy of large numbers of highly combative debaters on a completely innocuous question. Who cares what style someone uses if I can just convert it to my favorite style for reading, and convert it back on save, for writing? One of the advantages of an IDE is that it can support a standard development workflow including formatting automatically. For years I worked in an environment with very strict formatting styles that I found very difficult to read, but the "Save to version control command" automatically did a re-format, merge with head, build, and execute all unit tests, and refuse to commit a new version if any of the tests failed, usually indicating a bad merge. You have no idea how much work that saved me over the course of 4 years.

The mixed tabs and spaces problem is solved by using an editor that can be set to insert spaces

That was the problem: I use xemacs as an editor/basic IDE, and I thought I had set insert-tabs to nil, but a bug in my init file prevented that. I'm still having trouble getting my mind wrapped around this dependence on indentation*, and it took me awhile to realize that's what the error message "syntax error" meant. For one thing, I've spent a lot of time writing command parsers and file converters, and I understand the difference between lexical errors and syntactic ones; making whitespace syntactic is a major paradigm shift for me.

Hypothetically, is there anyone out there who would be willing to use XML if indentation was syntactic?

Erik Nelson @ 66

Every Object-Oriented Language I know except for C++** has at least one root base class, typically Object, because there's some fundamental behavior that all objects should implement in some default manner. In Smalltalk, all values are objects, including hardware-dependent integers, stack frames, etc. This has an unbelievably freeing and simplifying effect: I no longer have to worry about the difference between operater '+' and function add(), or, unless I'm writing numerical computing code for array machines, worry about the side-effects of adding two different numeric types; they're standardized by the fact that the basic virtual machine implements all of that. And if I actually do need different semantics and designing a new class isn't the best way to do that, the VM is written in Smalltalk and I have the source, so changing it is easy.

Lance Weber @ 65

Yes, thank you. I can, and have been for the last year, write C code in vi and emacs without an IDE, although it's more work, and somewhat offends my lazy programmer's soul. But I see no reason why, when the organizing principles of a high-level computing environment are available, I shouldn't use them to get more done sooner.

And, IMO, the most important one of that list of features is refactoring, since the evolution of my designs always involves refactoring from one version to another as I better understand the problemset, or as new requirements become known.

* I bet it makes automatic code generation annoyingly fragile.
** Which I'd call "object-like" rather than "object-oriented".

#71 ::: Charlie Stross ::: (view all by) ::: December 30, 2007, 01:39 PM:

Bruce: apropos your comment to Eric Nelson, Perl doesn't have a base class. On the other hand, there are at least three different ways to do OOP in Perl, and if you use the normal one you get to traipse through a maze of twisty little modules in @INC until you end up bouncing on an autoload method (if there is one).

I haven't ever touched C++ -- the Stroustrup book gave me indigestion -- but I suspect Perl's OOP is descended from C++ by way of Shub-Niggurath.

Despite being a vi-head at heart, there were years when I would have killed for a perl-specific port of cscope.

#72 ::: Michael R. Bernstein ::: (view all by) ::: December 30, 2007, 01:48 PM:

Xeger @ #68: So, you're looking for a Python for non-programmers introduction? How about the ones listed here: http://wiki.python.org/moin/BeginnersGuide/NonProgrammers

If you're looking for a *different* programmers intro, try http://wiki.python.org/moin/BeginnersGuide/Programmers

As for your file serialization problem, it sounds as though your code required the entire file to be in memory (and possibly mutating it several times) before writing anything to disk (as opposed to appending chunks to an existing file). There is more than one way to skin that cat, but the first thing I would try would be StringIO.

John A Arkansawyer @ #69: It's not original. Steal away.

#73 ::: Serge laughs at Faren's Computer ::: (view all by) ::: December 30, 2007, 02:05 PM:

Faren @ 53... For years I've been lazy (and miserly) enough to accept a slightly balky computer -- made slower online by dial-up -- but now I think my laziness requires something easier. (...) Serge will have to stop teasing me about the confounded thing!

...must not... laugh... must control... bwww... BWAHAHAHAH!!!

#74 ::: Michael R. Bernstein ::: (view all by) ::: December 30, 2007, 03:07 PM:

Bruce @ #70: It has not been my experience that the energy of highly combative debaters ever gets 'used up'.

Your point about transparent conversion to/from preferred formatting is well taken, but I'll note that imperfect round-tripping can result in spurious 'changes' that make reading diffs very hard.

"Hypothetically, is there anyone out there who would be willing to use XML if indentation was syntactic?"

Some, but probably not many. In any case, XML isn't intended to be used as a programming language (it *can* be used that way, obviously, but it shouldn't be). The affordances are different.

"I bet it makes automatic code generation annoyingly fragile."

Somewhat (or at least, your code generator can't just cut-n-paste nested bits). However, dynamic programming languages and their metaprogramming features tend to eliminate most of the need for code generation (and it's associated problems) anyway. In fact, I'd guess that Python is more often used to generate code in other languages (that lack those features) than in Python.

#75 ::: Charlie Stross ::: (view all by) ::: December 30, 2007, 04:02 PM:

And then again, there's always CLC-INTERCAL.

#76 ::: DaveL ::: (view all by) ::: December 30, 2007, 04:07 PM:

#58 Charlie Stross: DaveL, let me assure you, Perl does not reward excessive laziness. In fact, it bites you hard if you're excessively lazy.

I think Heinlein (and most pro-"laziness" coders) meant "lazy" in the same sense. That is, time-saving, helpful, fun to play with. Perl, once described as the "Swiss Army Chainsaw," can be all of those.

Having coded extensively in C, C++, Perl, Python, and any number of other languages, I find that Perl falls into the class called "write only" (along with APL and Teco). Python is better in that respect but I hate white-space-with-syntactic-significance. I find C++ with templates overly complex and annoying, C too prone to driving off the cliff, Java too in-groupy and insular, and C# too Microsoftian. I haven't really tried Ruby or Haskell seriously yet.

Ah, for the days of Lisp! Now, THAT was a language!

In any case, arguments about programming languages are in the same class as arguments about religions and sports teams: productive of strong opinions, vehement arguments, but few changed minds.

#77 ::: John A Arkansawyer ::: (view all by) ::: December 30, 2007, 04:12 PM:

DaveL @ 76:

I haven't really tried Ruby or Haskell seriously yet.

Ruby's pretty nice, but I'm not sure it's that much of an improvement over Perl modulo your "write only" objection.

I think this is why Ruby is doing so well:

CPAN:Perl::Rails:Ruby

Not so much the language itself, but the support mechanism around it.

#78 ::: bryan ::: (view all by) ::: December 30, 2007, 04:18 PM:

you know, Serge has been laughing at Faren's computer since open thread 60.

#79 ::: Serge ::: (view all by) ::: December 30, 2007, 04:38 PM:

bryan @ 78... It took THIRTY-EIGHT open threads? Faren is made of stern stuff - certainly sterner than her computer's.

#80 ::: Henry Troup ::: (view all by) ::: December 30, 2007, 11:48 PM:

#55 - let me give a plug for the Magical Jelly Bean Keyfinder which does the donkey work for you. Download it, run it, and print the results, keep in a safe place.

#81 ::: Kevin Riggle ::: (view all by) ::: December 31, 2007, 12:26 AM:

DaveL @76: Having helped maintain a large (30+ kloc) piece of software written in Perl (Request Tracker), I feel that well-written, well-architected Perl code is not "write-once". Perl provides the necessary frameworks for unit testing and encapsulation and all the other good software development practices that every shop should use and a lot of shops don't, and if you take advantage of those and write clean code, you'll have a pretty maintainable Perl program. Perl does make it easy to write unmaintainable code, but that doesn't mean it makes the task impossible.

I'd agree, however, that the amount of skill and experience you need to have as a Perl hacker before you'll turn out maintainable code without having to think too hard about it is another question entirely. (I'm not there yet.)

#82 ::: Christopher Davis ::: (view all by) ::: December 31, 2007, 12:29 AM:

Charlie Stross (#64): I have {X,}Emacs set up to blink the opening brace/bracket/paren when I type the closing one; if I miss one while typing I'll get a "paren mismatch" error when I type "}" to close "(". It was still generally easier to see where things had gone wrong by re-indenting the whole chunk, though, especially when it'd been through a few rounds of cut/paste/rewrite/etc. (And yes, I use the debugger integration features of {X,}Emacs.)

Bruce Cohen (#70): Doesn't python-mode turn indent-tabs-mode off by default in the case where you're using the default settings of py-smart-indentation and py-indent-offset?

#83 ::: xeger ::: (view all by) ::: December 31, 2007, 12:55 AM:

Michael R. Bernstein @ 72 ...
Xeger @ #68: So, you're looking for a Python for non-programmers introduction? How about the ones listed here: http://wiki.python.org/moin/BeginnersGuide/NonProgrammers

Er... you've got the wrong end of the stick there. The problem has more to do with too much experience programming in too many languages, not a lack of programming experience. The presumption is interesting though - Greg caught me in a similar faux pas a few open threads back :)

If you're looking for a *different* programmers intro, try http://wiki.python.org/moin/BeginnersGuide/Programmers

FWIW, I ended up at the Python Library Reference in the end - but sad as it sounds, I'm so very happy to have left python behind for java...

As for your file serialization problem, it sounds as though your code required the entire file to be in memory (and possibly mutating it several times) before writing anything to disk (as opposed to appending chunks to an existing file). There is more than one way to skin that cat, but the first thing I would try would be StringIO.

Er, no. The essential problem boiled down to recursive descent parsing, for which python's built in functions appear to be miserably unsuited. As I believe I'd mentioned, I don't have the specifics handy anymore, but it was very clearly a language issue, not a code issue[0].

[0] We did, ultimately, find two workarounds, the second being to change languages.

#84 ::: Adrian Smith ::: (view all by) ::: December 31, 2007, 02:54 AM:

Perl does make it easy to write unmaintainable code, but that doesn't mean it makes the task impossible.

The thing Charlie mentioned about taking one-fifth the number of lines as any other language sounds like it could be a dangerous temptation for a certain type - compactness may be very elegant but I imagine some people are producing some pretty dense code that way. Hopefully they'll be looking after it themselves.

#85 ::: bryan ::: (view all by) ::: December 31, 2007, 04:09 AM:

xeger at #83: "[0] We did, ultimately, find two workarounds, the second being to change languages."

Was the first one pyparsing? Personally I've found Python pretty useful for parsing, including recursive descent (although the occasions that I've had to use that are few, given that this is not my general job).

#86 ::: Charlie Stross ::: (view all by) ::: December 31, 2007, 07:34 AM:

Adrian: when I was writing my half of a 50kloc credit card processing application (I heard via a back-channel that the last of my initial code base was being retired late in 2007 -- I left the company in early 2000 -- and was handling up to a million credit card transactions per day on a couple of rackmount PC servers) I forced myself to avoid certain constructs and idioms. The complex bits were encapsulated in classes, all variables were strictly lexically scoped and declared with comments as to their purpose, any regular expressions used whitespace and comments to disambiguate them, and so on. In short, it didn't go for idiomatic code density ...

Because you can't hold something that big and gnarly in your brain (at least, in mine) in its entirety without your headmeat exploding. So you rapidly learn to use Perl the way you'd use C.

C lets you write incredibly dense code if you throw away the normal indentation styles and don't bother commenting and have multiple semi-colon separated clauses on every line, but only an idiot uses it that way. Ditto Perl. The only difference is that you can whip up a one-liner in Perl where in C you'd end up writing a shell script instead.

#87 ::: Bruce Cohen (SpeakerToManagers) ::: (view all by) ::: December 31, 2007, 08:10 AM:

Christopher Davis @ 82

Bruce Cohen (#70): Doesn't python-mode turn indent-tabs-mode off by default in the case where you're using the default settings of py-smart-indentation and py-indent-offset?

I'm sure it does, but for some reason, indent-tabs-mode was on, and I was using a pretty bare init file.* Part of the problem may have been some sort of leakage of settings from ECB, which I was running on C code in another frame.

DaveL @ 76

Ah, for the days of Lisp! Now, THAT was a language!

* Loud Applause *
I was enthusiastic about Smalltalk upthread, I'll say similar things about Lisp here. They're both in the minimalist school as far as syntax is concerned**

Charlie Stross @ 75

It may be a cultural thing, but when pointing off to higher planes like that (INTERCAL is clearly a work of the Greater Old Gods), I usually mention Valgol. I've always thought of it as Glory's computer language.

Michael R. Bernstein @ 74

However, dynamic programming languages and their metaprogramming features tend to eliminate most of the need for code generation

That's a good point, and proof of the fact that it's been way too long since I actually wrote any metaprogram code. I've been spending too much time with languages that allow read-only reflection, or that make modifying at the meta level much too complex. I have proved by example that it is possible to write useful metaprograms in C++; the same exercise was a proof that it's not worth the effort.

* most of my personal Unix scripts and customizations were lost with the dotbomb; it's amazing how rapidly management can move to destroy existing environments and product source code when they feel like it.
** If you ignore macro syntax, lisp is extremely simple; even including macros, lisp is still much less arcane than C++, for instance.

#88 ::: Adrian Smith ::: (view all by) ::: December 31, 2007, 08:46 AM:

Charlie@86: Well, I'm glad that you're not the certain type referred to, though I hadn't meant to imply that you were or had been. But I have seen some stuff...

#89 ::: John A Arkansawyer ::: (view all by) ::: December 31, 2007, 10:16 AM:

Kevin Riggle @ 81:

Having helped maintain a large (30+ kloc) piece of software written in Perl (Request Tracker), I feel that well-written, well-architected Perl code is not "write-once"...Perl does make it easy to write unmaintainable code, but that doesn't mean it makes the task impossible.

True. But do you think there may be cultural reasons that some Perl programmers resist the practices that make it maintainable?

#90 ::: Michael R. Bernstein ::: (view all by) ::: December 31, 2007, 10:38 AM:

xeger @ #83: But I didn't presume. I dealt with the ambiguity by giving two separate pointers.

Your statement that Python's built-in functions weren't conducing to recursive-descent parsing prompts me to note that anyone who limits themselves to Python's built-ins is missing the point of a language that has as one of it's main raisons d'ĂȘtre the extension of the language through libraries. Then, I'll second Bryan's recommendation of the pyparsing library. Were you trying to use regular expressions for the purpose?

As far as your being happy to have left Python behind for Java, well, that seems bizarre to me, but I am glad you found a language that suits you.

Bruce @ #87: I wasn't even thinking of anything as gnarly as run time *modification* of code (which Python can also do, of course), just run time generation. When a simple factory function can return a custom class at run time, why bother doing code-generation to accomplish the same task by writing out the equivalent source code to a file?

Apropos INTERCAL and Valgol and the attention we're giving to Python's syntactic indentation, I'll mention the Whitespace programming language: http://compsoc.dur.ac.uk/whitespace/

#91 ::: Erik Nelson ::: (view all by) ::: December 31, 2007, 11:10 AM:

Glory? I don't think the Glory from the Buffyworld is the same person as Glory the mysterious creature under the bed in Howard Cruse's comic strip Barefootz.

I hope not, anyway.

#92 ::: Faren Miller ::: (view all by) ::: December 31, 2007, 12:17 PM:

Serge, you are truly evil.

Everyone else here seems to be speaking in alien tongues, aside from the fellow who told me I should start making back-up disks. I'll try, though it mainly means figuring out how to save years' worth of emails (the equivalent of bundled up letters in olden times), since the Locus work really doesn't need keeping and a handful of stories and poems won't take up much space. Luckily, my next-door neighbor turns out to be much more computer-savvy than I am, and she's happy to give advice.

#93 ::: Faren Miller ::: (view all by) ::: December 31, 2007, 12:19 PM:

Serge, you are truly evil.

Everyone else here seems to be speaking in alien tongues, aside from the fellow who told me I should start making back-up disks. I'll try, though it mainly means figuring out how to save years' worth of emails (the equivalent of bundled up letters in olden times), since the Locus work really doesn't need keeping and a handful of stories and poems won't take up much space. Luckily, my next-door neighbor turns out to be much more computer-savvy than I am, and she's happy to give advice.

#94 ::: Serge ::: (view all by) ::: December 31, 2007, 12:24 PM:

Faren... I take it that my EEEEEEVIL is such that it can't be contained in one copy of the same post, eh? Either that or Faren's Computer really needs to be retired to that same place where M5 now resides.

#95 ::: Michael Turyn ::: (view all by) ::: December 31, 2007, 01:40 PM:

Faren: Unless you are seriously out of money, or can't use a cheap external drive (don't have a USB port, or are using a pre-Windows 2000 operating system, or are using a Mac in which case there might be another solution) I would strongly recommend getting an external hard drive---it's much easier to back up the whole disc and sort things out later (though that might depend on how many of your files are Albigensian)....

Erik: It was; "Don't make frogs at me, That Which Cannot Be Named!," wouldn't have fit in the panel...all the characters in that strip always seemed kind of mindless, now we know why (or at least now I do after consulting wikipedia; I couldn't stand very many episodes of "Buffy the Vampire Slayer" as time went on).

LISP: I've a number of friends for whom LISP (and LMI specifically) were what the First International, or The Sixties, or The Anschluss for that matter, were for others---note that LISP is eminently suited to this sort of [dr]eification by virtue of being spelt entirely with capital letters straight out of the box. I've long had the attitude toward using Object Common LISP as that the young Augustine held toward chastity.

Editors: generally I find myself drawn to using emacs for shell scripts, IDEs for GUIs.

#96 ::: P J Evans ::: (view all by) ::: December 31, 2007, 01:56 PM:

On external hard drives: I was mildly boggled by the coupon in a collection from Costco for a 1TB external drive, less than US$300.

I have this mental picture of all of the computing power in the US in, say, 1948, sitting on my desk. What would they have thought, if someone told them that 60 years later it would be small enough to be moved from place to place in a duffelbag? And that there were millions more of them in the country?

#97 ::: xeger ::: (view all by) ::: December 31, 2007, 02:43 PM:

Michael R. Bernstein @ 90 ...
Your statement that Python's built-in functions weren't conducing to recursive-descent parsing prompts me to note that anyone who limits themselves to Python's built-ins is missing the point of a language that has as one of it's main raisons d'ĂȘtre the extension of the language through libraries. Then, I'll second Bryan's recommendation of the pyparsing library. Were you trying to use regular expressions for the purpose?

... which amusingly enough brings me back full circle to "what is the best way to do $foo", and it being very hard to find that information ;) I made the presumption, erroneously, perhaps, that the core language would include core libraries that were sufficient to many tasks.

I'll be damn'd if I can find the correct bit, still, despite a bit of poking around, but there's a python built-in that theoretically handles turning nested configs a la:

foo {
   bar [
      baz ( bing )
          ]
   shproing
   }

into data structures that can be manipulated by python. Unfortunately, it doesn't much like deep structures - as said, the problem wasn't with being able to process the structure once built - it was with being able to get the structure at all.

As far as your being happy to have left Python behind for Java, well, that seems bizarre to me, but I am glad you found a language that suits you.

It's pretty bizarre to me, too - and I wouldn't say that java suits me, as much as java suits me better than python. LISP, OTOH has an inimitable elegance...

#98 ::: albatross ::: (view all by) ::: December 31, 2007, 02:49 PM:

#96 PJ:

Yeah. In college one year, my roommate had a credit-card-sized membrane-keypad solar-powered calculator. I used to fantasize about inventing a time machine, dropping that on Leslie Groves' desk, and then (through some discrete bug left in the office) watching the whole massed scientific brainpower of the Manhattan Project go completely bugf-ck trying to figure it out. I think the most reasonable guess for the source they could think of would be space aliens.

#99 ::: P J Evans ::: (view all by) ::: December 31, 2007, 02:56 PM:

albatross @ 98

I still have one of those, somewhere. (It turns itself off, too.) The one I have in my purse is a solar-powered scientific, but it's a bit larger than a credit card.

(Come to think of it, they'd have a cow over credit and debit cards, too. And iPods and flashdrives - oh the hairpulling!)

#100 ::: Xopher ::: (view all by) ::: December 31, 2007, 03:19 PM:

albatross 98: I think the most reasonable guess for the source they could think of would be space aliens.

Well, wouldn't that be more reasonable than a time-traveling prankster? I should think it would.

#101 ::: Fragano Ledgister ::: (view all by) ::: December 31, 2007, 03:24 PM:

Space aliens using the same number and sign system as humans?

#102 ::: Xopher ::: (view all by) ::: December 31, 2007, 03:41 PM:

Compared to time travel? Space aliens who observed our number and sign system and built a small device using their technology and our notation systems sound damned reasonable compared to time travel.

Actually, the Manhattan Project folks would have gone storming off in a rage to the highest-level military they can find and said "YOU! You've been developing superminiaturized computers, and you won't let us use them to win the war?!?!?!?"

More likely than space aliens. But space aliens still beat out time travel.

#103 ::: Xopher ::: (view all by) ::: December 31, 2007, 03:45 PM:

could*

#104 ::: P J Evans ::: (view all by) ::: December 31, 2007, 03:50 PM:

Then you pull up the pictures from the various space probes and show them Mars and Jupiter and Saturn, up close and in color, and convince them it's really space alien technology! (The Cassini mosaic of Saturn from the far side, for one, the Mars photos by Spirit and Opportunity, and some of those spectacular photos by Hubble, come to mind.)

#105 ::: Mary Dell ::: (view all by) ::: December 31, 2007, 03:54 PM:

But space aliens still beat out time travel.

Scissors cut space aliens

#106 ::: Xopher ::: (view all by) ::: December 31, 2007, 03:57 PM:

Hmm, Mary, that implies that advanced scissor technology can't be brought back in time, if you think about it.

#107 ::: Mary Dell ::: (view all by) ::: December 31, 2007, 03:59 PM:

Xopher @#106: because space-time continuum wraps scissors?

#108 ::: Xopher ::: (view all by) ::: December 31, 2007, 04:14 PM:

No, because time travel crushes them.

#109 ::: Mary Dell ::: (view all by) ::: December 31, 2007, 04:17 PM:

Ah, of course. I was getting my causality reversed. As one does, with time travel.

#110 ::: ethan ::: (view all by) ::: December 31, 2007, 04:20 PM:

Wait, I'm confused. I don't see aliens anywhere on either the standard diagram or the expanded one.

#111 ::: Xopher ::: (view all by) ::: December 31, 2007, 04:21 PM:

If the time travel crushes the scissors BEFORE they cut the space aliens, will the space aliens still beat time travel? Because if they do, they don't, and if they don't, they do.

Oops. We must have violated causality. How else explain the black hole coming at us at .75c?

#112 ::: Fragano Ledgister ::: (view all by) ::: December 31, 2007, 04:25 PM:

No, no, the black hole blunts the scissors (extremely).

#113 ::: Xopher ::: (view all by) ::: December 31, 2007, 04:29 PM:

Fragano, what beats the black hole?

#114 ::: Michael R. Bernstein ::: (view all by) ::: December 31, 2007, 04:32 PM:

xeger @ #97:

"I made the presumption, erroneously, perhaps, that the core language would include core libraries that were sufficient to many tasks."

I don't think that's an erroneous presumption, but 'many' != 'all'.

It sounds as though you're talking about the built in ConfigParser module, except I don't think it does nesting at all. There are other 3rd-party libraries available such as cfgparse, ConfigObj, and iniparse, as well as much more elaborate frameworks such as ZConfig, that are suitable for various configuration purposes. Some people want simplicity, others want features, and everyone wants *their* library included in the standard library. A single library can't satisfy everyone, and a standard library shouldn't (generally) contain competing implementations. Python is a 'batteries included' language, not a 'and the kitchen sink' language.

Meanwhile, piecing together your various statements on the problem, I'm now somewhat bemused at the idea of describing any multi-megabyte file as a 'configuration file', so I still think you may just have been trying to use the wrong tool for the job.

Since the $foo problem description is still incomplete, at this point I am no longer sure what the right tool would be, but I think we've established that using a built-in library intended for parsing simple configuration files isn't it. ;-)

#115 ::: Serge ::: (view all by) ::: December 31, 2007, 04:37 PM:

Mary Dell @ 109... I was getting my causality reversed.

?oot ytilausac ruoy ndA

#116 ::: Earl Cooley III ::: (view all by) ::: December 31, 2007, 04:38 PM:

Xopher #113: Fragano, what beats the black hole?

Entropy evaporates the black hole.

#117 ::: Michael R. Bernstein ::: (view all by) ::: December 31, 2007, 04:38 PM:

Xopher @ #113: A telepath, of course.

#118 ::: Joel Polowin ::: (view all by) ::: December 31, 2007, 04:53 PM:

Fragano @ 112: I thought it was a neutron star warping an engineer's wrench..?

#119 ::: xeger ::: (view all by) ::: December 31, 2007, 05:03 PM:

Michael R. Bernstein @ 114 ...
Meanwhile, piecing together your various statements on the problem, I'm now somewhat bemused at the idea of describing any multi-megabyte file as a 'configuration file', so I still think you may just have been trying to use the wrong tool for the job.

I do have the some of config files in question handy, still - the largest two are 6.0Mb and 1.7Mb respectively. I'm not about to claim that those aren't bloody huge (especially since they're plain text), but they're definitely what most people consider to be config files - files containing the rules that tell a program how to behave, and what to do, rather than data for the program to act on.

Since the $foo problem description is still incomplete, at this point I am no longer sure what the right tool would be, but I think we've established that using a built-in library intended for parsing simple configuration files isn't it. ;-)

Indeed :)

#120 ::: Christopher Davis ::: (view all by) ::: December 31, 2007, 05:06 PM:

Joel Polowin (#118): ah, the famous Star-Mangled Spanner.

#121 ::: Fragano Ledgister ::: (view all by) ::: December 31, 2007, 05:10 PM:

Xopher #113: The collapse of the entire universe back into the monobloc, of course.

#122 ::: Bruce Cohen (SpeakerToManagers) ::: (view all by) ::: December 31, 2007, 06:05 PM:

Cretaceous version:

Rock smashes dinosaur

#123 ::: P J Evans ::: (view all by) ::: December 31, 2007, 06:21 PM:

Dinosaur flattens mammal?

#124 ::: DaveL ::: (view all by) ::: December 31, 2007, 07:27 PM:

I actually rather love IDEs. Both Visual Studio and Eclipse are pleasant to use and eliminate a lot of drudgery. Emacs is in some respects an IDE (though rather an impoverished one without extra help). My recollection is that the Lisp Machine itself was an IDE grown to take over the whole OS.

Of course, one reason for liking IDEs is that they help implement the Sherlock Holmes theory of knowledge, which is to not remember things if they aren't immediately useful (I think he had a 256K brain). (Holmes famously told Watson he would endeavor to forget the heliocentric theory of the Solar System because it wasn't useful for him to know.)

So, having been doing this sort of thing since before RMS was RMS, and remembering the periodic messages on ITS ("New ITS, DDT, TECO, MIDAS, EMACS. --Bugs to RMS") I need all the memory help I can get...

And back on hijacked topic: Asteroid extincts dinosaur?

#125 ::: Xopher ::: (view all by) ::: December 31, 2007, 07:48 PM:

DaveL 124: I think the word you're looking for is 'extinguishes'.

#126 ::: Serge ::: (view all by) ::: December 31, 2007, 08:05 PM:

Asteroids and dinosaurs... Were they both in the attic?

#127 ::: Michael R. Bernstein ::: (view all by) ::: December 31, 2007, 08:07 PM:

Asteriod extinguishes Dinosaur

Dinosaur squishes (eats?) Mammal

Mammal diverts Asteroid?

#128 ::: Graydon ::: (view all by) ::: December 31, 2007, 08:39 PM:

Joel's paraphrase is, I believe, ultimately attributable to Generalfeldmarschall Helmuth Karl Bernhard Graf von Moltke the Elder. (One so seldom gets to provide a citation like that...)

XSLT is an XML programming language; I think it has a great deal to recommend it, though it's also about as functional a functional language as it is possible to be.

Oh, and dinosaurs necessarily devour mammals.

#129 ::: Fragano Ledgister ::: (view all by) ::: December 31, 2007, 09:23 PM:

Serge #126: I suspect that the dinosaur in the attic plays Asteroids.

#130 ::: Lexica ::: (view all by) ::: December 31, 2007, 10:33 PM:

ethan @ 110: This diagram has an alien.

#131 ::: ethan ::: (view all by) ::: December 31, 2007, 10:42 PM:

Lexica #130: Oh, I didn't realize we were talking about a specific alien!

I can't imagine Spock crushing scissors, though. Unless it's pon farr time.

#132 ::: Serge ::: (view all by) ::: December 31, 2007, 11:57 PM:

ethan... Did anybody say "pon farr"?

#133 ::: ethan ::: (view all by) ::: January 01, 2008, 12:24 AM:

Serge, if I were the type to do such a thing, I think I would re-edit that to make it into a dance routine to some kind of swanky music from the 50s.

Coincidentally, I'm currently taking a "first internet use of the new year" break from watching Star Trek: the Motion Picture, which I love, but I'm deeply disappointed to discover that my new DVD of it has redone CGI effects. Boo, redone CGI effects.

#134 ::: Lee ::: (view all by) ::: January 01, 2008, 01:39 AM:

Serge, #132: After that, you absolutely have to watch this one.

*still giggling hysterically*

#135 ::: ethan ::: (view all by) ::: January 01, 2008, 01:55 AM:

Lee, you owe me a new keyboard, a new pair of pants, and a new dignity.

#136 ::: Xopher ::: (view all by) ::: January 01, 2008, 11:50 AM:

Surely I can't be the only one who notices that the STTOS fight music is all Stravinsky ripoffs?

#137 ::: Serge ::: (view all by) ::: January 01, 2008, 11:55 AM:

Lee... Shouldn't that be called "paw'n fur"?

#138 ::: Serge ::: (view all by) ::: January 01, 2008, 11:59 AM:

Xopher... No, I didn't know that, but, heck, if you're going to rip something off, you'll rip off from the best.

#139 ::: Serge ::: (view all by) ::: January 01, 2008, 12:01 PM:

ethan @ 133... You mean, they did the same thing to that movie that George Lucas did to the original Star Wars?

#140 ::: Michael R. Bernstein ::: (view all by) ::: January 01, 2008, 01:22 PM:

Weaving together several strands of this thread (prehistory (or rocks) and trek) I present to you Stone Trek.

#141 ::: ethan ::: (view all by) ::: January 01, 2008, 02:19 PM:

Serge #139: They haven't done nearly that level of violence to the original, but essentially, yes.

#142 ::: Kevin Riggle ::: (view all by) ::: January 01, 2008, 04:09 PM:

Michael @140:

; syntax error. ITYM

(and (or prehistory rocks) Trek)

#143 ::: Kevin Riggle ::: (view all by) ::: January 01, 2008, 04:59 PM:

Where by syntax, I clearly meant semantic.

John A Arkansawyer @89: I don't think I've had enough exposure to the wider Perl community to be able to say that with any confidence. My limited experience agrees with Adrian @84 and Charlie @86.

#144 ::: Serge ::: (view all by) ::: January 01, 2008, 05:29 PM:

ethan @ 141... I'm not sure I'd call what George did to Star Wars as violence. I would call it a cheat though, with results not even as evocative as the original. An example? Compare the original's brief shot of a stormtrooper astride a reptilian beast to the new version's, where we are shown the beast actually walking away slowly.

#145 ::: ethan ::: (view all by) ::: January 01, 2008, 07:44 PM:

The new Star Wars editions are unwatchable to me. I strongly suspect that if I had seen them that way originally, they wouldn't have struck me as any better than The Bloody Boring Menace, Send in the Clones, and Revenge of the Shit.

If nothing else, it strikes me as horrifically offensive to the people who did the original effects. "You worked your asses off, did things no one had ever done before, created an entire industry out of nothing, and made some incredible effects, but that just wasn't good enough for me. I'm going to destroy all of that and replace your work with the world's shittiest video game." I was madder about it when Lucas was saying he was never going to allow the release of the original versions on DVD, because that would have effectively had the result of erasing these people's labors from history almost entirely. At least now they were available temporarily (and I snatched them up), but I'm still mad about it. And I'm not even all that passionate about Star Wars compared to a lot of people.

The Star Trek movie, which I care about more, didn't strike me as being quite so offensive in its redone form, but it's still a big step down from the way it originally was, and I really wish that people would just leave well enough alone. As far as I can tell, the original version is not currently available on DVD, but I'm going to keep my eye out for it.

#146 ::: TexAnne ::: (view all by) ::: January 01, 2008, 07:49 PM:

Serge, 144: Of course Lucas did violence to the real movie. Han shoots first, dammit!

#147 ::: Michael R. Bernstein ::: (view all by) ::: January 01, 2008, 08:10 PM:

Greedo was framed!

#148 ::: Dan T. ::: (view all by) ::: January 01, 2008, 08:25 PM:

If laziness is the root of creative solutions to problems, then how come Dr. Smith didn't solve all the problems of the group on Lost in Space, instead of regularly screwing things up for them (even when he wasn't intentionally scheming against them)?

#149 ::: Avram ::: (view all by) ::: January 01, 2008, 08:39 PM:

Dan T, Dr Smith was a secret agent in the employ of an unnamed foreign power, tasked with sabotaging the Jupiter 2's mission. That's why the ship went off-course in the first place.

#150 ::: Lee ::: (view all by) ::: January 01, 2008, 10:24 PM:

Ethan, #135: Then my work here is done. ;-)

Xopher, #136: It wouldn't surprise me a bit. How many people in our generation got their first exposure to classical music via Loony Tunes?

Serge, #137: No, I think it's "pwn3d fur".

#151 ::: Serge ::: (view all by) ::: January 01, 2008, 10:28 PM:

TexAnne @ 146... You're right. And I never understood why George thought he had to change things so that Han didn't shoot first.

#152 ::: Serge ::: (view all by) ::: January 01, 2008, 10:30 PM:

Lee @ 150... Its a good thing I don't have a digital camcorder otherwise I'd do a hamster version, which of course I'd title The Hamsters of Triskelion.

#153 ::: TexAnne ::: (view all by) ::: January 01, 2008, 11:28 PM:

Serge--Because he thought that Han had to be a Good Guy for the whole movie, instead of understanding that Han is the only character that changes. (Luke doesn't count. Kitchen boy to king isn't character development, it's a trope.)

#154 ::: Mary Dell ::: (view all by) ::: January 01, 2008, 11:50 PM:

Serge @#126:

Asteroids are birds.

#155 ::: Xopher ::: (view all by) ::: January 01, 2008, 11:59 PM:

TexAnne 153: Hmm, he does change, but I don't think that was why Lucas changed it. I think he was dumbing down for a stupider audience. That period in America really did show a general stupidity increase, if you think about it.

Look, Han shot Greedo first because it was the right thing to do. That scene showed that Han would do whatever it took to survive. That's an essential character point for him, and shows up to the good guys' advantage later.

#156 ::: Rob Rusick ::: (view all by) ::: January 02, 2008, 07:09 AM:

Another 'updated' visual effect that annoyed me: the expanding ring of light that was added to the Death Star explosion. It is a popular effect in anime explosions, which is why I think it had been worked into the movie.

My theory on where this motif comes from: film footage of the hydrogen bomb tests show a ring — I believe this is caused by condensation of water vapor by the shockwave of the explosion. All of the hydrogen bomb tests I know of were either over ocean or over small islands. I would expect there would be a layer of air directly over the water's surface that was relatively thick with water vapor. Hence a ring, when the shockwave forced condensation in this layer.

But what would form a ring like this in an explosion in space?

#157 ::: Bruce Cohen (SpeakerToManagers) ::: (view all by) ::: January 02, 2008, 09:22 AM:

Mary Dell @ 154

Asteroids are birds.

Of course, they're free-range Rocs.

#158 ::: Bruce Cohen (SpeakerToManagers) ::: (view all by) ::: January 02, 2008, 09:34 AM:

Rob Rusick @ 156

Not having had a lot of exposure to anime (probably just because I'm an old fart; my younger son and his wife love it, and have given us several CDs in attempts to educate us to the finer things), I first saw that ring in the movie Stargate. I remember first thinking, "Hmm, pretty high air pressure up there for there to be a visible shock ring", and then, "Oh, so this movie takes place in Flatland, where the shock can only expand in a plane. Did anyone talk to the explosives guy in the FX crew?"

There are probably some really contorted rationalizations for why the explosion might look like that*, but I'd rather just grumble about how in space nobody can hear you complain.


* How about: "It's not actually an explosion, but more like a large 4-dimensional rock being skipped over a hypersurface of compressible luminiferous ether." No, maybe not.

Choose:
Smaller type (our default)
Larger type
Even larger type, with serifs

Dire legal notice
Making Light copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017 by Patrick & Teresa Nielsen Hayden. All rights reserved.