3 ms·
C# preprocessor and code generator have nothing to do with JS build chains. The .NET build chain is relatively painless.
by Kuinox 3y ago
C# preprocessor and code generator have nothing to do with JS build chains.
The .NET build chain is relatively painless.
- pjc50 3y agoPeople very rarely rely on extra source code generation stages or preprocessors in C#. The Javascript ecosystem is dependent on them because Javascript is the only language that's a first class citizen in the browser. You can also do some pretty expressive things in C# with LINQ, expression trees, reflection, and so on. You can even emit IL at runtime if you really need to. https://learn.microsoft.com/en-us/dotnet/csharp/advanced-topics/expression-trees/ https://learn.microsoft.com/en-us/dotnet/csharp/advanced-top... The only C# generator I'm familiar with is for protobuf. I suppose the P/Invoke generators count too.
- Kuinox 3y ago> You can even emit IL at runtime if you really need to. I know, I already did that (generating mapping to industrial controllers from the config). > The only C# generator I'm familiar with is for protobuf. If you use .NET 6 you may use multiple source generator without knowing, it's very transparent. For example, if you use System.Text.Json you may be using code generation.