Is this a good practice? "/*/something/*/something//*/"

c, c++, coding-style, comments, java

Solution

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.
//*/

Problem

``` /*/ comment here do some thing. /*/ do some thing. //*/ ``` Why people write code like that? Is this a good practice?

Original source