Now this is embarassing
-
After that post in the Lounge earlier, there seems to be something of a trend of screwing up control structures today!
-
if (_Uptime != null)
{
_Uptime.Remove(TraCommon.Tokens.TraService_Speed);
}
{
_Uptime = new Service.Message();
_Uptime.Code = SysCommon.CommandCode.SysUptimeEvt;
}I just found this in my code. It's been there for years.
Software Zen:
delete this;
Yeah... just last week it took me and another engineer brainstorming for an hour before we realized a bit was flipped the wrong way. Our world is fun, wild, and at times all too damned granular. :)
Think of how stupid the average person is, and realize half of them are stupider than that. - George Carlin
-
if (_Uptime != null)
{
_Uptime.Remove(TraCommon.Tokens.TraService_Speed);
}
{
_Uptime = new Service.Message();
_Uptime.Code = SysCommon.CommandCode.SysUptimeEvt;
}I just found this in my code. It's been there for years.
Software Zen:
delete this;
Oops! That had to hurt.
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
-
Oops! That had to hurt.
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
Fortunately it's in some logging code that only field service cares about.
Software Zen:
delete this;
-
Fortunately it's in some logging code that only field service cares about.
Software Zen:
delete this;
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
-
if (_Uptime != null)
{
_Uptime.Remove(TraCommon.Tokens.TraService_Speed);
}
{
_Uptime = new Service.Message();
_Uptime.Code = SysCommon.CommandCode.SysUptimeEvt;
}I just found this in my code. It's been there for years.
Software Zen:
delete this;
-
missing else? Don't you just love scoping braces.
Software Kinetics - Dependable Software news
Norm .net wrote:
Don't you just love scoping braces
You also dig chicks with 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. ;P
"I had the right to remain silent, but I didn't have the ability!"
Ron White, Comedian
-
Nothing against them except perchance in, humm, let's say orally challenging situations. ;P
"I had the right to remain silent, but I didn't have the ability!"
Ron White, Comedian
-
if (_Uptime != null)
{
_Uptime.Remove(TraCommon.Tokens.TraService_Speed);
}
{
_Uptime = new Service.Message();
_Uptime.Code = SysCommon.CommandCode.SysUptimeEvt;
}I just found this in my code. It's been there for years.
Software Zen:
delete this;
Add this comment before anyone notice your code!
// This embarrassing code is definitely not written by Gary Wheeler!
if (_Uptime != null)
{
_Uptime.Remove(TraCommon.Tokens.TraService_Speed);
}
{
_Uptime = new Service.Message();
_Uptime.Code = SysCommon.CommandCode.SysUptimeEvt;
}:laugh:
-
Add this comment before anyone notice your code!
// This embarrassing code is definitely not written by Gary Wheeler!
if (_Uptime != null)
{
_Uptime.Remove(TraCommon.Tokens.TraService_Speed);
}
{
_Uptime = new Service.Message();
_Uptime.Code = SysCommon.CommandCode.SysUptimeEvt;
}:laugh:
-
if (_Uptime != null)
{
_Uptime.Remove(TraCommon.Tokens.TraService_Speed);
}
{
_Uptime = new Service.Message();
_Uptime.Code = SysCommon.CommandCode.SysUptimeEvt;
}I just found this in my code. It's been there for years.
Software Zen:
delete this;
Don't be too embarassed. It's quite normal[^]
-
if (_Uptime != null)
{
_Uptime.Remove(TraCommon.Tokens.TraService_Speed);
}
{
_Uptime = new Service.Message();
_Uptime.Code = SysCommon.CommandCode.SysUptimeEvt;
}I just found this in my code. It's been there for years.
Software Zen:
delete this;
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...
-
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;
-
if (_Uptime != null)
{
_Uptime.Remove(TraCommon.Tokens.TraService_Speed);
}
{
_Uptime = new Service.Message();
_Uptime.Code = SysCommon.CommandCode.SysUptimeEvt;
}I just found this in my code. It's been there for years.
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
-
Gary Wheeler wrote:
Mine was a sin of omission, while his was a sin of emission.
Someone mentioned in the other link that an empty statement shouldn't be allowed after an if statement. I think both should be allowed, but have warning messages. His would be "The conditional statement won't execute anything", yours "Extra brackets added for no apparent reason". Both may be a stretch for the compiler to see. On the other hand, people who like padded coding might not like that.
-
-
if (_Uptime != null)
{
_Uptime.Remove(TraCommon.Tokens.TraService_Speed);
}
{
_Uptime = new Service.Message();
_Uptime.Code = SysCommon.CommandCode.SysUptimeEvt;
}I just found this in my code. It's been there for years.
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
-
missing else? Don't you just love scoping braces.
Software Kinetics - Dependable Software news
I did this once in c++, took very long to figure out:
if (condition);
{}
____________________________________________________________ Be brave little warrior, be VERY brave
-
if (_Uptime != null)
{
_Uptime.Remove(TraCommon.Tokens.TraService_Speed);
}
{
_Uptime = new Service.Message();
_Uptime.Code = SysCommon.CommandCode.SysUptimeEvt;
}I just found this in my code. It's been there for years.
Software Zen:
delete this;
Would have been obvious in VB.NET.