crashfrog

joined 11 months ago
[–] crashfrog@lemm.ee 1 points 11 months ago (1 children)

They do fail if there's not enough balance. There is no overdraft bullshit, if you ask your bank to act that way.

[–] crashfrog@lemm.ee 0 points 11 months ago (1 children)

Right but that's a lot different than the loan being discussed here, which is when the bank capitalizes its own loans via deposits.

[–] crashfrog@lemm.ee -1 points 11 months ago (3 children)

Loans don't increase the money supply, though. They increase monetary velocity.

[–] crashfrog@lemm.ee 2 points 11 months ago

I’m curious about these places without overdraft fees. How far in the negative do they allow you to go?

None. None negative. They'll deny the transaction or NSF the check if there's not enough in the account to cover it.

[–] crashfrog@lemm.ee -3 points 11 months ago (5 children)

Loans don't devalue dollars.

[–] crashfrog@lemm.ee 2 points 11 months ago (4 children)

(however, I don’t get why more loops and ifs makes a function harder to test, I’m just going to trust you and that I’ll find out later.

Well, it's fairly easy to explain - each branching statement in your function doubles the number of discrete paths through the code. If there's one if statement, there's two paths through the code. (The one where the if predicate is True, and the one where it isn't.) If there's two if statements, there's four paths through the code. If there's three if statements, there's eight paths through the code.

In order to test a function completely, you have to test every possible path through the code. If you used three if statements, that means you have to devise and write eight tests just for the different code paths, plus testing various exceptional cases of the function's input ("what if all inputs are 0", "what if all inputs are null", "what if the integer is a string", etc.) That's a lot of tests! You might even have to write tests for exceptional cases combined with different code paths, so now you're writing eight times the number of tests you otherwise would have had to.

Whereas if your function doesn't branch at all, there's only one path through the code to have to test. That's a lot fewer tests which means you'll probably actually write them instead of saying "well, it looks like it works, I won't spend the time on tests right now." Which is how bugs make it all the way through to the end of the project.

[–] crashfrog@lemm.ee -4 points 11 months ago

An economic transaction was non-zero-sum and made us both money? You love to see it! Capitalism wins again.

view more: ‹ prev next ›