|
|
|
|
|
by mattmanser
4468 days ago
|
|
I think making it an object has made the code unnecessarily complicated. I think you could almost 1/2 code with a simple function. This is where I personally think javascript programming is going wrong at the moment, so much boiler plate. You're also programming a bit too defensively. Ask yourself, do you honestly need all those checks? What would actually happen if you got rid of the checks? I think your code would be clearer without them and the programmer would still realize he'd made a mistake and passed in nulls. |
|
Confidence.js comes from how we operate on A/B tests at sendwithus - we think of them as variants associated with results. While the code could definitely boil down to a few simple math functions, we find objects to be a good way to organize our data models.