"Geir Magnusson Jr." <[EMAIL PROTECTED]> writes:
> On 4/3/02 11:26 AM, "Daniel Rall" <[EMAIL PROTECTED]> wrote:
>
>> "Geir Magnusson Jr." <[EMAIL PROTECTED]> writes:
>>
>>> Oh, btw, icky comment style :)
>>
>> Hah! While we're on the subject, let me mention why I hate the use
>> block comments in implementations.
>>
>> When you're debugging, and want to comment out a large block of code
>> at once, the presence of pre-existing block comments inhibits your
>> ability to do so (they confuse the compiler).
>
> What compiler?
>
> I can do
>
> public class Comment
> {
> public Comment()
> {
> // /*
> // * I am a block comment
> // */
> }
> }
>
> And my compiler handles it just fine...
>
> Is that what you meant?
public static void main(String[] argv)
{
/*
*
* I am a big block comment!
*
*/
if (1 + 1 == 2)
{
System.out.println("hi");
System.out.println("bye");
}
System.out.println("---");
}
The above compiles fine inside a test class. Now say I wanted to debug:
public static void main(String[] argv)
{
/*
/*
*
* I am a big block comment!
*
*/
if (1 + 1 == 2)
{
System.out.println("hi");
System.out.println("bye");
}
*/
System.out.println("---");
}
dlr@despot:dlr$ javac test.java
test.java:19: illegal start of expression
*/
^
1 error
I can't nest the block comments. I can use XEmacs to insert a whole
list of line comments in front of existing code, but I prefer to use
block comments for debugging.
I guess there's just no accounting for taste. ;-)
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>