‹ BackHN Continuity

Thread

Anecdotally, programmers dislike "reduce"

175 points · 283 comments · vinhnx

  1. el_oni · · focus · HN ↗
    Ive only used reduce at work half a dozen times and it does raise an eyebrow each time.

    But for unioning a bunch of spark dataframes together i think

        df = reduce(DataFrame.union, list_of_dfs) 
    
    is much nicer than

        df, *rest = list_of_dfs
    
        for other in rest:
            df = df.union(other)
    
    People just get a bit funny, especially now you have to import it from functools
    1. tehnub · · focus · HN ↗
      Came here to comment this. I work on a team of functional-adverse devs, but they all happily use this one.
Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.