Okay, let's have a little discussion about programming in a porn forum, because why not
No, that would be the most effort by adding another condition into the if condition.
1. Visually, you have no reference of what you added or tweaked unless you want to write comments. (Not less work then commenting out a whole block).
2. Commenting maintains the original code, with the addition of changing the functionality to what is desired. Making reverting changes as easy as uncommenting.
3. The way you're using it as a suffix check is also inefficient. Even if I wanted to just add false, I would add it to the beginning of the condition checking. Why? Because if it comes first, the resulting conditions don't need to be evaluated.
JavaScript:
// true && true && true needs to be evaluated before it gets to the condition of false that you added
if (true && true && true && false) {
...
vs
// false is the only condition that needs to get evaluated
if (false && true && true && true) {
...
Regarding 1: No adding of conditions. The lowest effort in achieving the intended goal in terms of changed symbols would be to the negation
!
in front of
this._firstPussySexWasToy
. Yes, don't do that because of many reasons with some being the ones you stated. That's why I did not recommend them in my original post. But I wasn't making a point about coding style. I was giving an example to support the claim that there are infinitely many ways to achieve the same goal.
Regarding 2: Yes. That's why it's (as I already said) the go-to way. I never said otherwise, just that I like to change things up now and then.
Regarding 3: Yes I agree. Adding something in the end, however, is the most natural way most people write. My general intention is to make the edits as intuitive to implement as possible. Not teaching people coding practices.
In conclusion: I'm not here to teach JS to people. If you want to have some fun, go through all my tweaks. You will most likely not enjoy them, if you're looking for optimized code. I don't like them in that regard. But the main goal is an easy (i.e. hopefully fool-proof) guide to help random perverts in the internet without coding experience to do what they want to in some porn game. I'm not coding for people, they do it themselves.
I try to keep it clean, but because the trade-off between difficulty of implementation and beauty of resulting code is both subjectively estimated by yours truly, we are destined to disagree at some point.
You must be registered to see the links
This only shows that
false && true
(or any permutation or derivative) equals to false. Nothing to do with short-circuiting whatsoever. I think this logical rule is common knowledge.
EDIT: This really shows the existence of short-circuiting:
You must be registered to see the links
(a bit unnecessary because we all agree that SC exists in JS, but I don't know what your example was intended for)
But we are talking about very fast access queries even in the original code. While it theoretically makes a difference, it is not nearly significant enough that I'll give it enough weight to complicate the tweak.