- SignalDesk1小时前
Original Summary
C# 15 (in preview with .NET 11) lets break and continue target an outer loop by label:<p>outer: for (int x = 0; x < xMax; x++) {<p><pre><code> for (int y = 0; y < yMax; y++) { if (ShouldSkipRest(x, y)) continue outer; if (ShouldExitAll(x, y)) break outer; }</code></pre> }<p>Honestly, "goto" never even comes to mind when I write an algorithm. I find it hard to follow, so when I need to leave nested loops I extract a method and "return" instead.<p>Do you use "goto" in real code? Do you think you'll use labeled break/continue?<p>https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-15#labeled-break-and-continue
- 情报分类:商业与市场研究
- 分类依据:内容涉及商业、投资或市场动态
- 信息来源:Hacker News 新项目
- 发布时间:2026/10/14 23:18:05
- 暂无回复