Plenty of people that would rather drop to Perl or Python once awk gets too cumbersome for the command line.
Still, I'm not certain if the original comment is complaining about the tendency toward one-liners by actually writing less code (something the article alludes to, "only the inner part of the for loop") or merely cramming what would otherwise be readable as a multi-line, well-indented program into a single line.
I tried answering a few awk questions being verbose and explaining the steps. But I noticed that most are not asking to learn but to get a quick fix. Soon after that came the second realization: several of the answers did not understand what they where doing.
My conclusion: We are living in a cut'n'paste world were actual understanding is less valued.
Naturally code reuse is nice. But I doubt that many users are able to construct their magic awk snippets from the ground up. Hence the prolific terse magic snippets.
Interesting... to me the value (er, a value) is that you can write
/PATTERN/ { print $3 }
instead of import re, sys
for line in sys.stdin:
if re.search('PATTERN', line):
print(line.split()[2])
And another value is that it's more likely to be preinstalled than Python.I really like the concept of Wolfram Mathematica Notebooks as you can essentially embed everything into a reproducible analysis (what they call a computational essay). The free and open source equivalent is Jupyter notebooks.
awk '!_[$0]++'Don't know why it gives me joy to write those things even when I know it would be far better to write the same in three nested for loops (which are less error prone, more maintainble and gives more flexibility like easy to "break").
Secondly and this is a personal preference but the code looks more readable when the for statements are on different lines telling you which array is being iterated compared to the nested functions where the output of one function is piped as input to another.
Just observe the kind of kindergarten antics some in the _sec world will get up to...