Hacker News new | ask | show | jobs
by sanderjd 3144 days ago
I agree with annotations like this making it harder to reason about control flow, but I don't really get the consternation about "what do these annotations do?" so much. You can go read their documentation or source yourself to answer that question. How is that different than anything else? Same thing with "rails magic": yes, it sucks that you can't grep for method definitions, but you can go peruse the has_many method implementation to see what it does!
2 comments

This really isn't too difficult to do, but it is a time sink I'd rather not have to deal with. With Spring in particular there's a huge amount of complexity so it can take a bit of time to determine exactly what's going on. Whereas with something like Go, I generally have full control over my applications control flow and if I need to look at a libraries source it's typically very straightforward and to the point.
"I agree with annotations like this making it harder to reason about control flow"

That is precisely my consternation. Much, much easier to reason about abstractions in the core Java language, like methods and objects, then to discover what code is being injected by an annotation. Java has outstanding IDEs that excel at navigating, analyzing, and debugging Java code, but putting so much logic in annotations is almost like you are trying to deliberately keep much of the code secret from the IDE.

Yeah. In principle, IDEs could show you what an annotation is doing, but at least in my experience that aren't particularly good at this.