Why is '//' style multiline comment bad (in Java)?

前端 未结 8 1695
甜味超标
甜味超标 2021-02-05 07:15

http://java.sun.com/docs/codeconv/html/CodeConventions.doc4.html#286

I was reading the above section of Java coding convention and started to wonder why it says \"// com

8条回答
  •  死守一世寂寞
    2021-02-05 07:52

    It makes modifying and formatting long comments extremely painful.

    Most editors provide some sort of wrapping facility to automatically wrap text into lines of readable length. If every line starts with a '//' those will get moved around, then have to be deleted, and new ones re-inserted. All that tedious work can be avoided using '/* */ style comments.

提交回复
热议问题