3 Months of Meterpreter
buffered.io1 pointsby OJ0 comments
open CorrugatedIron.Comms
let cluster = RiakCluster.CreateFromConfig("section", "path/to/file.config")
let client = cluster.CreateClient() var client = new RiakClient();
is nice, but has to infer a _lot_ from the world. We could write a lot of code to make sure that it's smart enough to pull all the details from the default locations or we could let people tell us where to look. We went for the latter, as it's much safer to be told than to pull config from the wrong spot. var client = cluster.CreateClient();
I don't see how this can be considered ridiculous. var client = cluster.CreateClient();
RiakClient instances are not disposable. RiakClient API calls, behind the scenes, use higher-order functions to avoid the leaky abstraction that is disposable resources and hence the RiakClient object doesn't have to manage connection lifetimes either. Get a client, use it, don't worry about cleaning up after yourself because we have that covered already. This gets rid of a log of fluff like: using(var client = ....)
{
client.DoStuff();
}
.. and turns it into: client.DoStuff();
It might be just me, but I do prefer reducing "boilerplate" throughout the user's codebase and having just a little more in the up-front configuration than the other way around. This also gives us the ability to load-balance calls across the nodes in the cluster without the user having to think about it. Again, I think this makes the API cleaner, easier to use and reduces the chances of boilerplate leaking out into user code.
I feel your pain in those latter points.