i'll never understand what issue people have with code generation if the code is properly formatted. no runtime magic to debug. it's all there to read, which is a damn nice feature imho.

Follow

@bonifartius the code you generated is harder to read than whatever it was generated from, unless you are just wasting your time with the whole thing, so you are essentially requiring the knowledge of your DSL, especially from people who don't just want to painstakingly reverse engineer your project, but actually comfortably learn and contribute to it. That is, once you have it, you will go haywire with it, generating ton of hard to read and understand code, otherwise, if you just wanted it for one small thing, there is no point in doing it in the first place.

With this requirement in mind, you also introduce a new dependency to set up and maintain, a new build step to integrate. Especially for large projects if your generator is not careful about, what files it reads and especially writes to it can be a huge pain to deal with.

It also indicates that original language of choice was not expressive enough for the task at hand, since it by itself is conceptually the same as a code generator. In theory instead of making a code generator for your code generator, you should just improve your code generator or use a better suited code generator. If you need to write a part of C project in python, use language bindings instead of reinventing wheels.

Then there are things like Qt meta object compiler, which solves problems nobody needed solved and breaks standard language conventions, the kind of nuances that are beyond just code formatting and can have various annoying side effects.

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.