4 ms·
you couldn't make those data conform to an interface and have the algorithm work on the interface ? in those scenarios i usually either work with interfaces, o
by bsaul 3y ago
you couldn't make those data conform to an interface and have the algorithm work on the interface ?
in those scenarios i usually either work with interfaces, or composition (struct embedding), or as a final resort to codegen for things like generating bindings to database tables. the codegen is usually quite a good solution and makes debugging the generated code very straightforward, since it's all there, in the _generated folder, instead of in a temporary file generated by the compiler. it also makes the generator code a separate project, which IMHO is a better solution than using all kinds of macro and complex meta programmation directly in the final project.