[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Interesting articles
From: |
Larry Kollar |
Subject: |
Interesting articles |
Date: |
Thu, 25 Mar 2021 22:30:57 -0400 |
Sometimes, my Twitter feed coughs up some cool articles, like
this one: "Performance comparison: counting words in Python,
Go, C++, C, AWK, Forth, and Rust”
https://benhoyt.com/writings/count-words/
The Awk solution was by far the shortest by line count. Since
the runtime for all the different solutions was a few seconds or
less, Awk was probably the fastest because it took the least time
to code. :D
But there was a passage that made me laugh out loud:
> Incidentally, this problem set the scene for a wizard duel
> between two computer scientists several decades ago. In
> 1986, Jon Bentley asked Donald Knuth to show off “literate
> programming” with a solution to this problem, and he
> came up with an exquisite, ten-page Knuthian masterpiece.
> Then Doug McIlroy (the inventor of Unix pipelines) replied
> with a one-liner Unix shell version using tr, sort, and uniq.
I can imagine the shell pipeline also look less time to type in and
run than it did to code the literate programming solution. For
one-off things like this, less code is better.
Then there was the article “Taco Bell Programming”
http://widgetsandshit.com/teddziuba/2010/10/taco-bell-programming.html
There were several good takeaways in this one, but my favorite
line was “functionality is an asset, but code is a liability.” Not to
mention the casual comment that xargs supports parallel processing
(something I was totally unaware of!).
— Larry
- Interesting articles,
Larry Kollar <=