|
Seems self evident. But a study of 42 participants is some world class lazy research.
|
|
|
|
|
As the application source code and supporting tools contribute to both mood and problem solving ability, I'd say that might be a proximate cause to both?
|
|
|
|
|
..it was already widely known that happy people are more productive. One can Google the colors and music that'll "help".
And no, the way of measuring "happy" does not make it more scientific.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
One of the biggest changes is that “simple mode” is now the default for “git push,” which pushes only the current branch to the branch with the same name, and only when the current branch is set to integrate with that remote branch. The mode can be changed from traditional “matching” semantics using the configuration variable push.default. Now even more gitastic
|
|
|
|
|
RE:
Quote: kkthxbye
=shane=
Thanks you very much, shane!
Of all the news letters and e-mail subscriptions, the CP Daily News (Insider?) is the most valuable news to me (never deleted any one without read).
By the way, who is this shane guy?
Is it collective work?
|
|
|
|
|
Well, no one else is replying, so I guess I should.
Bob, Shane (sorry, shane), and I share a cubicle over here in the Code Project Daily News HQ (West Coast). Bob's the manager (so he gets a door) and occasionally provides blurbs, but most of the work is shane and I (but of course, I don't really exist[^]). We all just post using my login out of convenience (as we have one keyboard between us[^]).
TTFN - Kent
|
|
|
|
|
Don't tell me you've also got lasers on your fricking head!
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
Alan Kay.
|
|
|
|
|
Don't ask me no questions, I tell you no lies
(I'm working on it)
TTFN - Kent
|
|
|
|
|
Apple's recent security bug was traced to a spurious goto. But that still doesn't resolve the debate over its use. Yarp
|
|
|
|
|
Fire starter >
|
|
|
|
|
only as dangerous as the developer who uses them.
|
|
|
|
|
Can somebody explain this topic?. I am a bit surprised that how it can be harmful.As its the same goto statement which we use in C language.
|
|
|
|
|
Member 10232872 wrote: Can somebody explain this topic? Yep, goto is in C ... and that code is actually using it. If you want an explanation, then there are numerous examples where goto "can" make your code go haywire ... IF you don't keep your wits about you and your code is rather complex.
IMO goto is OK for very simplistic stuff, like the sample in the article. But chances are that an inadvertent double copy-paste (like I'm sure happened in that bug) wouldn't cause a compiler error.
And that's the main reason goto is dangerous. It's much easier writing something in goto which makes no sense - while the compiler would still happily keep on compiling it. In more structured statements the chance is reduced (note not removed) that the compiler will fail to catch such inadvertent mistakes.
I think about the "avoidance of goto" as a form of safety measure I use against my own stupidity and/or tiredness.
For the article's sample I'd have gone for a single if with the options or'ed together, and the fail portion inside the if's then clause (IMO easier to comprehend and more succinct). It would probably compile to the same machine code anyway.
OR (can't say for sure since a lot of the code was removed for that article) I might even think about using something like a hash-set (seeing as all the checks are for equality), though only if the number of comparisons becomes huge. It would be easier to extend later if there's a new type of error code (even at runtime), and for large quantities of such comparisons it might even be more optimal - but most probably it would be overkill for this example.
|
|
|
|
|
The original paper (indeed the original "considered harmful" paper) is here: Goto Considered Harmful (Dijkstra)[^]
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
Alan Kay.
|
|
|
|
|
Isn't this a rehash[^]?
If your actions inspire others to dream more, learn more, do more and become more, you are a leader.-John Q. Adams You must accept one of two basic premises: Either we are alone in the universe, or we are not alone in the universe. And either way, the implications are staggering.-Wernher von Braun Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.-Albert Einstein
|
|
|
|
|
The error with the two gotos was vague. I would assume that if it compiles, the second goto never gets called. There has to be more to it than that and I hate articles that don't quite explain it.
|
|
|
|
|
Why wouldn't it get called*? The whole problem with that second goto is, literally, that nothing prevents it from being executed.
*: I find that terminology slightly misleading, by the way.
|
|
|
|
|
I'll admit I thought that there were {} around that.
|
|
|
|
|
Does this make it clearer?
if ((err = SSLFreeBuffer(&hashCtx)) != 0)
{
goto fail;
}
if ((err = ReadyHash(&SSLHashSHA1, &hashCtx)) != 0)
{
goto fail;
}
if ((err = SSLHashSHA1.update(&hashCtx, &clientRandom)) != 0)
{
goto fail;
}
if ((err = SSLHashSHA1.update(&hashCtx, &serverRandom)) != 0)
{
goto fail;
}
if ((err = SSLHashSHA1.update(&hashCtx, &signedParams)) != 0)
{
goto fail;
}
goto fail; if ((err = SSLHashSHA1.final(&hashCtx, &hashOut)) != 0)
{
goto fail;
}
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, waging all things in the balance of reason?
Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful?
--Zachris Topelius
Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies.
-- Sarah Hoyt
|
|
|
|
|
Yeah, I finally realized that after the top comment. I'm surprised that it passed coding. I assume that they're not using a lint program or something to vet such obvious mistakes.
|
|
|
|
|
*loads a pair of sawed off shotguns with buckshot*
Okay. Who's the first noob who's going to argue that goto should exist?
|
|
|
|
|
So, the x86 instruction JMP will finally be banned?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Checkmate!
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
I don't think even Dijkstra argued it should not exist in assembly, just nowhere higher in the software stack.
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
Alan Kay.
|
|
|
|
|
Rob Grainger wrote: just nowhere higher in the software stack. ..nonsense.
Goto was a beast in the old days; try and debug an application that has no methods and lots of goto's; it makes it hard to see the programs' flow. THAT's why it was considered harmful. Idiotic generalizations like 'X is harmful' are more harmful than your modern goto. In the specific example from Apple one can just as easily point to the codeblock-delimiter.
I almost never use the instruction, but the idea that it's harmful is utter nonsense. Every command is harmful in the hands of a moron.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|