Every game has issues at launch, that’s why they launch them
Every game has issues at launch, that’s why they launch them
I don’t understand how Cyberpunk and No Man’s Sky were the ones that “burned” you, they’re both great games? GOTY material even?
Communism is when made-up stats
The point is that there are beds that nobody are using while people are forced to sleep on the ground.
If you let a guy sleep on it, then you can’t sell it. Who would buy it? The bed isn’t “not being used”, it’s not being used as a bed.
It’s about resources not being used as efficiently as they could be
There’s nothing inefficient about this allocation of resources.
If anything this guy is a lot less in need of a bed than someone who hasn’t trained themselves to be able to sleep in a doorway (to wit, me.)
“Capitalism is when stores aren’t hotels”
Good luck
What would be an example where you need different logic based on a number’s parity? Why wouldn’t you write logic that ignores the number’s parity?
Part of getting better as a programmer is realizing which stuff doesn’t matter, and writing less code, as a result.
(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.
I suspect “you’ll fail the test if you use break
” is more of a joke by your teacher than an actual grading rubric, although if you used it more than twice in the same test I wouldn’t award you better than a B.
Is there a benefit to not using breaks or continues?
The benefit is that you learn to write non-branching code. That’s important for beginners, who tend to write very complicated and complex code with lots of branching, which they then discover they’re not able to test and debug. Barring you from using break
and continue
forces you to write more abstract code to achieve the same level of function with less complexity, and that’s how programmers advance in skill - simpler, more abstract code.
Ultimately it’s an effort to kick a crutch out from under you. Whether you think that’s appropriate for a teacher is up to you, I guess - I’m inclined to think it is, but many students don’t respond well to being challenged.
Removed by mod
Removed by mod
Removed by mod
Removed by mod
Removed by mod
Removed by mod
Removed by mod
Removed by mod
Removed by mod
Joins the cinematic “hardest to trademark” pantheon alongside “She”, “Her”, and “Them”