TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Goto and the folly of dogma

4 点作者 gustavo_duarte超过 7 年前

2 条评论

eesmith超过 7 年前
What good references on programming style assert this dogma?<p>Because it looks like a caricature of the topic, somewhat like how some Agile people incorrectly argue about how first there was waterfall and then came the Agile manifesto.<p>Just because a lot of people learned crap habits fourth-hand, doesn&#x27;t make it a dogma. Dogma - real dogma - must be come from authority.<p>McConnell&#x27;s &quot;Code Complete&quot;, from 1993, has a checklist of &quot;Unusual control structures&quot; on p366 of my copy. This is much closer to what the real dogma of goto looks like:<p>[] Are gotos used only as a last resource, and then only to make code more readable and maintainable?<p>[] If a goto is used for the sake of efficiency, has the gain in efficiency been measured and documented?<p>[] Are gotos limited to one label per routine?<p>[] Do all gotos go forward, not backward?<p>[] Are all goto labels used?<p>Most of the CPython examples fit these criteria. I don&#x27;t have experience with the other projects. My own use of goto also fits this form.
yipopov超过 7 年前
Another example of this idiocy is the lack of goto in WebAssembly