3 ms·
More like this please. I really like Bray's style of trying something, posting it on the Internet, letting the Internet tell him how he is doing everything wro
by jimbokun 17y ago
More like this please.
I really like Bray's style of trying something, posting it on the Internet, letting the Internet tell him how he is doing everything wrong, then summarizing the responses about how to do it right (or explain why he's going to continue to do it wrong, like in this case where for his case the performance impact just doesn't matter). His Wide Finder series followed the same formula.
With regard to the content, I like to use reflection when I'm marshalling objects into and out of some serialization format. The most recent example is marshalling Java-Beanish objects into JSON in response to AJAX calls. I figure with the overhead of serializing everything to a String, and pushing those bytes across a network, the reflection hit won't be perceptible.
I also like Jerome Lacoste's solution keeping the Iterator interface but dumping the reflection.
http://github.com/lacostej/android-providerhelper/ http://github.com/lacostej/android-providerhelper/
"We get almost best of both world:
* good performance (almost no reflection)
* code easy to read."