13. It was good, no more no less13. @triggerfinger12 Damn dude, happy birthday! Hope you had a good one?
actually, php also has bitwise operators.14 Sounds like when people don't know the difference between | and ||, causing some issues. (|| will short-circuit if the first is true, not executing the second. | always executes both operands). A similar thing occurs with & and &&. Technically it's because the single is bitwise and the double is logical, but they perform similar things.
I've used them, if I need a side effect of both methods being called, but yeah, I don't end up using them that frequently.One question though. How often are they actually used? Maybe its just me but so far I never had a reason to use bitwise operators of any kind. Is it something you don't realize you need until you actually delve into them or.....?
15 I wasn't talking about just the bitwise version of or/and but all the bitwise operators in general.14
I've used them, if I need a side effect of both methods being called, but yeah, I don't end up using them that frequently.
$a = someFunc();
$a = someOtherFunc() && a;
14. Actually, we simply define the charges as positive and negative, but those definitions didn't exist until we made them. If I wanted to I could technically call "positive charge" "peanut butter and jelly" and "negative charge" "mayonnaise"15. Not according to electromagnetics!
xor is something I've used, but I haven't used the shifts.I wasn't talking about just the bitwise version of or/and but all the bitwise operators in general.
Exactly15. Well, there is some reason on the positive and negative from a mathematical point of view, but the choice between them was indeed purely random. Electrons may just as well have been positively charged, with protons being negative.
12. That part is weird to me. Why not have the current flow the direction of the electrons?12 And then there's the whole positive current flow is the direction opposite the actual flow of charge.
Interestingly, positively charged "holes" can actually move in a semiconductor - its debatable whether it really counts as a thing, but its still cool.11 Franklin decided which way positive current was, and then we found out about electrons, and how it's negative charges that flow. So positive current is the direction of "positive charge flow", which isn't a thing, but would be the opposite of a negative charge flow.