What is boilerplate code?

前端 未结 14 741
终归单人心
终归单人心 2020-12-04 04:41

A coworker had never heard of this, and I couldn\'t provide a real definition. For me, it\'s always been an instance of \'I-know-it-when-I-see-it\'.

Bonus question,

14条回答
  •  囚心锁ツ
    2020-12-04 04:59

    In a nutshell, boilerplate codes are repetitive codes required to be included in the application with little to no change by the program/framework, and contribute nothing to the logic of the application. When you write pseudo codes you can remove boilerplate codes. The recommendation is to use a proper Editor that generates boilerplate codes.

    in HTML, the boilerplate codes in the interface.

       
       
          
             
          
           
    
    

    in C#, The boilerplate codes of properties.

    class Price
    {   
      private string _price;   
      public string Price
      {   
         get {return _price;}   
         set {_price= value;}   
      }   
    }  
    

提交回复
热议问题