Comment

Comment by ned_batchelder

I'm sorry, is this a joke? "straightforward"? Why would you use that code when you could implement the same thing more simply like this?

    def line_number_mogrifier(f):
        num = 0
        for line in f:
            yield (num, line)
            num += 1

The functional proponents say that eventually everything will be functional, I guess I'll wait and see how that goes over. People think procedurally. Functional constructs may have some technical advantages, but if adopting them shrinks the pool of effective developers, it won't catch on.

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton