In the last week, I’ve seen an uptick in ‘AI is good for boilerplate’ posts.
-
@jscholes I think it is both? LLMs are good at translating. You can tell them „look at this function and struct, now make a vector cross product function that works with the datatypes you just saw.“ and it will work well. Replace cross product with some other not-too-complex function that the LLM has seen in a different language and/or with different datatypes. It will be able to „translate“ the structure of the code into the new requirements.
-
In the last week, I’ve seen an uptick in ‘AI is good for boilerplate’ posts. It is 2026. Metaprogramming is over 50 years old. Why are we writing boilerplate at all, much less creating expensive tools that let us write more of it faster?
@david_chisnall I love metaprogramming but you may as well ask why we even still have to write code at all in 2026, given that surely every problem in the field of computer programming has already been solved decades ago
-
@dimpase I would disagree. Make and CMake are two very different beasts. They function very differently, so I would say that there is not much translation. Instead you have to have a deep understanding of what’s happening in the Makefile. And LLMs can’t do that. What they CAN do pretty well is translate patterns from one language (human or programming) into another. Not flawless, but surprisingly good at times. As soon as deeper understanding comes into play, they break horribly.
-
In the last week, I’ve seen an uptick in ‘AI is good for boilerplate’ posts. It is 2026. Metaprogramming is over 50 years old. Why are we writing boilerplate at all, much less creating expensive tools that let us write more of it faster?
@david_chisnall I got this argument two years ago from various colleagues, as "look, LLM is very good at generating boilerplate for front-end tests, back-end api functions...".
my immediate reply was *why do we need those boilerplates? why don't we create an abstraction layer that does all of those and call that every time we need it?*
they usually just answered with dismissal and vaguely explaining it would be too much work - so instead of reducing complexity, we added more via "AI" agents 🫠 -
@david_chisnall I love metaprogramming but you may as well ask why we even still have to write code at all in 2026, given that surely every problem in the field of computer programming has already been solved decades ago
I write new code to solve new problems. I write boilerplate to solve the same problem in a different place. I have no problem with the former.
-
In the last week, I’ve seen an uptick in ‘AI is good for boilerplate’ posts. It is 2026. Metaprogramming is over 50 years old. Why are we writing boilerplate at all, much less creating expensive tools that let us write more of it faster?
@david_chisnall I agree with you, but I wonder if metaprogramming deserves more attention from programming language designers than it’s been getting. A couple of years ago my colleagues and I used Scala’s new and improved macro system to write a library that generated validating newtypes for arbitrary types. We wanted constants to be validated at compile time, so it was impossible to construct an invalid instance. This was surprisingly hard (but possible) to implement. Maybe widespread use of LLMs for boilerplate could motivate language designers to design more powerful, more ergonomic macro systems?
-
@david_chisnall From time to time, I use it to reduce boilerplate. I don't respect, say, bash enough to truly desire to learn more about it. Enough has been said about their limitations elsewhere. I have better things to do than code-golfing bash, but I want the result - my bash to be terse.
Never point LLMs at things you love. I don't love nix the language or C++17 and I never will
@the_art_of_giving_up you may nevertheless be interested in https://mywiki.wooledge.org/BashPitfalls

-
@david_chisnall I agree with you, but I wonder if metaprogramming deserves more attention from programming language designers than it’s been getting. A couple of years ago my colleagues and I used Scala’s new and improved macro system to write a library that generated validating newtypes for arbitrary types. We wanted constants to be validated at compile time, so it was impossible to construct an invalid instance. This was surprisingly hard (but possible) to implement. Maybe widespread use of LLMs for boilerplate could motivate language designers to design more powerful, more ergonomic macro systems?
I think it's worth separating compile-time and run-time metaprogramming. Smalltalk and Lisp did a lot with the latter to remove boilerplate. Higher-order abstractions that let you just write code for the things where you're deviating from some template are very easy in these languages. Python inherits this ability, but it seems to be used a bit less. JavaScript also inherits it and uses it even less.
Compile-time metaprogramming features are often less flexible but have two additional benefits: better performance (code specialisation at compile time, versus additional dynamic dispatch indirection at run time) and the opportunity to do better error reporting. The latter is the killer feature for me of C++ and Rust over C in systems programming: I can write APIs that will fail to compile if you use them wrongly. That's incredibly valuable, but it doesn't necessarily reduce the amount of code that you need to write.
Features like key-value coding and key-value observing in Objective-C didn't do anything at compile time but massively reduced the amount of code that you needed for GUI apps by allowing the frameworks to ship 100% generic controller classes that just needed to be parameterised on key names.
-
I think it's worth separating compile-time and run-time metaprogramming. Smalltalk and Lisp did a lot with the latter to remove boilerplate. Higher-order abstractions that let you just write code for the things where you're deviating from some template are very easy in these languages. Python inherits this ability, but it seems to be used a bit less. JavaScript also inherits it and uses it even less.
Compile-time metaprogramming features are often less flexible but have two additional benefits: better performance (code specialisation at compile time, versus additional dynamic dispatch indirection at run time) and the opportunity to do better error reporting. The latter is the killer feature for me of C++ and Rust over C in systems programming: I can write APIs that will fail to compile if you use them wrongly. That's incredibly valuable, but it doesn't necessarily reduce the amount of code that you need to write.
Features like key-value coding and key-value observing in Objective-C didn't do anything at compile time but massively reduced the amount of code that you needed for GUI apps by allowing the frameworks to ship 100% generic controller classes that just needed to be parameterised on key names.
@david_chisnall “it doesn't necessarily reduce the amount of code that you need to write” but I’ll happily write more code to make it less likely that I’ll get woken up in the middle of the night to deal with an incident in production.
-
In the last week, I’ve seen an uptick in ‘AI is good for boilerplate’ posts. It is 2026. Metaprogramming is over 50 years old. Why are we writing boilerplate at all, much less creating expensive tools that let us write more of it faster?
@david_chisnall @simon because you see if we had people with expertise in metaprogramming they would demand to be paid like experts and it’s much easier to have some opex to a third party than to have expensive humans do the work. Bonus if labour costs lessen as a result.
-
In the last week, I’ve seen an uptick in ‘AI is good for boilerplate’ posts. It is 2026. Metaprogramming is over 50 years old. Why are we writing boilerplate at all, much less creating expensive tools that let us write more of it faster?
@david_chisnall because quite often the source of boilerplate isn't mine, e.g. terraform or fitting into an existing project. I wish my life was just the interesting parts!
-
@david_chisnall I got this argument two years ago from various colleagues, as "look, LLM is very good at generating boilerplate for front-end tests, back-end api functions...".
my immediate reply was *why do we need those boilerplates? why don't we create an abstraction layer that does all of those and call that every time we need it?*
they usually just answered with dismissal and vaguely explaining it would be too much work - so instead of reducing complexity, we added more via "AI" agents 🫠@pcdevil
In any working group there will be more stupid than sense.This only matters when stupid doesn't recognise sense, but unfortunately GenAI somehow evokes that failure in stupid. I've given up trying to explain and could spend days writing up all the reasons why using GenAI based on LLMs to create software for actual use is almost always a bad thing. But it wouldn't make any difference.
@david_chisnall -
@pcdevil
In any working group there will be more stupid than sense.This only matters when stupid doesn't recognise sense, but unfortunately GenAI somehow evokes that failure in stupid. I've given up trying to explain and could spend days writing up all the reasons why using GenAI based on LLMs to create software for actual use is almost always a bad thing. But it wouldn't make any difference.
@david_chisnall@markhughes @david_chisnall I agree with you, but to be fair it was around the time when people just started using LLMs and code agents (or at least started around me), so I was in the impression that - as with other technologies - my peers will weigh the pros&cons and my opinion will matter on the subject.
since then I know that's not the case and I just quietly do my work without "AI", and snarkly smile when a stupid implementation turn out to be an LLM output without review by the author 🫠
-
@david_chisnall @simon because you see if we had people with expertise in metaprogramming they would demand to be paid like experts and it’s much easier to have some opex to a third party than to have expensive humans do the work. Bonus if labour costs lessen as a result.
The thing is, most of these projects are using some framework. And so the number of people who need to have that expertise is quite small: it's the folks who write the framework. But very few popular frameworks seem to put much effort into this.