3 ms·
> Also IMHO code generation should be a last-resort anti-pattern; after all that's what you (the programmer with a brain) are for. Code generation should be th
by thecupisblue 5y ago
> Also IMHO code generation should be a last-resort anti-pattern; after all that's what you (the programmer with a brain) are for.
Code generation should be the "first-resort" pattern.
When talking code generation, it enforces you to think about your data model, your flow, patterns, usability, readability.
It is perfect to build repetitive boilerplate you can type on your own without thinking, so instead of taking up 10 minutes fighting input/UX bandwith of your hands and tools, you can generate huge chunks of code you would have to write anyways (and possibly make a mistake).
- ltbarcly3 5y agoYou should not have repetitive boilerplate at all, and if your speed of programming is limited by how fast you can type you are writing some really bad code without understanding high level programming at all.
- auxym 5y agoWhat about things like protobufs?
- thecupisblue 5y agoRepetitive boilerplate isn't just "wrapper spaghetti code". Repetitive boilerplate is what builds systems. If I can make a model that has 50 lines and will generate 50 different classes, 50 files and 600 methods where I only need to fill out the expressions, that is writing code. If I am going to say how it's all boilerplate and write it by hand, chances are I will have something nobody else will understand with bugs I cant remember or will have to rewrite the above by hand into a boiler-plate-like way again, which to me, makes no sense to do manually.