3 ms·
> I feel that recent "features" are more in the "things I can do with a preprocessor or a code generator" than real language enhancements. As someone that has
by afavour 3y ago
> I feel that recent "features" are more in the "things I can do with a preprocessor or a code generator" than real language enhancements.
As someone that has spent far too much time in JS world any time I’m able to ditch a preprocessor or code generator is a a great relief. I want my build processes to be as simple and straightforward as they can possibly be.
- Kuinox 3y agoC# 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.