News for hackers. Stuff that matters.
Re:The Yoda of Silicon Valley by flukus on Monday December 17, 2018 @07:28PM (#18703564)
There is no bash (or any scripting) involved, the complete command from the article is:

  tr -cs A-Za-z '\n' |
  tr A-Z a-z |
  sort |
  uniq -c |
  sort -rn |
  sed ${1}q
The real benefit is that each is a single command that is easy to test in isolation and it's multi-process. That's not possible in most scripting languages.
Re:The Yoda of Silicon Valley by zbentley on Monday December 17, 2018 @07:49PM (#18703674)
> There is no bash (or any scripting) involved

What provides the pipe functionality?

Re:The Yoda of Silicon Valley by sobellian on Monday December 17, 2018 @07:48PM (#18703669)
McIlroy literally calls it a script in his review (notice the ${1}).

Nothing prevents you from unit testing in scripting languages. Multi-process, sure, but most people aren't looking for that.

Re:The Yoda of Silicon Valley by flukus on Monday December 17, 2018 @08:00PM (#18703705)
> McIlroy literally calls it a script in his review (notice the ${1}).

Ok, there's a single shell substitution, if it was fixed would you still call it a script? Technically the result of that is itself a sed script "3q", but if you count either of those then there isn't a lot of wiggle room between script and command, the arguments to tr are by far the most complex "script" involved.

> Nothing prevents you from unit testing in scripting languages.

That is a world away from what I'm talking about. Each line of that command can be executed on the CLI in isolation, you'd be replicating a lot more in nearly any scripting language, except maybe perl and awk.

> Multi-process, sure, but most people aren't looking for that.

Neither am I generally, still quite nice when you get it for free though.

Re:The Yoda of Silicon Valley by sobellian on Monday December 17, 2018 @08:07PM (#18703745)
You're really splitting hairs. You can execute a Python command in a REPL. There's little material difference between scripts and commands for our purposes. And scripting languages provide facilities to test functions in isolation.