by en4bz · 4y ago · 0 comments
If you have genuine data transformation tasks then I think ranges make a lot of sense. The kind of things that would be a 1-liner in Unix command line:
cat foo.txt | grep "bar" | cut -d "," -f 3 | sort | unique | wc -l
This can be expressed really nicely with ranges in a way that wasn't possible, or at least readable, before. If you want to use ranges to reimplement coroutines then of course it will be slow and ugly.As usual with new features, they shouldn't be used everywhere, even if they could. I do agree with the complaints on the massive size though - I feel it could be implemented quite simply if they only wanted 80% of the features.