Atomiqx Technologies Co.

architecture – What is boilerplate code?

Share This Post

Boilerplate code means a piece of code which can be used over and over again. On the other hand, anyone can say that it’s a piece of reusable code.

The term actually came from the steel industries.

For a little bit of history, according to Wikipedia:

In the 1890s, boilerplate was actually cast or stamped in metal ready for the printing press and distributed to newspapers around the United States. Until the 1950s, thousands of newspapers received and used this kind of boilerplate from the nation’s largest supplier, the Western Newspaper Union. Some companies also sent out press releases as boilerplate so that they had to be printed as written.

Now according to Wikipedia:

In object-oriented programs, classes are often provided with methods for getting and setting instance variables. The definitions of these methods can frequently be regarded as boilerplate. Although the code will vary from one class to another, it is sufficiently stereotypical in structure that it would be better generated automatically than written by hand. For example, in the following Java class representing a pet, almost all the code is boilerplate except for the declarations of Pet, name and owner:

public class Pet { private PetName name; private Person owner; public Pet(PetName name, Person owner) { this.name = name; this.owner = owner; } public PetName getName() { return name; } public void setName(PetName name) { this.name = name; } public Person getOwner() { return owner; } public void setOwner(Person owner) { this.owner = owner; } }

Source

Subscribe To Our Newsletter

Get updates and learn from the best

More To Explore

Tech Innovation – Blog

To discuss the benefits of telemedicine in healthcare, it is essential to understand what telemedicine is or how it is applied. Telemedicine is any medical

Access Denied

Access Denied You don’t have permission to access “http://www.weforum.org/stories/2021/06/4-technologies-accelerating-green-hydrogen-revolution/” on this server. Reference #18.52680117.1733119202.b9f333f7 https://errors.edgesuite.net/18.52680117.1733119202.b9f333f7 Source

Do You Want To Boost Your Business?

drop us a line and keep in touch

Discover more from Atomiqx Technologies Co.

Subscribe now to keep reading and get access to the full archive.

Continue reading