Found this little gem in one of the applications
-
private long _remainder = long.parse("0");
I wish I knew who wrote this. I would have recommended
TryParse
to him. ;)"Bastards encourage idiots to use Oracle Forms, Web Forms, Access and a number of other dinky web publishing tolls.", Mycroft Holmes[^]
private long _remainder = long.parse(0.ToString());
Would have been better
-
private long _remainder = long.parse("0");
I wish I knew who wrote this. I would have recommended
TryParse
to him. ;)"Bastards encourage idiots to use Oracle Forms, Web Forms, Access and a number of other dinky web publishing tolls.", Mycroft Holmes[^]
:doh:
public void WriteCode(ICodeContext ctx)
{
throw new BrainNotFoundException();
}Bob Dole
The internet is a great way to get on the net.
:doh: 2.0.82.7292 SP6a
-
private long _remainder = long.parse(0.ToString());
Would have been better
This is correct implementation:
int tryCounter = 0; // I hope this will work
x:
if(!long.TryParse("0", out _remainder) && (tryCounter < 100)) {
tryCounter++;
goto x;
}
else if(!long.TryParse("0", out _remainder) && (tryCounter > 100)){
_remainder = 0;
}
else{
// Oh my God, what should I do now?
}"Bastards encourage idiots to use Oracle Forms, Web Forms, Access and a number of other dinky web publishing tolls.", Mycroft Holmes[^]
-
private long _remainder = long.parse("0");
I wish I knew who wrote this. I would have recommended
TryParse
to him. ;)"Bastards encourage idiots to use Oracle Forms, Web Forms, Access and a number of other dinky web publishing tolls.", Mycroft Holmes[^]
-
private long _remainder = long.parse(0.ToString());
Would have been better
RugbyLeague wrote:
Would have been better
What do you think about this?
private long _remainder = long.parse(((long)0).ToString());
ProgramFOX
-
private long _remainder = long.parse("0");
I wish I knew who wrote this. I would have recommended
TryParse
to him. ;)"Bastards encourage idiots to use Oracle Forms, Web Forms, Access and a number of other dinky web publishing tolls.", Mycroft Holmes[^]
I would suggest the following:
private long _remainder = (long)int.parse((0).ToString());
CQ de W5ALT
Walt Fair, Jr., P. E. Comport Computing Specializing in Technical Engineering Software
-
This is correct implementation:
int tryCounter = 0; // I hope this will work
x:
if(!long.TryParse("0", out _remainder) && (tryCounter < 100)) {
tryCounter++;
goto x;
}
else if(!long.TryParse("0", out _remainder) && (tryCounter > 100)){
_remainder = 0;
}
else{
// Oh my God, what should I do now?
}"Bastards encourage idiots to use Oracle Forms, Web Forms, Access and a number of other dinky web publishing tolls.", Mycroft Holmes[^]
Finally someone using TryParse correctly! ;P
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station.... _________________________________________________________ My programs never have bugs, they just develop random features.
-
private long _remainder = long.parse("0");
I wish I knew who wrote this. I would have recommended
TryParse
to him. ;)"Bastards encourage idiots to use Oracle Forms, Web Forms, Access and a number of other dinky web publishing tolls.", Mycroft Holmes[^]
I got the same kind of code a few lines earlier! ;p Extract from the code I'm working on[^]
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station.... _________________________________________________________ My programs never have bugs, they just develop random features.
-
I got the same kind of code a few lines earlier! ;p Extract from the code I'm working on[^]
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station.... _________________________________________________________ My programs never have bugs, they just develop random features.
-
Never underestimate the idiocy of the programmer who came before you. Otherwise, you'll always be surprised by how stupid they can be.
I will not underestimate it again!! ^^
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station.... _________________________________________________________ My programs never have bugs, they just develop random features.
-
I will not underestimate it again!! ^^
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station.... _________________________________________________________ My programs never have bugs, they just develop random features.
-
Super Lloyd wrote:
I will not underestimate it again
OK, I fess up. I have been surprised by the stupid programmer before me when that programmer was me. :)
Haha.. I should be wary of that one too indeed!! ^^
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station.... _________________________________________________________ My programs never have bugs, they just develop random features.