«

»

Print this Post

“What Language?” – For humans or For computers?

This entry is part 9 of 13 in the series The Cathedral and the Bazaar

The 9th part of The Cathedral and The Bazaar by Eric Raymond.

9. A Few More Lessons from Fetchmail

Before we go back to general software-engineering issues, there are a couple more specific lessons from the fetchmail experience to ponder. Nontechnical readers can safely skip this section.

The rc (control) file syntax includes optional ‘noise’ keywords that are entirely ignored by the parser. The English-like syntax they allow is considerably more readable than the traditional terse keyword-value pairs you get when you strip them all out.

These started out as a late-night experiment when I noticed how much the rc file declarations were beginning to resemble an imperative mini-language. (This is also why I changed the original popclient “server” keyword to “poll”).

It seemed to me that trying to make that imperative mini-language more like English might make it easier to use. Now, although I’m a convinced partisan of the “make it a language” school of design as exemplified by Emacs and HTML and many database engines, I am not normally a big fan of “English-like” syntaxes.

Traditionally programmers have tended to favor control syntaxes that are very precise and compact and have no redundancy at all. This is a cultural legacy from when computing resources were expensive, so parsing stages had to be as cheap and simple as possible. English, with about 50% redundancy, looked like a very inappropriate model then.

This is not my reason for normally avoiding English-like syntaxes; I mention it here only to demolish it. With cheap cycles and core, terseness should not be an end in itself. Nowadays it’s more important for a language to be convenient for humans than to be cheap for the computer.

There remain, however, good reasons to be wary. One is the complexity cost of the parsing stage—you don’t want to raise that to the point where it’s a significant source of bugs and user confusion in itself. Another is that trying to make a language syntax English-like often demands that the “English” it speaks be bent seriously out of shape, so much so that the superficial resemblance to natural language is as confusing as a traditional syntax would have been. (You see this bad effect in a lot of so-called “fourth generation” and commercial database-query languages.)

The fetchmail control syntax seems to avoid these problems because the language domain is extremely restricted. It’s nowhere near a general-purpose language; the things it says simply are not very complicated, so there’s little potential for confusion in moving mentally between a tiny subset of English and the actual control language. I think there may be a broader lesson here:

16. When your language is nowhere near Turing-complete, syntactic sugar can be your friend.

Another lesson is about security by obscurity. Some fetchmail users asked me to change the software to store passwords encrypted in the rc file, so snoopers wouldn’t be able to casually see them.

I didn’t do it, because this doesn’t actually add protection. Anyone who’s acquired permissions to read your rc file will be able to run fetchmail as you anyway—and if it’s your password they’re after, they’d be able to rip the necessary decoder out of the fetchmail code itself to get it.

All .fetchmailrc password encryption would have done is give a false sense of security to people who don’t think very hard. The general rule here is:

17. A security system is only as secure as its secret. Beware of pseudo-secrets.

(to be continued)

Click here to read the other parts of The Cathedral and The Bazaar

Series Navigation<< Listen to your users!Charming Developers to Make Great Software >>

Permanent link to this article: http://new-democrats.com/the-cathedral-and-the-bazaar-9/

Leave a Reply

Your email address will not be published. Required fields are marked *

Optimization WordPress Plugins & Solutions by W3 EDGE
%d bloggers like this:
Read more:
Japanese bullet train flopped in Taiwan – It is a white elephant!

While a debate is raging over viability of India's bullet train project which was inaugurated by Prime Minister Narendra Modi...

TCS recruitment scam

Tata Group boasts itself as "salt to software multinational", but has proved itself worse than small time conmen cheating innocent...

Close