|
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[ ^]
|
|
|
|
|
What's the problem? He didn't use a Magic Number!
If you get an email telling you that you can catch Swine Flu from tinned pork then just delete it. It's Spam.
|
|
|
|
|
private long _remainder = long.parse(0.ToString());
Would have been better
|
|
|
|
|
This is correct implementation:
int tryCounter = 0;
x:
if(!long.TryParse("0", out _remainder) && (tryCounter < 100)) {
tryCounter++;
goto x;
}
else if(!long.TryParse("0", out _remainder) && (tryCounter > 100)){
_remainder = 0;
}
else{
}
"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!
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.
|
|
|
|
|
RugbyLeague wrote: Would have been better
What do you think about this?
private long _remainder = long.parse(((long)0).ToString());
ProgramFOX
|
|
|
|
|
public void WriteCode(ICodeContext ctx)
{
throw new BrainNotFoundException();
}
Bob Dole The internet is a great way to get on the net.
2.0.82.7292 SP6a
|
|
|
|
|
Nice!
|
|
|
|
|
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
|
|
|
|
|
I got the same kind of code a few lines earlier!
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.
|
|
|
|
|
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.
|
|
|
|