Sunday, 25 August 2013

Should you avoid Guavas Ordering.usingToString()?

Should you avoid Guavas Ordering.usingToString()?

This question was prompted after reading Joshua Bloch's "Effective Java".
Specifically in Item #10, he argues that it is bad practice to parse an
object's string representation and use it for anything except a friendlier
printout/debug. The reason is that such a use "is error-prone, results in
fragile systems that break if you change the format". To me it looks like
guava's Ordering.usingToString() is a spot on example of this. So is it
bad practice to use it?

No comments:

Post a Comment