3 ms·
I stopped paying _a lot_ of attention to new C# features a few versions ago. While I like other syntaxes too (Python flexibility is really enjoyable), once my m
by luismedel 3y ago
I stopped paying _a lot_ of attention to new C# features a few versions ago. While I like other syntaxes too (Python flexibility is really enjoyable), once my mind switches to "C# mode" I don't miss any other thing from more dynamic languages, at all.
I feel that recent "features" are more in the "things I can do with a preprocessor or a code generator" than real language enhancements.
Of course, I can be (and I'm probably) extremely wrong, but I find that release pace exhausting and I see a lot of great software written without resorting to new "features".
- hardware2win 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. Well, you can hack a lot with code gen, but thats not the way, imo. But using your logic: are generics a feature? Since you could achieve almost identical results with code gen hacks
- luismedel 3y agoI didn't write that all additions to C# since 1.0 are useless. We have generics since .NET 2 (2005 IIRC) and at the time, the lang improvements had a reason to exist (framework support in some cases). At the time it was a nice thing to add, if you ask me. For me, the next big thing, if you ask, was LINQ. A few years later, I feel it's not the case with recent additions. But my comment is very subjective, of course. As I said, I can be very wrong. It's just that I find he lang "very complete", if that's a thing, since a few years.
- hardware2win 3y agoWell, is LINQ really a lang. feature? Extension methods are lang feature, LINQ is implemented with ext. Methods. You can argue that there is LINQ Query syntax instead of method chaining, but almost nobody is using this except for some specific cases (let keyword)
- ygra 3y agoLINQ to objects yes, but LINQ to SQL is a different beast where the C# code is translated to SQL. Expression trees are very much a language feature, I guess.
- hardware2win 3y agoFair, expression trees are really good But I thought they are implemented at library level, but now Im not sure
- 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.