I heard that instead of throwing exceptions and catching them in try/catch block it is more reasonable to return null in methods instead because try/catch is resources consuming operation. Is this true?
Try/catch only takes a significant amount of resources if there is an exception thrown, otherwise it's practically none. Use them when they make the program cleaner. Returning null can be OK too. It depends
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With