3 ms·
> Proper IEnumerable with proper iterators that in turn enables Linq Are you referring to generators? > Properties As far as I'm aware, it is a deliberate ch
by za3faran 10d ago
> Proper IEnumerable with proper iterators that in turn enables Linq
Are you referring to generators?
> Properties
As far as I'm aware, it is a deliberate choice not to implement them, and I can see their point of view.
> object initialisers
I believe the same justification applies here, it's mainly syntactic sugar, and can result in certain undesired behavior by bypassing constructors where validation can happen.
> extension methods
Typeclasses are currently being explored, which are a superior approach.
> named and optional arguments in functions
Those would be nice (at least named arguments). I can see how optional arguments could complicate things.
> generics over primitive types
As you mentioned, it's in the works
> async/await... verbiage could still probably be hidden behind a friendlier syntax
The approach they took does not need any extra syntax.
- troupo 10d ago> Are you referring to generators? Both I guess. Main thing is https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.ienumerable-1?view=net-10.0 https://learn.microsoft.com/en-us/dotnet/api/system.collecti... which seems to be everywhere in the language and the library. > I believe the same justification applies here, it's mainly syntactic sugar, and can result in certain undesired behavior by bypassing constructors where validation can happen. This is mostly due language design. Java heavily relies on properties and provides no facilities for them. Hence the builder pattern instead of object initializers. In C# object initializers synergize with properties: https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/object-and-collection-initializers https://learn.microsoft.com/en-us/dotnet/csharp/programming-... > The approach they took does not need any extra syntax. You mean it needs 15 lines whete C# needs one? ;)
- za3faran 10d ago> You mean it needs 15 lines whete C# needs one? ;) Can you elaborate? The async/await approach is much more than 1 line when you need to switch a call between them. Whereas the green thread approach does not need anything.