Using exceptions only for exceptional conditions is something we can all agree with. However, this item should have been named "Don't use exceptions for control flow and how to decided between state-testing method and distinguishing return value". Bloch gives an example of how exceptions can be used for ordinary control flow, two alternatives in state-testing method and distinguishing return value and how to choose between them. I was rather hoping for some discussion of what exception conditions are, not just a brief discussion of what they are not.
I was out walking with a techie friend of mine I’d not seen for a while and he asked me if I’d written anything recently. I hadn’t, other than an article on data sharing a few months before and I realised I was missing it. Well, not the writing itself, but the end result. In the last few weeks, another friend of mine, John Cricket , has been setting weekly code challenges via linkedin and his new website, https://codingchallenges.fyi/ . They were all quite interesting, but one in particular on writing load balancers appealed, so I thought I’d kill two birds with one stone and write up a worked example. You’ll find my worked example below. The challenge itself is italics and voice is that of John Crickets. The Coding Challenge https://codingchallenges.fyi/challenges/challenge-load-balancer/ Write Your Own Load Balancer This challenge is to build your own application layer load balancer. A load balancer sits in front of a group of servers and routes client requests across all of the serv...
Comments
Post a Comment