Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!tut.cis.ohio-state.edu!hsdndev!cmcl2!kramden.acf.nyu.edu!brnstnd From: brnstnd@kramden.acf.nyu.edu (Dan Bernstein) Newsgroups: comp.std.c Subject: Re: comment style Message-ID: <1050:Jan701:40:4791@kramden.acf.nyu.edu> Date: 7 Jan 91 01:40:47 GMT References: <1991Jan04.164355.15674@sco.COM> <613@caslon.cs.arizona.edu> Organization: IR Lines: 31 In article <613@caslon.cs.arizona.edu> dave@cs.arizona.edu (Dave P. Schaumann) writes: > I see no compelling reason to have //, and have heard > no argument for // that doesn't boil down to 'I like it that way better'. 1. // cannot be a substring of non-quoted C code that would be legal if the language didn't have comments. /* can. (This is just an obfuscated way of saying ``/* often produces errors because x/*p is legal.'') 2. // is shorter and easier to type than /* */. 3. // is more visually striking than /* ... */. 4. It is always obvious, to both human eye and mechanical parser, where a // comment ends (viz., the end of the line). It is not so trivial to locate the next */. 5. Placing // at the beginning of several lines is guaranteed to comment out the entire section. There is no easily applied rule for /*...*/. 6. An end-of-line comment mechanism can double as the line continuation mechanism, as in TeX. This is a beautifully simple way to kill two birds with one stone; it cuts the relevant sections of the standard in half. 7. There's always lots of fuss over matched comments as in C, while there's never a fuss over per-line comments as in the shells or TeX. There. Now you've heard several arguments for // that don't boil down to ``I like it that way better.'' You may not consider them compelling but you can't say they don't exist. ---Dan