What do you think?
Rate this book
Paperback
First published June 5, 2001
You can see two disadvantages of reflection in the example. First, the example is capable of generating three run-time errors, all of which would have been compile-time errors if reflective instantiation were not used. Second, it takes twenty lines of tedious code to generate an instance of the class from its name, whereas a constructor invocation would fit neatly on a single line.
"[This is what] Java developers who release Open Source […] code are saying: 'Here, I worked hard on this. I hope you like it. But use it exactly how I tell you to use it, because fuck you, it's my code. I'll decide who's the goddamn grown-up around here."