- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Admin
Admin
Regarding goto's, if used (sparingly), they should be short, tight & sweet. Easy to read, maybe better performance, little or no issue copying the code chunk to another program.
rar
Admin
Admin
Admin
Admin
I like the idea of an omnipotent [that|which|whom]* elects not to be omniscient.
Admin
So...basically his argument is that it's a trick to obfuscate a goto and/or that because you can write obscure macros that break if statements you should use this as all over your code?
How about learning to putting curly brackets after *all "if"s so that the scope of what follows is clearly defined?
If I could fix one thing about C that would be it (mandatory curly brackets for if/for/while/do/etc.)
Admin
Actually, in Visual C++ Debug builds, you can set a single breakpoint on the last closing brace of the function. Even early returns will go through your breakpoint.
Admin
I had no idea there were so many myths around the unfortunate "do{ }while(0)" construct. Its actual purpose is to make macros resemble function calls in one specific manner; as a single statement.
If the macro were simply "{ ... }", that would form one compound statement, and a following semicolon would form a null statement. "do{}while()" happens to require the trailing semicolon.
So the whole point of it is not to break code like:
For any sane recent code, please use an inline function instead.
Admin
I kinda don't like that when seeing a do{...} while(0); doesn't clearly communicate at the first line that it's not a loop, but a block of statements that might fail early. As a solution why not use
This is clearly from the very first line not an ordinary switch statement.
Admin
Incorrect, in the former you would have to add 3x as many debugging breakpoints to know that the function returned false.
In order to know why it returned false you require as many breakpoints (or debug statements) in both.
Admin
Admin
Admin
Admin
Hopefully man | more will have the opposite effect. wink
Admin
Admin
FTFY:
Here are your choices:
Admin
Why do you WANT macros to resemble function calls when they are NOT and can never be?
Lipstick. Pig. Bad idea.
Admin
I kinda like it when the pig has some lipstick on...
Admin
It's a fundamental law of physics, not a limitation on our equipment. [... and now a homoerotic zunesis quip is pushed onto the stack]
Admin
Admin
Admin
Admin
Admin
Excellent. Now you're beginning to think like me. Whenever you type something, it occurs to you - What Would Zunesis Say?
Admin
I never claimed to be bright, and I just admitted to being curious ("nosey" as you say). You're beign obtuse and not actually backing up your claims with evidence.
Most of my comments are not replies or quotes, so how exactly am I being nosey? Pleeease elaborate for this dummy.
Did I somehow interfere with some "brilliant" troll attempt of yours, and now your nose is out of joint?
Admin
Admin
You're just a troll.
Admin
I think you forgot Hortical, though I'm not sure if he's a developer or a lit nerd...
Admin
Ha ha! I love it when they SCREAM for me!
Admin
Actually, it IS a limitation on our equipment, or rather, on our way of interacting with reality. Everything our eyes see, they see because there are photons coming from there into our eyes, and the same principle works when we "see" an electron or a nucleus or whatever with detectors. The problem is that a macroscopic object gets a negligible momentum transfer by interacting with a photon, while an electron gets a huge transfer, hence the uncertainty.
Remember, physics principles are always derived from observation.
I guess that an omniscent being could know position and velocity of an electron at the same time, but the thing is, science is about what humans can do, and we can't.
Admin
Thanks. I'm happy you think I'm intelligent, but I don't consider myself to be that smart. I don't really care that much about intelligence. Experience, ambition, and luck are much more important factors in achieving success anyway.
More importantly, I wish I knew what behavior this guy was referring to. That way I could keep doing it, and do it more, just to annoy him.
Admin
Admin
Admin
If you leave me and you in a box sufficiently small, I'll get the energy to tunnel your....
Admin
...with its quantum claws. snickity snick snick
Admin
Admin
I an not by any means a physicist, and I'll say upfront that I don't have the math to understand how this works, but as it's been explained to me the limitation is more mathematical than experimental. That is, hoodaticus's explanation is closer to the truth, and the problem is not one of photons or any other particles bouncing off of things. The problem is that the total precision with which the actual values can be defined at any given time is limited.
That is, it's impossible to determine the values, not because the tools and medium of the experiments affect the situation, but because the actual acquisition of the knowledge affects the situation. More precisely, knowing the velocity of a particle with a certain degree of precision is what makes its position indefinite - not the process of measuring it.
This is difficult for me to accept, so I've asked a lot of smart people about it, and this is the consensus that I've extracted over the years. Still willing to hear more explanations, though, since as I say, I don't really understand it very well yet.
Admin
Without quantum mechanics, electrons orbiting a nucleus would emit electromagnetic energy. This would cause the electrons to lose energy until they spiraled into the nucleus.
Admin
That much I've come to grips with. Quantum mechanics is an accurate and productive way of describing the phenomena, I'm okay with that part. I just have trouble getting my head around some of the interactions with the mind - that's the part that makes my head go sideways. However, I'm convinced that it's my failure to understand that's the problem here, not a problem with the theory. There may be problems with the theory, but my inability to grasp it is not one of them.
Admin
Admin
You're not alone. I was just reading an interview with Roger Penrose who says that quantum mechanics is a provisional theory. He claims that it is most likely completely wrong and a yet unknown theory will eventually supplant it and also merge it with relativity. Einstein also never believed that quntum mechanics was "true" and he won a Nobel prize for a quantum mechanical theory.
Admin
To Amateur Troll:
Well Done.
Kudos.
Admin
Addendum (2011-07-12 16:11): Make that "Delayed Choice" Quantum Eraser for the apparent retrotemporal effect.
Admin
Someone will (no doubt) ask what about when others try to expand it?
They may get a compile time error, and will hopefully know how to fix it. Exploiting constructs for non-intuitive behavior seems a touch misguided - especially when there is a reasonably simple way to avoid the issue. It requires a fraction more effort to put parenthesis around every code block in a conditional, but CS101 always insisted we get into the habbit of doing that anyway, right?
Admin
Admin
Oh Akismet, why do you believe anything with a link is bad? It makes the posters here quite sad, A single link don't make it SPAM, We wouldn't try to post a scam.
Admin
Admin