Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site rtech.ARPA Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxt!houxm!vax135!cornell!uw-beaver!tektronix!hplabs!amdahl!rtech!daveb From: daveb@rtech.ARPA (Dave Brower) Newsgroups: net.lang.c Subject: Re: C Indentation, Pretty Printing Message-ID: <325@rtech.ARPA> Date: Sat, 27-Apr-85 10:36:24 EDT Article-I.D.: rtech.325 Posted: Sat Apr 27 10:36:24 1985 Date-Received: Wed, 1-May-85 03:26:45 EDT References: <9930@brl-tgr.ARPA> <381@busch.UUCP> <5497@utzoo.UUCP> <350@gumby.UUCP> <5521@utzoo.UUCP> <904@ucbtopaz.CC.Berkeley.ARPA> Organization: Relational Technology, Berkeley CA Lines: 31 > read. The AI community found the solution to the problem of different > code formatting styles two (or more?) decades ago: customizable pretty > printers (beautifiers, if you must). You read your code into the editor, > notice that the format is "ugly", and tell the editor to format it the > way you like it. The next person to come along goes through the same > process. For an organization, you prepare a "standard" setting for the > pretty printer hooks, and the code goes into that format when you check > it into *cs. Everybody is happy, as they can work on the code in their > favorite format (or non-format, if that's the case), and all the > organizational listing look alike. What more could you want? Of course, it's easier when your formatting lisp :-). I've yet to see a C pretty printer that would work acceptably for this purpose. The major problem I see with all the existing ones is: o Stability. If you feed it beautified code, does it come out IDENTICALLY? If not, you are in deep trouble. Why? Because your CM will be driven crazy with thousands of `insignificant' diffs, obscuring the real changes that may have been made to a file. A big help would be a syntax directed diff that would really know when something `real' changed. Would a tokenizing diff be an acceptable subsitute? I'm not sure. Can someone send me one to try :-)? Oh, and it needs to be plug-compatable with RCS... -dB -- {amdahl, sun}!rtech!daveb | "Why do we have to live in boxes? I hate {ucbvax,decvax}!mtxinu!rtech!daveb | boxes." "Calm down, the 60's are over."