Elements of Programming Style - Brian Kernighan
Why Hacker News recommends it
HN cites it as the author's own talk on writing clear code, useful as a companion to his book.
What it is
Brian Kernighan's 2009 talk at Princeton on the Elements of Programming Style, discussing readable code, avoiding cleverness and flawed examples in programming tutorials.
Recommended by 0 HN commenters across 0 different months, 2018 to 2024.
What Hacker News said
Cites ZephyrP · 2018-06 · on “Massacring C Pointers”
I always wondered about the C tutorials Brian Kernigan mentions in his talk ( [this video] ) , many of the examples seem intentionally designed to be incorrect by some trickster spirit. Now I know the even darker truth.
Cites undecidabot · 2020-05 · on “Ask HN: Best books under 200 pages for developers?”
Brian Kernighan (the K in K&R and AWK) also wrote a similar book with P. J. Plauger called "The Elements of Programming Style" [1]. There's even a talk by him about it online (2009) [2]. Kernighan also co-authored a (imo) really great book with Rob Pike (once an assistant of Penn & Teller [3]) called "The Practice of Programming" [4]. Unfortunately, this one is a bit over the 200 page limit. [1] [LINK] [2] [this video] [3] [LINK] [4] [LINK]
Cites jodrellblank · 2024-08 · on “Go is my hammer, and everything is a nail”
Filtering a container by a predicate is 50 year old technology and a very common thing. It's unbelievable that a "modern" language has no shorter or clearer idiom than that convoluted boilerplate filled Ministry of Silly Walks blob. Python had filter() and then got list comprehensions from Haskell list comprehensions. PowerShell has Where-Object taking from C# LINQ .Where() which takes from SQL's WHERE. Prolog has include/3 which goes back to sublist(Test, Longer, Shorter) and LISP-Machine LISP had sublist in the 1970s[1]. APL has single character / compressing an array from a bitmask result of a Boolean test in the original APL/360 in 1968 and it was described in the book in 1962[2]. Brian