Dart Syntax: Comments & How to write effectively

Dart Syntax: Comments & How to write effectively

ยท

1 min read

Comments is necessary in every programming language. Because of the comment we can write code more effectively and it also help to understand code easily to anyone. In short , Comments are fully ignored by complier.

Comment use for three ways.

  1. To give heading and description of code

  2. To mute unnecessary part of code without deletion

    Here, The syntax of the Comment

  3. documentation comment

     // this is single line comment  
    
     /* This is a   
        Multi-line comment  
     */
    
     /// This is Overridee function
    

Yes , there are three type of comments one is Single line and other is double line.

  • Mostly , Single line comment use for description of code

  • While ,Multi line comment use for mute unnecessary code of part or error part of code without removing it from original code

  • Triple line comment mostly use in hidden documentation of code and library

ย