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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Goto is Not Evil, Okay?

2 点作者 javadyan超过 13 年前

1 comment

mooism2超过 13 年前
Goto is a low level construct that shouldn't be used if your language has an appropriate high level construct you could use instead.<p>For example, try...finally constructs allow you to do your clean up once in a single place, and some languages allow you to break out of more than one loop at once.<p>If your language / operating environment doesn't have these constructs, then yes, fall back on goto.<p>(When I were a lad, we didn't 'ave IF-THEN-ELSE, all we 'ad were IF-THEN and GOTO. And <i>line numbers</i>. And we loved it. I wouldn't want to go back to that though.)