Differences between commenting with # and //


I'm doing a project in laravel and would like to know the appropriate use of commenting with

1. # 


 2. //

I appreciate your help

asked by Sebastian Castiblanco Anduquía 11.10.2018 в 22:53

1 answer


To make comments you have the following options, I also do   the clarification that this that I show you does not have to see directly   with the Laravel framework if not rather with the language with which   is written below that is PHP

We can see that this style of comment is inherited from C where you will continue to ignore code until you find the following sign */


useful for commenting complete blocks of code where you need it to be   ignored a certain amount of code for example where   find functions or complete classes of code

Multi-line comment

   $name1 = "hola";
   $name2 = "hi";

Single line comment

This style of comments is inherited from C ++ of a single line and is observed more commonly to comment single lines of code inside scripts or files that for example in this case end in extension .php

//$name1 = "Hola";

Comment a single line of code with #

This type of comments is more like commenting on code from the console / terminal / cmd and also only serves to comment on a single line of code

#$name1 = "Hola";
answered by 11.10.2018 / 23:02