News for hackers. Stuff that matters.
Re:C++20 Improved the For-Loop Syntax by WalterBright on Wednesday July 15, 2026 @01:37PM (#48924383)
If you prefer writing:

    for (auto&& [i, it] : vec | std::views::enumerate)
        println ("{}:{}", ++i, it);
instead of:

    foreach (i, s; vec)
        writeln(i, ": ", s);
well, what can I say?
Re:C++20 Improved the For-Loop Syntax by acehreli on Wednesday July 15, 2026 @03:58PM (#48926295)
We may first need to go over what "elegant" means I guess. :)
Re:C++20 Improved the For-Loop Syntax by pjmlp on Wednesday July 15, 2026 @05:18PM (#48927126)
There is elegant when writing code by hand, and when reviewing code by AI agents.
Re:C++20 Improved the For-Loop Syntax by pjmlp on Wednesday July 15, 2026 @05:17PM (#48927103)
I prefer to use the option with better market share.

I am not counting characters, especially when AI completes typing for me.