Re:C++ has become a scripting language
by JanneVee on Wednesday October 16, 2013 @05:16PM
(#6562206)
Yeah, it is not a scripting language for processing lines. Although the line nonsense has a benefit though it could be adapted to parse out records and by overloading the less than operator to sort on a specific column. But then you would might use AWK instead.
It's funny, had the author tweaked the problem just slightly to try make C++ look good by saying that the program should output sorted words instead of lines, you could have deleted the entire Line nonsense. Had the problem been to output sorted, unique words, you could have made the rather elegant:
But then again, it's not exactly in C++'s favor as a scripting language that copying words is easy, while lines is hard.