TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: Do you consider reflection harmful?

6 pointsby StrykerKKDover 10 years ago
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 comments

apiover 10 years ago
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.
rwallaceover 10 years ago
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.