2 ms·
I wish the article had discussed abstraction more, because it's especially tricky in "scientific" code. The initial abstraction is actually pretty good, concep
by mattkrause 5y ago
I wish the article had discussed abstraction more, because it's especially tricky in "scientific" code.
The initial abstraction is actually pretty good, conceptually. You have a function that returns a value, like roll(sides=6), or an object you can manipulate to get a value: Die(sides=6).roll(). You then take those samples, somehow analyze them, and get a result. That code matches people's mental model very well.
If you were going to do this in C++, I'd stop here. Things only get more complicated because Python (Matlab and R too) penalize you heavily for leaving the BLAS sandbox.