I agree that code should look like
//function myFunc()
//{
// //echo "commented line";
// echo "uncomment line";
//}
|
Personally I find it difficult to read code like
//function myFunc()
//{
////echo "commented line";
//echo "uncomment line";
//}
|
This is because when i'm scrolling down a block of code, i'm looking for a break in the comments // so I know where that block of comments ends
dmitri wrote: |
It works this way by design.
If you need to commend a function that already has a few comments in it, please use multiline-coments /* */ |
Do you mean comment out the whole block with multiline comments /* ... */ or just our comments in the block...
Either way,
Why should I have to use multiline comments when all I want to do is comment out a little line. When im doing database work, depending on whether or not im local to the database depends on which line I use
$config['dbhost'] = '192.168.0.11';
//$config['dbhost'] = 'internal.mywebserver';
|
And like I said above, doing
/*
...
some code
...
$config['dbhost'] = '192.168.0.11';
//$config['dbhost'] = 'internal.mywebserver';
...
...
some more code
...
*/
|
would also be difficult to see where the commented out block begins and ends
There is only one place I use multiline comments, and that is at the start of a file, as a header
/*
Author: Postman Pat
Date: 01/02/2008
Fuction: This is the page for viewing all the stock we hold
Revision: v1.2
Revision Info: v1.1 - 08/02/2008
Postman Pat
Fixed a bug in the SQL
Revision Info: v1.2 - 08/02/2008
Bob the builder
Added new field for viewing purchase price of stock item
*/
start of code
|
What I find my self doing now is either adding/deleting the single line comments to the start of each line by hand, or cutting the code out, using a macro in TextPad to add/delete the // and then paste it back again
Atleast this way, I can read the code and it actually gets commented out correctly