Re:Everything about Java 8
by lucastheisen on Wednesday March 27, 2013 @05:34PM
(#5452137)
is that really more work than:
The words are different (try/catch instead of if/else), but still 2 blocks of code with similar syntax...
[ Parent
| on HN ]
The main reason for TryParse, AFAIK, is avoiding the massive expense of exceptions on the CLR.
Another reason is composability. If you're checking several values together, returning a Maybe/Option is much more clear and usable.