elfs: (Default)
[personal profile] elfs
So, for the first time in about a year, I turned to writing some C this week and discovered to my annoyance than Noweb is broken in Emacs 22.0. It doesn't do code transitions or font locking anymore. This is actually very unacceptable; I must have code modes and font locking to switch between C and LaTeX as I work.

I went looking for alternatives, and there are none. Sadly, no new work in Literate Programming has been done in the psat two years. LP is being allowed to die on the vine, unused and unloved.

I really don't understand that. It's a great methodology for single programmers, and there are still a lot of us out there, doing our own little things, not bothering anyone. I'm really pissed off that noweb.el is borked, and I don't know nearly enough elisp to do anything about it.

Date: 2008-07-18 01:00 pm (UTC)
From: [identity profile] funos.livejournal.com
Do you think I'd be correct in surmising that this is because it is no longer considered shiny?

(eg: this is why I have an iPod, with all the uneccessary features, because I know it is the focus of attention, and thus will be well-supported by software.)

Date: 2008-07-18 01:08 pm (UTC)
From: [identity profile] elfs.livejournal.com
LP never had shiny. You might be thinking of XP (Extreme Programming), which is still very much alive and still the methodology of choice at Google. LP is old enough there are Don Knuth essays from the early 1980s about it, yet it never took off. As Knuth points out, LP asks you to be a good programmer and a good writer. Apparently, there aren't that many people out there who qualify.

Date: 2008-07-18 02:07 pm (UTC)
blaisepascal: (Default)
From: [personal profile] blaisepascal
I've read a number of Knuth's essays on LP, and I've read the CWEB book cover to cover a couple of times. My impression of Knuth's examples of LP is that it's amazing what, with the proper tools, you can accomplish with global variables and spaghetti code.

In all fairness, Knuth wrote what he wrote mostly in the day before OO became popular, and he's an educator. I think WEB attempts to do two things: It allows code reuse and structured organization in languages which don't do it well; and it provides a structure for documentation, which Knuth used to educate people about how his code worked.

Both of these can be good things, but most folks aren't interested in the second and changes in language technology have alleviated most of the problems with the first. As I mentioned, Knuth's code, probably the widest distributed examples of LP, isn't very well designed by modern standards. He uses opaque variable names, globals, nothing resembling an object, etc.

A minor point which made his code very hard to read to me was his typography (I understand the irony of complaining about Knuth's typography). As a mathematician, he prefers to read code as symbolic math, not as code. As such, CWEB's TeX output (the "Literate" part of "Literate Programming") translates C operators to mathematical symbols and plays font tricks with keywords, variables, etc. This makes it hard for me to actually read his C code, as I have to mentally translate it back to C code to understand it. To the degree it turns readable code into unreadable code, it's a failure in my opinion.

Date: 2008-07-18 07:30 pm (UTC)
From: [identity profile] elfs.livejournal.com
My experience writing LP is that one can write a clear and concise framework or library with a good API with LP just as well as with opacity and spaghetti. You can combine excellent OO design skills with adequate writing skills and produce meaningful documentation that serves the needs of both maintenance and end users. Dismissing LP because Knuth's style is tragically idiosyncratic isn't really all that fruitful.

Date: 2008-07-18 09:32 pm (UTC)
blaisepascal: (Default)
From: [personal profile] blaisepascal
I don't dismiss LP because Knuth's style is tragically idiosyncratic. Instead, I found the main source for information, the main body of examples using it, and the most well-publicized toolchain tragically idiosyncratic, which made trying to adopt it (for me) difficult and a failure.

Do you have any examples of LP tools and programs which demonstrate its successes, and not Knuth's idiosyncrasies?

Profile

elfs: (Default)
Elf Sternberg

May 2025

S M T W T F S
    123
45678910
111213141516 17
18192021222324
25262728293031

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 10th, 2025 04:17 pm
Powered by Dreamwidth Studios