2 ms·
I know this is 10 years old, So the more interesting thing to me is that these days you can do this functional style in most languages, even Java! foo.stre
by lawl 11y ago
I know this is 10 years old, So the more interesting thing to me is that these days you can do this functional style in most languages, even Java!
foo.stream().filter(s -> !s.isEmpty()).collect(Collectors.joining("\n"));
So I'd say it didn't make them a worse programmer, it's just that the languages were/are behind.
Edit: Yup, forgot to map the description, but I'll leave it now.
- d--b 11y agoor in C#: string.Join("\n", foo.Select(x => x.Description()).Where(x => x != ""))
- teh64 11y agoYou forgot the map operation (and I would also filter out nulls): (just to be pedantic) foo.stream() .filter(s -> s != null) .map(s -> s.description()) .filter(s -> !s.isEmpty()) .collect(Collectors.joining("\n"));