|
|
I aimed in a program to check that if x = y
I wrote it as : If x<>y
I reviewed the code and ran the program, but it didn’t work. After several tries I went back to the code. I surprised how I wrote this when I intended the opposite.
|
|
|
|
|
I've done worse, even commented what was supposed to happen, something like:
void adjustBalance(boolean credit, long amount)
{
if (amount > 0)
{
adjustBalance(!credit, -amount);
}
}
speramus in juniperus
|
|
|
|
|
Don't give DD ideas.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
It was actually in a retail banking system.
speramus in juniperus
|
|
|
|
|
Nagy Vilmos wrote: void adjustBalance(boolean credit, long amount)
Why, you must work for the US Govt! I think they have code like that for balancing the budget.
Marc
|
|
|
|
|
I've done worse (as have most people) in C / C++:
if (a = b)
... Or
a == b * 3;
You do feel a right fool when you finally spot it. Normally after a few hours of head scratching...and swearing, of course.
The only instant messaging I do involves my middle finger.
English doesn't borrow from other languages.
English follows other languages down dark alleys, knocks them over and goes through their pockets for loose grammar.
|
|
|
|
|
Both caught by warnings, I think. But, hell, who looks at warnings ?
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
Do not feed the troll ! - Common proverb
|
|
|
|
|
|
That's at least one good thing about Delphi (and Pascal in general).
:= is assignment.
= is equivalence.
Lots of other things you can screw up but not the assignment vs equivalence error.
|
|
|
|
|
Tarek Elqusi wrote: <>
This tells a lot about it...
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
Do not feed the troll ! - Common proverb
|
|
|
|
|
|
Really ? Cool. You must be the first person I came across with to use it.
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
Do not feed the troll ! - Common proverb
|
|
|
|
|
Its normal it happens with best programmers, have a
|
|
|
|
|
We've all done something like that.... But usually you swap > and < ....
There are no secrets to success. It is the result of preparation, hard work, and learning from failure. Colin Powell
|
|
|
|
|
I do that all the time. Which is why I always test code like that extensively.
|
|
|
|
|
I've commented before on my brother's habit of having bits of his rotting bonce lopped off to stop him over thinking. Well he went to have a check up and the rot has returned, by the end of the week they'll start his next round of treatment; as yet undecided between chemo and more surgery. He and his family are pretty cut up as they thought he was clear. Mum is very low too.
All I can say is Elephant You Cancer! With a big rusty stick!
speramus in juniperus
|
|
|
|
|
I once had a school mate with brain tumors. He died in the 4th grade because of it.
A very nasty thing... I hope it doesn't destroy your brother completely
I wish your brother all the best and your family the strength needed to overcome those bad times
|
|
|
|
|
+1 for the rusty stick, I hope you are all strong - cancer is a c**t.
We can’t stop here, this is bat country - Hunter S Thompson RIP
|
|
|
|
|
Hopefully he started off with a good, high IQ...
Seriously: good luck to him, and your whole family - it's never easy when you have such big worries over a family member. Hoping it all works out well.
The only instant messaging I do involves my middle finger.
English doesn't borrow from other languages.
English follows other languages down dark alleys, knocks them over and goes through their pockets for loose grammar.
|
|
|
|
|
OriginalGriff wrote: Hopefully he started off with a good, high IQ...
Not really, I believe the term is sick as thig pit.
His best hope is that he started off very fit and strong. He would regularly, 3-4 days per week, cycle 20-30 miles each way for work and go for 100 plus mile rides at the weekend.
speramus in juniperus
|
|
|
|
|
Cancer is a slow and painful murderer that I hate with all my guts.
I wish the best to you and your family, and everyone else out there that's affected.
The reasonable man adapts himself to the world; the unreasonable man adapts the world to himself.
Therefore all progress depends on the unreasonable man.
- George Bernard Shaw
|
|
|
|
|
... and replying to the wrong post is a cancer in waiting.
Ta though. Mum is in remission from both breast and skin cancer, and her father had throat cancer; though he outlived it. Luckily, I'm a Leo.
speramus in juniperus
|
|
|
|
|
Sorry, the subject numbs my brain a bit.
I meant it in earnest though even if it got sent to the wrong address.
The reasonable man adapts himself to the world; the unreasonable man adapts the world to himself.
Therefore all progress depends on the unreasonable man.
- George Bernard Shaw
|
|
|
|
|
Thanks - but it's Nagys brother, not mine (We have had our Big C troubles: it killed Dad when I was eleven, and Mum about 5 years ago)
The only instant messaging I do involves my middle finger.
English doesn't borrow from other languages.
English follows other languages down dark alleys, knocks them over and goes through their pockets for loose grammar.
|
|
|
|