> ## Content Index
> Fetch the complete content index at: https://nolongerset.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# The Problems with Boilerplate Code
- URL: https://nolongerset.com/boilerplate-code-problems/
- Published: 2022-10-13T02:24:25.000Z
- Updated: 2026-05-08T12:54:10.000Z
- Description: Copy. Paste. Modify. Repeat. Writing and maintaining boilerplate code is a necessary evil in VBA.
- Author: Mike Wolfe
- Tags: Commentary, #Import 2026-05-20 02:59

Being an older programming language, VBA lacks some modern features, such as [generic objects](https://nolongerset.com/generic-objects-in-twinbasic/) and [first-class functions](https://en.wikipedia.org/wiki/First-class%5Ffunction).

The fact that these features are missing from the language does not make VBA any less capable than other languages. VBA is [Turing-complete](https://en.wikipedia.org/wiki/Turing%5Fcompleteness), after all.

Rather, these "missing" features often manifest themselves in the form of additional [boilerplate code](https://en.wikipedia.org/wiki/Boilerplate%5Fcode) that may not otherwise be necessary in other languages.

There's nothing wrong with boilerplate code *per se*. However, it does have some drawbacks:

- Writing boilerplate code is **tedious**
- More code equals **more opportunities for bugs**
- Paradoxically, you're **more likely to make silly mistakes** when performing mindless tasks (like copy-pasting-modifying boilerplate code) than when your mind is fully engaged in a complex programming challenge
- **Refactoring** boilerplate code is a fraught endeavor, as the refactoring exercise suffers from all three of the above disadvantages but does so **at scale**

If only there were [a way to produce boilerplate code](https://nolongerset.com/upsertstandardmodule/) that did not suffer from these downsides...

### Referenced articles

[Writing Boilerplate Code by Hand is for SuckersWriting repetitive code may be a necessary evil in VBA, but it’s a lot less tedious if you generate most of it in VBA itself.![](https://nolongerset.com/favicon.png)No Longer SetMike Wolfe![](https://storage.ghost.io/c/eb/d7/ebd732c1-5f03-4f07-b386-5d08557e15c9/content/images/2022/10/farmer-walks-2141197_1920.jpg)](https://nolongerset.com/upsertstandardmodule/)

*Image by [Bruno /Germany](https://pixabay.com/users/bru-no-1161770/?utm%5Fsource=link-attribution&utm%5Fmedium=referral&utm%5Fcampaign=image&utm%5Fcontent=3665281) from [Pixabay](https://pixabay.com//?utm%5Fsource=link-attribution&utm%5Fmedium=referral&utm%5Fcampaign=image&utm%5Fcontent=3665281)*

***UPDATE*** *\[2022-10-17\]: Add links to article "Writing Boilerplate Code by Hand is for Suckers."*