Timeline for Is it okay to have objects that cast themselves, even if it pollutes the API of their subclasses?
Current License: CC BY-SA 3.0
6 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Apr 30, 2015 at 23:31 | comment | added | Thomas Junk | @SteveJessop »It's easier to ask for forgiveness than for permission« is the slogan ;) | |
| Apr 30, 2015 at 17:26 | history | edited | Steve Jessop | CC BY-SA 3.0 | added 127 characters in body |
| Apr 30, 2015 at 17:23 | comment | added | Steve Jessop | @Radiodef: true, but one purpose of < is to avoid catching ArrayIndexOutOfBoundsException, and some folks decide to do that too. No accounting for taste ;-) Basically my "problem" here is I work in Python, where the preferred style usually is that catching any exception is preferable to testing in advance whether the exception will occur, no matter how simple the advance test would be. Maybe the possibility just isn't worth mentioning in Java. | |
| Apr 30, 2015 at 17:22 | comment | added | Radiodef | Catching ClassCastException is just ew. That's the entire purpose of instanceof. | |
| Apr 30, 2015 at 17:19 | history | edited | Steve Jessop | CC BY-SA 3.0 | added 19 characters in body |
| Apr 30, 2015 at 17:13 | history | answered | Steve Jessop | CC BY-SA 3.0 |