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.
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:
- Code generators can cause more work than they take off due to their error-proneness and inefficiency.
- Code generators create clutter, consume more resources, increase load times, and make it difficult to maintain or customize code.
- Code generators are not a learning tool and prevent you from improving your programming skills.
Because of these difficulties, one should use generators consciously. In case of doubt, it is usually better to write the code manually.