View Single Post
Old Aug 16th, 2005, 12:21 PM   #2
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Obviously you've investigated your options and know what they are. The choice is yours and based on YOUR requirements and best judgement. If you feel like consulting others for their judgement, that's not an unwise thing to do. The unwise thing is to put a lot of stock in a high-priest/guru that will lay down the law (NEVER USE AN OUT PARAMETER) without telling you why.

Personally, I would avoid statics or globals; too much loss of control and widespread utility.

I probably also wouldn't require my classes to all have error data members, but I might. That depends upon the overall design and the robustness of the objectivity I had plans for.

The use of a reference (whether in the sense of C++, or in the sense of any pointer) can be confusing for follow-on maintenance if the documentation is lacking. It's perfectly functional but can be affected by multiple threads.

As you can see, there's no definitive answer in this response. If a single solution were good, and possible, you would already have found it, and thus not be posting. I just thought I'd give you some of my brief reasoning, rather than hand you a dictum, tell you to shut up, kiss my ring, and not ask questions.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote