The latest WTF. These just keep coming. Please allow me to dump them here, so I can keep my sanity.
So we use Memcache to store data. The PHP side of things is done with the Memcached extension. One of my first tasks was to write a wrapper class that ensures whatever you throw into it comes out exactly the same. That was an easy one day task whose main purpose was to get used to coding standards, the framework, etc. I put some extra effort into it anyway; e.g. make it use serialize if the data type was an object or array, etc. Just the things you come up with when you think about it longer than 5 minutes.
One of the decisions: If an error occurs, an exception is thrown, because this makes it easy to separate error conditions from return values. Also, because the FuelPHP framework uses exceptions for all errors, I tried to create the class in the spirit of the framework. (Preemptive comment: FuelPHP has its own Memcache wrapper class of course, but refer to my first post: the PL doesn't trust the framework, so we have to rewrite most of it.)
This means that if a key is not found, it throws a KeyWasNotFoundException.
Everyone was happy with this approach for about a month.
This morning, Mr. PL comes up and suddenly throws another fit.
Using exceptions is apparently 「ノンセンス」 (nonsense).
He said that he has never seen this kind of programming used before.
Instead of exceptions, we should return raw Memcached library error codes.
When I told him that those error codes are numeric and might collide with actual data, Mr. PL pulled the same old "You are JUST a programmer" card.
The next suggestion - worded in a very diplomatic tone - was to return an array with a status code and the data. Rejected. Arrays are slow.
Storing the last error code in a class variable to allow get_last_error() style programming? Refused.
Logging the error using the logging facility? Refused. Logging is slow.
After an hour's worth of back and forth between him and most of the team, he gave permission to return false on error (everyone had to agree not to store (bool)false).
We are currently busy going through code and removing the exception handlers.
And people wonder why the number of suicides by train is so high in Tokyo.