Friday, May 10, 2024

UFCS and function chaining

Which is more readable?

display_in_columns(count_each(sort(to_lower_case(extract_words(some_long_string_of_words)))))

some_long_string_of_words
    .extract_words
    .to_lower_case
    .sort
    .count_each
    .display_in_columns

No comments:

Post a Comment

I reserve the right to remove egregiously profane or abusive comments, spam, and anything else that really annoys me. Feel free to agree or disagree, but let's keep this reasonably civil.