Title
What is the meaning of Boilerplate Code in computer programming?
Introduction
I was reading about ASP.NET Scaffolding in a book and it describes the scaffolding as "Scaffolding is the process of generating boilerplate code based on your model classes." I thought for a while what this boilerplate code means. I have heard the term 'boilerplate code' several times but didn't know the actual meaning of it. 
So, I did a little Googling and tried to search for its meaning. I'm writing this article to share the same with all of you.
Question of the Day
Our lame question of the day is: What is the meaning of Boilerplate Code in computer programming?
Boilerplate Code
The term "boilerplate" originates from the printing industry in the early 1900s. It refers to a unit of text that can be re used again and again without any alteration. It is commonly used in product manuals, disclaimers, copyright statements, end-user license agreements and so on.
Eventually, the idea applied to programming as in "boilerplate code". Boilerplate code is defined as the sections of code that must be included in many places with little or no alteration. The boilerplate code refers to the repetitive code that doesn't really contribute to the logic of the program, but is required by the language or framework.
The most common example is the empty structure of an HTML page. It is present in nearly every web page and is considered boilerplate.
- <!DOCTYPE html>
- <html>
- <head>
- <title></title>
- </head>
- <body> </body>
- </html>
The boilerplate code indicates tedium and a violation of the "Don't Repeat Yourself" principle. When we write boilerplate code, we are actually repeating the same code again and again across the project. When that code needs to be changed, it's very difficult to remember all of the places where the code was written.
In C#, we use to declare normal properties in a class like this:
- class Student
- {
- private string _studentName;
- public string StudentName
- {
- get {return _studentName;}
- set {_studentName = value;}
- }
- }
- class Student
- {
- public string StudentName{ get; set; }
- }
Conclusion

Shweta SharmaPosted Jul 27, 2016, 8:13 AM
Nice artical Sahil Sharma sir . thanks for sharing your knowledge ..
Ibrahim RashidPosted Dec 19, 2014, 2:54 AM
Point must be noted from your articles,Sahil Sir..Nice One..
Rahul BansalPosted Dec 19, 2014, 12:36 AM
Good one Sahil
Manish Kumar ChoudharyPosted Dec 18, 2014, 11:22 PM
nice one Sahil Sharma sir..
Sam HobbsPosted Dec 18, 2014, 3:33 PM
Boilerplate refers more to the storing of something for use multiple times. Once it is used, it is no longer a boilerplate. For example, the HTML code you use as an example can be boilerplate code if it is saved someplace for use later. You might see the code alone being referred to as boilerplate but that is misleading.
Pankaj BajajPosted Dec 18, 2014, 11:07 AM
Thanks Sahil for sharing.