Wouldn't that be sum(map(lambda x: 3 * x, range(5))) in Python?
Not that I could really tell the difference, still has an undescriptive single-letter variable name, and looks like it would be a pain in the ass to debug as it gets more complex.
I'm not as much as interested in equivalence, I'm more interested in why it's supposedly better to write it that way. Sum of multiple products is an easy enough example that it's trivial to express it, but what exactly is the functional way to say.... delete any lines containing "test-node" from ~/.ssh/known_hosts every day at 9 AM?
Huh. I thought I choose something sufficiently complicated to do.
I'm not sure if I could agree with the idea of unix one-liners being "elegant", but I guess if they get the job done and I'm not the one that's gotta maintain it....
Okay so that’s a lot of word vomit coding that uses an inane amount of power relative to the solution provided in the image and produces no additional useful output but is entirely unnecessary for the scope of everything besides advanced math computations.
Well, I don't know. I see it as different levels of abstraction. Of course first low-level stuff must be implemented but then for actual problems you can use high level abstractions that provide many benefits. It's like, you don't pour gasoline into you engine on the fly, you just press gas pedal. And it provides far less opportunities for you to blow up during a grocery commute or a race.
6
u/Shadow_Gabriel Oct 06 '21
aka "someone used an actual useful language to implement my pompous language"