Lucas Brenner » Articles » Code Generators Are Harmful

Code generators are designed to take work off your hands and simplify processes. Website builders, script programs and SVG generators are just a few examples.

People who can't code can save money with these tools. Generators that compress or validate code are helpful even for programmers.

However, one should be aware of the disadvantages of these methods. It is better to use a minimalist design and avoid generators than to slow down a website with a complex design.

Code Generators Can Cause More Work

I have made the experience that especially website builders can cause more work than they take away. Generators still cannot program as stringently as humans - especially poorly optimized generators use many external libraries and unnecessary steps.

This increases the vulnerability to errors enormously. Therefore, generators should be avoided as far as possible and solutions tailored to the specific problem should be found instead.

Code Generators Create Clutter

The libraries and intermediate steps of the generators create a lot of clutter. Functions that could actually be realized with just a few lines of code are bloated.

Websites are a good example here as well. Especially when animations are programmed that go beyond HTML, code generators often create vast amounts of JavaScript files and code snippets. This clutter increases load times, error-proneness, consumes more resources, and makes maintenance by programmers impossible.

You have to rely almost entirely on the generator. If its functionality changes, you probably have to regenerate the entire project. Some generators use different file names for each export, so you are forced to do a complete re-export even for small changes.

Code Generators Don't Help Learning

The two previous problems are the biggest challenges, but still, it should not go unmentioned that you learn nothing from code generators.

When you program your projects yourself, you grow with problems and keep learning. Generators deny this progress, because they only spit out a “solution,” which is usually not even optimal.

So, if you want to learn programming, you should avoid generators and program manually instead.

Code generators can be useful in some application areas, such as code compression or validation. However, they have three problems:

Because of these difficulties, one should use generators consciously. In case of doubt, it is usually better to write the code manually.