|
Phew. If that had been anywhere else, you would have had a major problem there.
I think computer viruses should count as life. I think it says something about human nature that the only form of life we have created so far is purely destructive. We've created life in our own image.
Stephen Hawking
|
|
|
|
|
missing else?
Don't you just love scoping braces.
|
|
|
|
|
Norm .net wrote: Don't you just love scoping braces
You also dig chicks with braces?
|
|
|
|
|
Nothing against them except perchance in, humm, let's say orally challenging situations.
"I had the right to remain silent, but I didn't have the ability!"
Ron White, Comedian
|
|
|
|
|
What a catch!
Make it work. Then do it better - Andrei Straut
|
|
|
|
|
I did this once in c++, took very long to figure out:
if (condition);
{
}
____________________________________________________________
Be brave little warrior, be VERY brave
|
|
|
|
|
I'd be more concerned if there was something between the braces to get unexpectedly executed irrespective of the intended condition.
|
|
|
|
|
That's exactly what happened, irrespective of the condition the code block always executed...
____________________________________________________________
Be brave little warrior, be VERY brave
|
|
|
|
|
And I did this once in C, also took me long to figure it out:
for (i=0; i <= ....; i ++);
{
}
|
|
|
|
|
Add this comment before anyone notice your code!
if (_Uptime != null)
{
_Uptime.Remove(TraCommon.Tokens.TraService_Speed);
}
{
_Uptime = new Service.Message();
_Uptime.Code = SysCommon.CommandCode.SysUptimeEvt;
}
modified 30-Oct-12 5:56am.
|
|
|
|
|
Sadly, SVN will tell you that it really is ;(
|
|
|
|
|
Embarassing2A: We use SourceSafe.
Embarassing2B: It would still tell you that it really is.
Software Zen: delete this;
|
|
|
|
|
You could always lie and say the blame was falsely attributed due to corruption.
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
|
|
|
|
|
Embarassing3: I'm the SourceSafe *cough* data base *cough* admin, which means I'm responsible for ensuring the integrity of our source control system.
Besides, this is far from the worst bug I've ever fixed that had been around for a while.
Software Zen: delete this;
|
|
|
|
|
That should make it even easier to "fix".
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
|
|
|
|
|
|
At the risk of starting a slashdot-style flame war I refuse to code an if without:
if (condition) {
consequence;
} else {
negative consequence;
}
Can't help it. Can't change it. 56 years old and too old to recover from it. But also pretty hard to miss an 'else'.
Please don't hate me...
|
|
|
|
|
Part of my problem is that, due to changes in style guidelines in my group over time, I have a body of older code that uses K&R braces. My newer stuff, including the aforementioned C#, uses the brace-per-line style.
Software Zen: delete this;
|
|
|
|
|
Gary Wheeler wrote: It's been there for years.
Then it has been working for years too! Don't fix it!
To alcohol! The cause of, and solution to, all of life's problems - Homer Simpson
----
Our heads are round so our thoughts can change direction - Francis Picabia
|
|
|
|
|
Actually, it's not. In the code you don't see, it ends up replacing existing information when it should be adding it. The existing information gets lost.
Software Zen: delete this;
|
|
|
|
|
I did notice that. What I meant is that the application was obviously working for years with that code, unless it's been abandoned.
If it was behaving incorrectly it would've been noticed before. I'm not saying that what the code was doing was correct, just that the application was behaving as expected.
To alcohol! The cause of, and solution to, all of life's problems - Homer Simpson
----
Our heads are round so our thoughts can change direction - Francis Picabia
|
|
|
|
|
This is in a portion of the application that logs performance information for our field service organization. The bug caused part of the information to be recorded less often than it was available. The only way it would be noticed is if the folks doing the 'data mining' were paying really close attention, and they're not.
Unfortunately.
Software Zen: delete this;
|
|
|
|
|
This reminds me why i hate ppl who write code like
if (x != y) doThis();
remember one time when somebody added some code -->
if (x != y) doThis(); alsoDoThat();
Took a while in debugger to figure out what was reason :-p Cause not part of my code
I always write my code after that
if (x != y) {
doThis();
}
Even if have to do only one thing :-p
|
|
|
|
|
That's usually the case for me as well.
Software Zen: delete this;
|
|
|
|
|
Would have been obvious in VB.NET.
|
|
|
|