31 August 2011

Wish I had learned this

John D. Cook reviews Peteris Krumins's new e-book, Awk One-Liners Explained. The need for one-line programs accounts for the long-tail popularity of an old command-line language like Awk. As Cook writes,

If something takes more than one line of awk, I probably don’t want to use awk.


My copy of Aho, Kernighan, and Weinberger has this one-liner pencilled on the back page. I've never found a simpler way to find the longest pathnames in a directory tree:


find . | awk '{print length($0) " " $0}' | sort -r -n


As I remember, I once prototyped a COBOL pretty-printer in Awk. That was more than a one-liner.

26 August 2011

Taling to the duck

Harry Roberts offers coding conventions for writing CSS. His tip about pattern-matching selectors with regular expressions is nifty.

11 August 2011

Not many happy campers

Erin Griffith surveys media companies and finds very few of them that are successful with the CMS (content management system) they use—be it open source, proprietary, or purpose-built.

“When you try to build a product that works for everybody, it works for nobody,” a former AOL employee says.


(Link via The Morning News.)