Schmide
Diamond Member
I'm currently going through an Android 2 book* and the code has thrown many exceptions for using null objects. Some of these are from expecting certain resources are available (i.e. GPS location) others are from using a database that failed to create because of a bad SQL statement.
I've always strictly checked any queried object's value before use. It seems the trend has been to forgo this to make more simple readable code and the expectation is for certain interfaces to always return.
I know a lot of what is written in a book is just for example sake. How do you guys feel about forgoing checking for simplicity and guaranteed results from queries?
*Professional Android 2 Application Development by Reto Meier
I've always strictly checked any queried object's value before use. It seems the trend has been to forgo this to make more simple readable code and the expectation is for certain interfaces to always return.
I know a lot of what is written in a book is just for example sake. How do you guys feel about forgoing checking for simplicity and guaranteed results from queries?
*Professional Android 2 Application Development by Reto Meier
Last edited: