July 14, 2026

Loop drama, now with extra syntax

C++20 Improved the For-Loop Syntax

C++ gets a tiny glow-up and the comments instantly turn into a style war

TLDR: C++20 added a small shortcut that makes a common loop look cleaner, which matters because tiny code improvements can save time across huge projects. But commenters instantly split between “nice upgrade,” “there’s already a better way,” and “great, more clutter,” turning a minor feature into a surprisingly spicy fight.

A tiny coding tweak landed in C++20, and somehow the reaction turned into a full-on comment-section cage match. The original post was simple: this older programming language now lets people write a cleaner loop, so tracking both the item and its number feels a little closer to how it works in Python or Lua. In plain English, it’s a small quality-of-life upgrade for people who stare at code all day. The author loved it and basically said, yes, this is the kind of tiny polish that makes a big difference over time.

But the community? Oh, they were not going to leave it at that. One camp immediately jumped in with a smug little flex: actually, there’s already an even slicker way to do this, using a built-in “enumerate” style tool, plus newer print features that look suspiciously Python-ish. That sparked the real drama: if the whole point was making C++ less clunky, why celebrate a version where you still have to manually bump the counter inside the loop? One commenter flat-out called the new example “clearly inferior” to the Python and Lua versions.

And because no programming debate is complete without someone yelling from the back, another commenter dropped the classic drive-by insult: “Just what C++ needs, more bloat lol.” Meanwhile, one of the funniest reactions ignored the coding issue entirely and complained that the site’s blue slanted language names looked clickable... but weren’t. In other words: a small update, a giant argument, and at least one person more offended by fake links than by the language itself.

Key Points

  • The article compares indexed iteration syntax across Python, Lua, and pre-C++20 C++ using the same word-list printing example.
  • C++17 and older C++ require a traditional indexed `for` loop and a separate statement inside the loop to bind the current element reference.
  • C++20 allows an initializer in a range-based `for` statement, enabling syntax such as `for (int i=0; auto&& it: vec)`.
  • The article names the enabling proposal as `Range-based for statements with initializer`.
  • The article notes that this proposal is similar to C++17's `if statement with initializer` and presents indexed iteration as its intended use case.

Hottest takes

"The C++20 version is still clearly inferior" — WCSTombs
"Just what C++ needs, more bloat lol" — fourseventy
"you’d think they are links - and yet you click on them and nothing happens" — Gualdrapo
Made with <3 by @siedrix and @shesho from CDMX. Powered by Forge&Hive.