News for hackers. Stuff that matters.
Re:Tiny Treeshaker: JavaScript tree shaking in 200 lines of ... by geokon on Tuesday June 29, 2021 @07:38AM (#27674440)
Oh that's cool. I'm not intimately familiar with Java, so it's interesting to see how it's done. I figured it was something like that. Coming from C++, reflection seems like a giant useless codesmell - and there are all these issues further down the line because of it. And I get the impression most Java code doesn't even rely on it
Re:Tiny Treeshaker: JavaScript tree shaking in 200 lines of ... by matsemann on Wednesday June 30, 2021 @03:31AM (#27685938)
Most Java code actually does rely on it, but behind the scenes. So you could go years between writing any reflection code yourself, but libraries and frameworks use it to dynamically search for known stuff in the classpath and change behavior if it finds other class X, or use it to serialize to and from various formats and java objects, do stuff based on annotations etc.