13
Considering how important it is to comment on a code, I came up with this question.
I realized there are several ways to comment lines/parts of code:
//
/* */
#
Example:
// comentando uma linha
/* comentando
um intervalo
do código */
# comentando uma linha
Doubts:
- There are other ways to comment?
- Taking these definitions from the example, there are more differences between them?
Downvoter, how can I improve the question for you?
– rbz
Varies in language, in the
Delphi
for example block comet we use{}
. The differences you yourself have scored on your question.– Roberto de Campos
Good @Rbz, hadn’t stopped to think if there are differences between type comments
– Wees Smith
@Robertodecampos My main question is between
//
and#
... Is it not to "disturb" a break case? Example:\/n
... Hey, thanks a Wees!– rbz
OBS: I wasn’t the one who negatived it.
\\
,#
or between/**/
will be interpreted by the compiler unless it is within astring
. So\\/n
will change nothing in your code,#/n
neither.– Roberto de Campos
I think the "difference" is the source, // is c++ style; # is shell style, but that’s it.
– AlexCiuffa
I think the question is only about PHP, we don’t even have to talk about C or Delphi, also I don’t understand why downvotes, I see this question as an excellent way to help beginner programmers and make it all a great source of research.
– Guilherme Nascimento
To sql is used
--
– Patrick Santana