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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Ask HN: Do you consider reflection harmful?

6 点作者 StrykerKKD超过 10 年前
For me reflection is kind of like a magic trick, because it can hide how the program flows. Kind of like the hat-trick, where the input is the empty hat and the output is the bunny and the how remains a mystery.

2 条评论

api超过 10 年前
Not at all, but typically languages that support reflection are slower for very difficult to escape reasons. Chief among these is that such languages are dynamic, making every function call an indirection (load&#x2F;call). This forces a CPU pipeline flush for each function call, etc. It&#x27;s theoretically possible to get around this with <i>very</i> smart JITs, but it&#x27;s very difficult and depending on <i>how</i> dynamic the language is and how these semantics are used it can have severe limitations.
rwallace超过 10 年前
Reflection is like profanity: it has legitimate uses, but excessive and gratuitous use thereof should be frowned on. Save it for when you mean it.