You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This would be a breaking change to the Sphere Runtime and so couldn't happen until 6.0. It might be nice though to use the idiomatic JavaScript names for the common operations (filter, map, flatMap, etc.) instead of the LINQ names, to lower the learning curve for people already familiar with the usual array operations.
The text was updated successfully, but these errors were encountered:
I experimented with using the JS names, but I didn't like it; it made chains look really weird. The LINQ names read back much more naturally when linked in a chain:
// from someArray, where 'n is even', select 'n squared', aggregate using additionletsumOfEvenSquares=from(someArray).where(n=>n%2===0).select(n=>n**2).aggregate((a,n)=>a+n);// how even do we read this?// from someArray, filtered by 'n is even', map to 'n squared', reduce to addition// ...yeah, that's understandable (eventually) but doesn't really flow wellletsumOfEvenSquares=from(someArray).filter(n=>n%2===0).map(n=>n**2).reduce((a,n)=>a+n);
Long story short, I decided to keep the LINQ names and renamed the few that weren't consistent. The only change I ultimately made to LINQ nomenclature was to call SelectMany, over instead. I always found SelectMany, while obvious as far as what it does, to break the natural narrative flow of a LINQ method chain. Plus it doesn't necessarily have to choose more than one item anyway, so it's a bit misleading too.
This would be a breaking change to the Sphere Runtime and so couldn't happen until 6.0. It might be nice though to use the idiomatic JavaScript names for the common operations (filter, map, flatMap, etc.) instead of the LINQ names, to lower the learning curve for people already familiar with the usual array operations.
The text was updated successfully, but these errors were encountered: