I want to talk about your #3 in the example above. Highlighted.

You seem be saying to just instantiate each of the three objects required for the doggerel call and pass them without checking for their validity. Let the called function do the checking.

That’s wrong for several reasons. One, these objects may be fundamental to operation and are instantiated on many code paths. They may fail for a variety of reasons. At the call point those failure reasons are available; once your’re inside the called function all you have is NULL or not-NULL.

My non-ER case has failure-specific messaging. Yeah I left out error codes,. I told you it was pseudocode from the beginning.

Their scopes define their lifetimes, and and clearly laid out. Try it

Written by

American Software Developer living in Vietnam. Classical musician (guitar, woodwinds), weightlifter, multilingual, misanthrope • XY

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store