3 ms·
I'd consider a lot of spring annotations "black magic" , because you can't simply go to definition and see how/what they do.
by kebsup 2y ago
I'd consider a lot of spring annotations "black magic" , because you can't simply go to definition and see how/what they do.
- gf000 2y agoYou... literally can? Yeah, you may have to grep for the annotation's name, but it's not like it's hidden/closed source/whatever.
- hu3 2y agogrep for annotations... That mentality is how you get death by a thousand cuts. Cognitive load matters.
- gf000 2y agoSearch within your IDE, do a Google search, whatever suits you. What mentality? And the cognitive load is to RTFM, so that you understand what are you doing. If that leaves any questions you can attempt to do a deep dive. It's not particularly high cognitive load to know that @GET is a get rest endpoint. How is that different without annotations? Documentation is also your best bet at first in case of a normal library function call. Jumping into that codebase can also be quite involved, depending on what it does.
- hu3 2y agoThis is 2025. If you can't jump to your own code implementation without having to search for strings, your tech sucks. And most of your message doesn't even apply. How would I Google or read the manual for my own code? We're talking about different things it seems.
- pjmlp 2y agoWith a 1980's technology out of Xerox PARC, it is called IDE.
- hu3 2y agoExactly. Although from the reply I got above it seems to be alien tech to some.
- gf000 2y agoThere was a 'may' in my original comment. It is metaprogramming, so you can't see every usage automatically even with "alien tech" like IDEs, unlike in case of a normal type. Especially that we are not even talking about own code, but third-party annotations with its third-party consumers. Also, grepping is a pretty standard term, it doesn't necessarily mean literal CLI grep, but go on with your advanced tooling as if no one else would be familiar with an IDE.
- marginalia_nu 2y agoSpring's annotations arguably are black magic, but while Spring offers DI, DI is not Spring, and honestly something like Guice is a lot easier to follow since it only does annotation-based DI and not a bunch of other stuff.