Question: assume you have a function that polls some kind of queue and blocks for a certain amount of time. If this time has passed without something showing up on the queue, some indication of the timeout should be delivered to the caller, otherwise the something that showed up should be returned.

Now you could write something like:

```
class Queue
{
    Thing GetThing();
}

```

and throw an exception in case of a timeout. Or you
write

```
class Queue
{
    int GetThing(Thing& t);
}

```

and return an error code for success and timeout.

However, drawback of solution 1 is that the on a not so busy queue timeout is not an exceptional case, but rather common. And solution 2 uses return values for errors and ugly syntax, since you can end up with a `Thing` that contains nothing.

Is there another (smart) solution for that problem? What is the preferred solution in an object oriented environment?

Answer: 
I've never had one that bad. My method in compiled programs is to use a REXX script which emulates GREP looking for references to source that I suspect is not being used, remove them from the program and see what breaks. I use the REXX script because I can pre-filter the list of files I want to search. Which allows me to do a search across folders and computers.
In the **Solution Explorer**, right click and on a **Reference** and click on the menu item **Find Dependent Code**. 

If it can't find any dependent code then you can remove this reference from the project. (The **Remove** operation is also under the right-click menu.)

**EDIT:** For a large project, the Find Dependent Code operation will take a *long* time. So since you have 2000 resources and most likely *value* your time this probably is **not** a viable option....