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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Bad programming with exception

2 点作者 SteveOS超过 15 年前

1 comment

cosmok超过 15 年前
A lot of applications that I have worked on (primarily written in PHP) use Exceptions in a fashion similar to what has been shown in the example. And, I have seen places in code where exceptions get thrown when there is no data in a given table instead of returning zero or null. But, the I wouldn't be totally against using Exceptions in the example on that page if the calling method does something very important. I would love other's views on this.<p>Also, I was able vote multiple times for the same example (went from -3 to 3).