Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!cs.utexas.edu!uunet!munnari.oz.au!cs.mu.oz.au!ok From: ok@cs.mu.oz.au (Richard O'Keefe) Newsgroups: comp.lang.c Subject: Re: This one bit me today Message-ID: <2534@munnari.oz.au> Date: 26 Oct 89 06:14:01 GMT References: <2651@hub.UUCP> <1989Oct23.160518.28851@utzoo.uucp> <1989Oct25.090616.19276@gdt.bath.ac.uk> Sender: news@cs.mu.oz.au Lines: 26 In article <1989Oct25.090616.19276@gdt.bath.ac.uk>, exspes@gdr.bath.ac.uk (P E Smee) writes: > If contents nest, then you can comment out blocks of your code > for various trial purposes, without having to worry about what's in the > block you comment out. This claim is false, as I pointed out before. If you comment out code containing strings containing comment delimiters, you're in trouble. (Yes, this bit me several times.) > I've known PL/1 programmers to avoid commenting > their code because (since PL/1 comments don't nest) it would inhibit this > handy testing trick. In that case you have known some PL/I (that's a Roman I not an Arabic 1) programmers who either were not masters of their language or who were using an incomplete implementation. PL/I has preprocessor facilities. To omit a block of code in PL/I, just put %IF '0'B THEN %DO; %END; around it. One more time: if you have a decent editor, and you have either PL/I-style /* */ or Pascal-style (* *) comments (but not { } comments), you can comment out regions and bring them back again WITHOUT needing nested comments as such. If anyone's interested, I'll post my code for it.