Re:Apple Announces Full Swift Rewrite of the Foundation Fram...
by neonsunset on Wednesday January 11, 2023 @04:23PM
(#34345067)
All these are part of standard library.
Map is Select, Filter is Where, Reduce is Aggregate, etc. You can write C# in a functional style easily, it is one of the premiere features.
UI frameworks on the other hand…I feel your pain.
Re:Apple Announces Full Swift Rewrite of the Foundation Fram...
by kitsunesoba on Wednesday January 11, 2023 @04:31PM
(#34345194)
I did find and use Select and Where at least, but I recall running into caveats with them or with their interactions with other parts of the language that meant that they couldn't be used identically. I don't remember specifically what it was since it's been a while but I remember it being frustrating. I should probably find a cheat sheet of equivalents if I try writing it again.
Re:Apple Announces Full Swift Rewrite of the Foundation Fram...
by Jensson on Thursday January 12, 2023 @01:11AM
(#34349825)
The C# equivalents uses SQL naming, knowing this makes it much easier to understand.
Re:Apple Announces Full Swift Rewrite of the Foundation Fram...
by FlyingSnake on Wednesday January 11, 2023 @04:16PM
(#34344979)
> some of these don't have a 1:1 equivalent in C# which was a huge hit to productivity
This is interesting because all these magical functions (zip, map, Rx etc) have roots in LINQ which sprung from .Net world. I find it hard to believe that the battle tested CLR and C# doesn't have the equivalent functions.
Re:Apple Announces Full Swift Rewrite of the Foundation Fram...
by lmm on Wednesday January 11, 2023 @05:44PM
(#34346152)
> all these magical functions (zip, map, Rx etc) have roots in LINQ which sprung from .Net world
No they don't. They're essentially unchanged from ML back in the 1970s. The part that was new in C# was the SQL-like syntax on top of them, and most subsequent languages haven't considered that worth adopting.
And while it's tangential, Xaml drives me absolutely bonkers. It's like the worst parts of iOS Storyboards and Android Framework XML layouts except there's no escape hatch for those looking to build a UI in pure code (Android Framework is a bit of an offender here too, but Jetpack Compose looks to remedy that).