3 ms·
I did not know C# had this. That’s cool. I admit I see only a little of the C# that others at our company do. But I have used the similar feature in Python for
by travisgriggs 4y ago
I did not know C# had this. That’s cool. I admit I see only a little of the C# that others at our company do.
But I have used the similar feature in Python for years. And I love it.
Is it just me, or are a lot of these languages starting to all feel a lot like each other?
- StellarScience 4y agoThis is indeed an amazing feature, and good languages copy ideas from each other. I believe C# has had this for years. C++ just got it with C++20 coroutines, though it still takes some work to use since std::generator didn't make it into C++20. Lest folks think this is a new feature, it was invented by Barbara Liskov in her CLU language, as explained in this 1977 paper: https://web.eecs.umich.edu/~weimerw/2011-6610/reading/liskov-clu-abstraction.pdf https://web.eecs.umich.edu/~weimerw/2011-6610/reading/liskov... (PDF, see section 4.2.)
- m1el 4y agoCross-pollination of ideas is a good thing. The only problem, what if your language adopts an idea which prevents you from having a better API? As far as I know, coroutine/generator doesn't prevent you from doing anything.
- tokamak-teapot 4y agoI enjoy learning enough of novel (to me) languages so that I can do some fun stuff. Usually when I look at a language One of the first things I do is look for familiarity: How to map, filter and reduce - and how to work with collections and lazy enumerables, whatever they may be called - IEnumerable, generator, Stream, etc. It’s amazing how similar many popular languages are these days, at least in terms of developer experience. This doesn’t mean they are trivially interchangeable of course. You can’t write Elixir in an idiomatic C# style and you shouldn’t try to!
- int_19h 4y agoIn case of C# and Python specifically, there's been quite a bit of cross-pollination. And now designers of both languages work at the same company...