←back to thread

257 points pmig | 5 comments | | HN request time: 0s | source
Show context
jayd16 ◴[] No.43099487[source]
Is it wrong that I judge anyone that calls DI "black magic"? Clearly it's just computers all the way down and even spring DI isn't that hard to follow.

It's one thing to call it bloated or annoying or tedious but why are we proud to announce we didn't do the work to figure it out?

replies(2): >>43099537 #>>43100863 #
kebsup ◴[] No.43100863[source]
I'd consider a lot of spring annotations "black magic" , because you can't simply go to definition and see how/what they do.
replies(2): >>43100926 #>>43102492 #
gf000 ◴[] No.43100926[source]
You... literally can? Yeah, you may have to grep for the annotation's name, but it's not like it's hidden/closed source/whatever.
replies(1): >>43101041 #
hu3 ◴[] No.43101041[source]
grep for annotations...

That mentality is how you get death by a thousand cuts.

Cognitive load matters.

replies(1): >>43101218 #
1. gf000 ◴[] No.43101218[source]
Search 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.

replies(1): >>43101911 #
2. hu3 ◴[] No.43101911[source]
This 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.

replies(1): >>43102096 #
3. pjmlp ◴[] No.43102096[source]
With a 1980's technology out of Xerox PARC, it is called IDE.
replies(1): >>43102645 #
4. hu3 ◴[] No.43102645{3}[source]
Exactly. Although from the reply I got above it seems to be alien tech to some.
replies(1): >>43102918 #
5. gf000 ◴[] No.43102918{4}[source]
There 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.