James Robert Huggins Ngo

Boilerplate System v1.1

James Robert Huggins Ngo
2025-01-11

Background

My web development projects often include many third-party dependencies with large, unnecessary, non-customizable, unreliable, insecure, or hidden codes.

Boilerplate Code

According to Wikipedia, in computer programming, boilerplate code, or simply boilerplate, are sections of code that are repeated in multiple places with little to no variation.

Instead of using libraries and frameworks, we should create more boilerplate codes.

Boilerplate System

My boilerplate system revolves around simple, easy-to-use boilerplate codes.

Our boilerplate code should be short, simple, customizable, modular, and shareable, covering a specific function. It should encourage developers to learn its workings and customize it for their use cases.

Boilerplate Comments

Add a “BOILERPLATE” comment at the file’s top to indicate it’s part of the boilerplate system.

/* BOILERPLATE */

When using or extending boilerplate, include the original code’s permalink URL to trace its origin. When using a git repository, include the git tag or commit id to target a specific code version.

You can add multiple “BOILERPLATE” comments to link to a GitHub web page and its raw version, which aids automation.

/* BOILERPLATE: https://github.com/JamesRobertHugginsNgo/page-width/blob/1.0.4/src/style.css */
/* BOILERPLATE: https://github.com/JamesRobertHugginsNgo/page-width/raw/refs/tags/1.0.4/src/style.css */

Conclusion

Using boilerplate code instead of libraries and frameworks can create a more informed developer community and reduce code bloat.

Making boilerplate codes will encourage more intentional writing of reusable modules.