2 ms·
Tools like xsd or T4 (in the .NET ecosystem) are great time-savers, but you would never consider directly modifying the code they generate. You would leave the
by slumdev 5y ago
Tools like xsd or T4 (in the .NET ecosystem) are great time-savers, but you would never consider directly modifying the code they generate. You would leave the generated code untouched (in case it ever needed to be generated again) and subclass it to make whatever changes you intend.
I think Copilot is so unfortunate because it's not building abstractions and expecting you to override parts of them. It's acting as an army of monkeys banging out Shakespeare on a typewriter. And the code it generates is going to require an army to maintain.
- hu3 5y agoLinq2Db is a great example of T4 code generation that works. It creates partial classes from database schema. Together with C# I have strongly typed database access. https://github.com/linq2db/linq2db https://github.com/linq2db/linq2db
- reader_mode 5y agoEven there I feel like code generators are just a band aid around the fact that metaprogramming facilities suck. If you would never modify the generated code why generate in the first place. You could argue that stack traces are easier to follow but TBH generated code is rarely pretty in that regard as well. For example I think F# idea of type providers > code generators.