Every main programming language implements comments. Comments are ignored by the compiler and this is how a script generates it's own documentation. We know that Good code is self-documenting. We comment once we delete a chunk of code or to prevent rethink. If we build a library or framework, some sort of API documentation is very important to other developers for easy grasping. Remember to comment as often as possible. It’s important! Here is the list of comment styles of various languages_
-- Comment in Ada
// Single line comment in Action Script
/* Multi-line comment
in ActionScript */
-- Single line comment in Apple Script
(* Multi-line comment
in ActionScript *)
# Comment in Assembly Language
REM Comment in Basic
# Comment in Bash Script
// Comment in C#
/* Multi-line comment
in C# */
/* Comment in C. This comment syntax is guaranteed to work on every compiler */
// Comment in C. but it might present portability challenges
; Comment in Clojure
* Comment in Cobol
# Comment in CoffeScript
<!--- Comment in ColdFusion --->
/* Comment in CSS */
| Single Line Comment in Curl
|# Multi-line comment
in Curl #|
// Comment in D
/+ Multi-line comment
in D +/
// Single line comment in Delphi
{ Multi-line comment
in Delphi }
% Comment in Elixir
% Comment in Erlang
! Comment in Fortran
// Single line comment in Go
/* Multi-line comment
in Go */
-- Single line comment in Haskell
{- Multi-line comment
in Haskell -}
<!-- Comment in HTML-->
// Single line comment in Java
/* Multi-line comment
in Java */
/** Multi-line documentation comment
in Java */
// Comment in Javascript
/* Multi-line comment
in JavaScript */
// Comment in Kotlin
/* Multi-line comment
in Kotlin */
<!-- Comment in Lan -->
% Comment in LaTex
-- Single line comment in Lua
--[[Multi line comment
in Lua--]]
% Comment in Matlab
%{ Multi line comment
in Matlab %}
// Comment in Objective C
/* Multi-line comment
in Objective C */
{ Single line comment in Pascal }
{* Multi-line comment
in Pascal *}
# Comment in Perl
// Comment in PHP
# Single line comment in PowerShell
<# Multi-line comment
in PowerShell #>
# Comment in Python
""" Multi line comment
in Python """
# Single line comment in R
<# Multi-line comment
in R #>
# Comment in Ruby
// Single line comment in Rust
/* Multi-line comment
in Rust */
% Comment in S-Lang
// Single Line Comment in Scala
/* Multi line comment
in Scala */
-- Comment in SPARK
-- Comment in SQL
// Comment in Swift
/* Multi line comment
in Swift */
# Single line comment in TCL
<# Multi-line comment
in TCL #>
-- Comment in TSQL
/* Multi-line comment
in TSQL */
' Comment in VB
<!-- Comment in XML -->
No comments:
Post a Comment