Greetings, my fellow developers.
I would like to use this forum to inform you of the new development paradigm that I have just realized. Believe me when I say that this will blow your mind. It combines the power of C++ with the flexibility of the easier loosely-typed languages.
I call it "exceptional programming". The 'exceptional' is because it is based on exceptions and of course because the whole idea is quite exceptional - if I may say so myself.
See, the problem with C++ has always been that a function can have only a single return type. Of course, nowadays with templates it's possible to have functions that accept almost anything, but the return type is just that - it's static and that inhibits flexibility and creativity.
What if - instead of returning this single type, you throw the thing you want to return. So instead of returning a boolean, you can throw one. Or an std::string, or anything you want. It's easy because now you can return any type from any function. The caller can easily use the return type by having multiple catch clauses for the types that are returned.
Of course we also still need to have a way to actually signal a fault. This we then do by not throwing an exception, but returning a const char * with a description of the error that occured.
So, all our functions will have this single type:
template <class Arguments...>
const char *function(Arguments... &¶meters)
This is the only function declaration you need to remember. Easy, isn't it? No more checking what the prototype of function X was. You just call it and catch the type you want to have returned.
I expect to see this new way of programming everywhere within the coming years. You can help out to by converting existing open-source code to use this new wonderful way.