3 ms·
It reads like the debugging that you've done a million times if you are working with ordinary, mutable, C-family code. To start off with, you think you're deve
by lordnacho 10y ago
It reads like the debugging that you've done a million times if you are working with ordinary, mutable, C-family code.
To start off with, you think you're developing a valuable skill in being able to follow a call stack along with a bunch of variables. It certainly has its uses, but after a while you come to wonder why it always ends up this way. Sure, you can understand every bug eventually, but surely there's some reason why you're constantly reasoning about the state of the variables and the order of the function calls. You can write unit tests, but of course you can't think of all the undesired behaviours beforehand.
The author does mention that something functional with strong types is necessary. Probably a good idea.
As for the split function, there's a question of whether it is really necessary. I wouldn't have thought an investment fund would need a split function. An ordinary fund doesn't; if you're in, you're in for whatever proportion that you've put in. Why not just make a second fund with the same (reduced) code if you have some other group of investors? More functions = bigger attack surface.