Skip to content

What are the benefits of autogenerating source code?

iks github user edited this page Apr 22, 2015 · 4 revisions

There is only one final purpose of code autogeneration: speeding up software development. To gain this final benefit, two aspects are important to have in mind:

a) The benefit increases with the amount of “parallel functionality”. If a specific design concept is used again and again, parallel functionality exists, for instance, a number of modules or components with a similar internal structure to be embedded in a similar environment. The higher the number of components (repetitions of the parallel functionality) and the higher the complexity of the parallel functionality, the higher is the benefit of autogeneration. In case of low complexity (let’s say, only a few lines in one file are needed to be generated), the number of repetitions must be very high to benefit from autogeneration. In case of high complexity (many lines in many different files) the benefit starts at least with the third “parallel component” (the second repetition). If you foresee sufficient complexity and repetitions of parallel functionality, start using autogenerating as soon as possible.

b) There are three proximate benefits that contribute to the final one:

I) Reduction of non-creative coding effort.

Given some minutes to write, extend or modify a existing model and existing templates, you generate the code within seconds. In contrast, the manual typing of the code may cost hours of development time even if the programmer(s) exactly know where to create which code.

II) Reduction of costs for fixing stupid bugs.

Typically, there are three types of stupid errors caused by programming parallel functionality manually. 1. copy-paste-errors, 2. misspelled expressions and 3. forgotten source locations where an adaptation is necessary. Cost of bug fixings can increase the coding effort dramatically and fixing stupid errors decreases the motivation of the most developers. In contrast, learning to control an autogeneration tool is fun for many developers.

III) Documentation of “How to” knowledge

Have you ever heard a statement like “Source code is the best documentation”. This may be true for clean code in its best appearance. However, source code is frequently the only documentation. Now imagine a team of developers which has designed and implemented a complex system. The team members change and after a while the knowledge how to set up a new module in the system fades away. Familiar situation? Given the system is developed by the MOGLi Code Creator, a developer simply studies the templates for the artefacts generated by the generator plugins and the knowledge where to create which code is quickly available.

[Back] (https://github.com/iks-github/MOGLiCodeCreator/wiki)

Clone this wiki locally