/*/ comment here
do some thing.
/*/
do some thing.
//*/
Why people write code like that? Is this a good practice?
It's usually only used when testing something out for the moment. That is, you should never commit code like that to version control, because it can be confusing.
For example, if you are testing two different computation methods, you can use this to switch between them. Personally I have rarely done this, if at all.
For those that don't know, you can toggle between the two code sections by adding one forward slash:
/*/ comment here
do some thing.
/*/
do some thing else.
//*/
//*/ comment here
do some thing.
/*/
do some thing else.
//*/
Crappy practice. Dead code has no business hanging around in any production quality code. If there really are situations where the old, dead code would apply, then it should be refactored into something that can be turned on/off using configuration not recompilation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With