Threads, success, alcohol! Time for a story. Stop me if you've heard it (or not, it's always fun).https://twitter.com/MorlockP/status/1063571683322277889 …
-
Show this thread
-
I'm working at
$BIGCO and we're rewriting some of the APIs used in old style C++. This means no exceptions, and all APIs are now required to return a success code.1 reply 0 retweets 1 likeShow this thread -
But we're also modernizing, so there's threads, and cross-language calls to more sensible ones that can actually deal with exceptions.
1 reply 0 retweets 1 likeShow this thread -
When one of the old APIs fails there's a translation layer that converts the old error code into an exception. It gets raised, you can catch it, or crash and everyone is happy.
1 reply 0 retweets 0 likesShow this thread -
Sometimes you implement callbacks in your modern language and they throw an exception... No problem, the translation layer converts that into a success code and the calling code deals with it properly.
1 reply 0 retweets 0 likesShow this thread -
It can even bubble back to your code and looks just like your original exception.
1 reply 0 retweets 0 likesShow this thread -
But some of these operations can take a long time... and in our new modern UI environment, you don't have blocking UI. AJAX, JavaScript, webby stuff.
1 reply 0 retweets 0 likesShow this thread -
Soooo... our modernization of the APIs turns some of them into asynchronous calls. (see where this is going?)
2 replies 0 retweets 2 likesShow this thread
"See where this is going" Oh, haha haha, yes, I do. I too have dealt with errors IN CALLBACKS, where there is no "up". Hahahhaha
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.