Path: utzoo!utgpu!attcan!uunet!yale!husc6!think!barmar From: barmar@think.COM (Barry Margolin) Newsgroups: comp.lang.c Subject: Re: Efficiency AND Readability Message-ID: <30601@think.UUCP> Date: 7 Nov 88 18:41:37 GMT References: <141@twwells.uucp> <3386@geaclib.UUCP> Sender: news@think.UUCP Reply-To: barmar@kulla.think.com.UUCP (Barry Margolin) Organization: Thinking Machines Corporation, Cambridge MA, USA Lines: 30 In article <3386@geaclib.UUCP> daveb@geaclib.UUCP (David Collier-Brown) writes: > A good counter-example to the claim that efficient code is >unreadable (and also the claim that its non-portable) exists in the >TeX typesetting implementation. First, a disclaimer: I've never found WEB programs very understandable, and the coding style it appears to promote is not very good (there's LOTS of global variables). More to the point, though, is that I think you are talking about a different kind of readability than what WEB addresses. WEB attempts to make the program layout more readable, by using fonts to highlight things like comments, and by loosening the restrictions on the order in which program elements must appear, so that the text can follow the design better. However, the kind of readability being pitted against efficiency is at a lower level. For example, if 'a>>b' is used in C as an efficient way to divide a positive number by 2**b, it will be just as confusing in WEB. WEB doesn't have any magic way to make confusing statements or algorithms less confusing. It does promote more thorough commenting, but that doesn't guarantee anything; we've been asking people to comment vigorously for years (and I admit that I'm guilty of commenting less than I should). Barry Margolin Thinking Machines Corp. barmar@think.com {uunet,harvard}!think!barmar