Huh... that's odd...
-
This is from the documentation of
HashSet<T>.Contains
private static bool isEven(int i)
{
return ((i % 2) == 1);
}In this case I would suggest renaming it to IsNotEven :)
A while ago he asked me what he should have printed on my business cards. I said 'Wizard'. I read books which nobody else understand. Then I do something which nobody understands. After that the computer does something which nobody understands. When asked, I say things about the results which nobody understand. But everybody expects miracles from me on a regular basis. Looks to me like the classical definition of a wizard.
-
PIEBALDconsult wrote:
: Huh... that's odd...
Clever! Even I can see that.
_____________________________________ Action without thought is not action Action without emotion is not life
megaadam wrote:
PIEBALDconsult wrote: : Huh... that's odd... Clever! Even I can see that.
That's better that even odds! :-D
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke -
In this case I would suggest renaming it to IsNotEven :)
A while ago he asked me what he should have printed on my business cards. I said 'Wizard'. I read books which nobody else understand. Then I do something which nobody understands. After that the computer does something which nobody understands. When asked, I say things about the results which nobody understand. But everybody expects miracles from me on a regular basis. Looks to me like the classical definition of a wizard.
CDP1802 wrote:
In this case I would suggest renaming it to IsNotEven
Or
IsNotEleven
! :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke -
Actually not. For a beginner something like this is not easy to spot. Once they do, they will have learned that you may never go on assumptions and always must check even the simplest things to make certain that they work as they should. Crappy programmers are those who are totally resistant to learning from their mistakes.
A while ago he asked me what he should have printed on my business cards. I said 'Wizard'. I read books which nobody else understand. Then I do something which nobody understands. After that the computer does something which nobody understands. When asked, I say things about the results which nobody understand. But everybody expects miracles from me on a regular basis. Looks to me like the classical definition of a wizard.
-
Actually not. For a beginner something like this is not easy to spot. Once they do, they will have learned that you may never go on assumptions and always must check even the simplest things to make certain that they work as they should. Crappy programmers are those who are totally resistant to learning from their mistakes.
A while ago he asked me what he should have printed on my business cards. I said 'Wizard'. I read books which nobody else understand. Then I do something which nobody understands. After that the computer does something which nobody understands. When asked, I say things about the results which nobody understand. But everybody expects miracles from me on a regular basis. Looks to me like the classical definition of a wizard.
-
In this case I would suggest renaming it to IsNotEven :)
A while ago he asked me what he should have printed on my business cards. I said 'Wizard'. I read books which nobody else understand. Then I do something which nobody understands. After that the computer does something which nobody understands. When asked, I say things about the results which nobody understand. But everybody expects miracles from me on a regular basis. Looks to me like the classical definition of a wizard.
Or Mod2Equals1. Better that the method remain anonymous.
-
This is from the documentation of
HashSet<T>.Contains
private static bool isEven(int i)
{
return ((i % 2) == 1);
}I use this:
private bool IsEven(int value)
{
return (value & 1) == 0;
}So the creationist says: Everything must have a designer. God designed everything. I say: Why is God the only exception? Why not make the "designs" (like man) exceptions and make God a creation of man?
-
I use this:
private bool IsEven(int value)
{
return (value & 1) == 0;
}So the creationist says: Everything must have a designer. God designed everything. I say: Why is God the only exception? Why not make the "designs" (like man) exceptions and make God a creation of man?
Exactly.
-
Actually not. For a beginner something like this is not easy to spot. Once they do, they will have learned that you may never go on assumptions and always must check even the simplest things to make certain that they work as they should. Crappy programmers are those who are totally resistant to learning from their mistakes.
A while ago he asked me what he should have printed on my business cards. I said 'Wizard'. I read books which nobody else understand. Then I do something which nobody understands. After that the computer does something which nobody understands. When asked, I say things about the results which nobody understand. But everybody expects miracles from me on a regular basis. Looks to me like the classical definition of a wizard.
CDP1802 wrote:
Crappy programmers are those who are totally resistant to learning from their mistakes.
I completely agree. Mistakes are just hurdles on the path to excellence. The people who will eventually achieve exellence will learn how to jump the hurdles, all the others will simply say to themselves... "f!ck this" and go get a beer... :).
Mark Brock Click here to view my blog
-
CDP1802 wrote:
Crappy programmers are those who are totally resistant to learning from their mistakes.
I completely agree. Mistakes are just hurdles on the path to excellence. The people who will eventually achieve exellence will learn how to jump the hurdles, all the others will simply say to themselves... "f!ck this" and go get a beer... :).
Mark Brock Click here to view my blog
MarkBrock wrote:
"f!ck this" and go get a beer...
If it is just a pause to get distant and turn back afterwards to continue facing the problem from other perspective is not a bad issue. But if it is the last action... then I am agree with you :P
Regards. -------- M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you “The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson Rating helpfull answers is nice, but saying thanks can be even nicer.
-
This is from the documentation of
HashSet<T>.Contains
private static bool isEven(int i)
{
return ((i % 2) == 1);
}I did this for months after I started teaching myself visual basic, I would compare boolean object properties to TRUE.
If (checkbox1.checked = true) then
Needless to say how stupid I felt when I realised what I was doing :|
-
This is from the documentation of
HashSet<T>.Contains
private static bool isEven(int i)
{
return ((i % 2) == 1);
}Hmmm, I always thought it should be along the lines of:
private static bool isEven(int i) { return ((i % 1) == 0); }
"The clue train passed his station without stopping." - John Simmons / outlaw programmer "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon