HackerTubewatch
Surprise me
Frame from The Forgotten Art of Structured Programming - Kevlin Henney [C++ on Sea 2019] Plays via YouTube's privacy-enhanced embed

The Forgotten Art of Structured Programming - Kevlin Henney [C++ on Sea 2019]

cpponsea
Talks
YouTube
2 HN users recommended this talk2 months2021–2022 score 2
Years with an HN recommendation, 2007–2026

HN commenters point to it in discussions of goto, early returns and cognitive load when reading code.

Kevlin Henney revisits structured programming, from Go To Statement Considered Harmful to block-structured code and object orientation. He argues it still matters for how we write code today.

2 recommendations · 1 citations · Talks · intermediate

3 Hacker News comments

From the HN archive; up to 20 kept per video, favoring different commenters. Recommendations first.

@kbenson Apr 2021 Recommends
on HN thread Using the switch(true) pattern in JavaScript
If you haven't seen it, Kevlin Henney's talk about "The Forgotten Art of Structured Programming"[1] is interesting (if somewhat long in the examples later), and somewhat related. It's not specifically about return early (and a case could be made that it should or should not apply specifically to early return), but it is about if, else, return, and how they affect cognitive load when reading code. 1: [this video]
Interesting talk on if/else/return and cognitive load when reading code.
@jiggawatts Jul 2021 Recommends
on HN thread Linux: Using goto In Kernel Code (2003)
Read more
I get that, but the comment was specifically about pointers (not gotos or structure), and is interesting in general from a historical perspective. The "goto" keyword is similarly dangerous. I've seen very good arguments for leaving it out, and generally poor arguments for keeping it in a language. "I can use it safely" is not a good argument, because it's just like Jim Jefferies' standup routine linked above: "Why should I have my guns taken away from me?" An example of a good argument for structured programming is the talk "The Forgotten Art of Structured Programming - Kevlin Henney [C++ on Sea 2019]": [this video] Similarly, this article makes a very good argument that concurrent or async code is essentially the "goto spaghetti reinvented, but even worse ", and that Structured Concurrency is the solution: [link]
Good argument for structured programming over goto.

Citations, criticism and jokes

@shadowofneptune Sep 2022 Cites it
on HN thread Making Wrong Code Look Wrong (2005)
For some of these reasons, I prefer to write this: if (condition) { throw } else { <rest of code> } Rather than: if (condition) { throw } <rest of code> The justification, which I found in this presentation ( [this video] ) is that if you only looked at the block structures, could you tell that the rest of the code might never run?
Source for justification preferring explicit else blocks over early throws.

Video list and Hacker News comment labels from HackerTube (prompted by @karpathy), released under ODC-By 1.0, built on the open-index/hacker-news archive. Hacker News data is provided by Y Combinator; comments remain the work of their authors. Video titles, channel names and thumbnails belong to their creators and are shown via YouTube. HackerTube Watch is an unofficial edition. Data export of 2026-10-31.

Keyboard shortcuts

/
Search
j k
Next / previous video
r
Surprise me
l
Like (video page)
w
Watch later (video page)
?
This help
Esc
Close