|
love the sig!
WarePhreak
Programmers are tools to convert caffiene to code.
|
|
|
|
|
Thanks. I just wonder where all this will end. Today there are many more users, but they have even less knowledge than many users in 'the good old days'. But that does not keep them from thinking that everything can be done with the wave of a hand. Perhaps some already think that you need some kind of mystic powers to get those machines going
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.
|
|
|
|
|
What I find even worse are some of those same users who have some "tool" (i.e. Access) that they believe makes them a programmer. And then you look at what they've done and it is magic it even works.
WarePhreak
Programmers are tools to convert caffiene to code.
|
|
|
|
|
This ensures the real type to be returned (bool )
if (first > second)
return true;
else
return false;
while this returns the result type of >, which may not be bool (in C for instance, there is no such thing as bool , and if you create your own bool type, you cannot force > to return "your" bool , hence a necessary cast to avoid a level 4 warning for casting an int on an unknown type):
return first > second;
Plus returning the result of an operation is forbidden by some standards in embedded code, for instance (MISRA).
~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
|
|
|
|
|
Writing such a function is non-sense.
Instead: CheckValue(first, second)
write: (first > second)
Greetings from Germany
|
|
|
|
|
che3358 wrote: Folks like this way because it is better
why is it better?
Yusuf
|
|
|
|
|
Actually, you should scope it with parens:
return (first > second);
On the other hand, why write a function that does that when you could eliminate the overhead and stack usage by doing the comparison in the calling function?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
int j=0;
for (int i=0; i < a.length; ++i) {
j++;
}
System.out.println("array size=" + j);
|
|
|
|
|
That's a masterpiece! Did your boss coded it?
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
|
|
|
|
|
CPallini wrote: Did your boss coded it?
That is why he is a boss!
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
Definitely.
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
|
|
|
|
|
Nope, that's from a '20 year experienced' java developer. Found it in a still running webservice which receives orders from our website. This guy is no longer employed, but we have a lot of fun with his work.
|
|
|
|
|
darth_bug wrote: java developer
That explains everything.
Mostly, when you see programmers, they aren't doing anything. One of the attractive things about programmers is that you cannot tell whether or not they are working simply by looking at them. Very often they're sitting there seemingly drinking coffee and gossiping, or just staring into space. What the programmer is trying to do is get a handle on all the individual and unrelated ideas that are scampering around in his head. (Charles M Strauss)
|
|
|
|
|
That explains the speed and at the same time why JRE is taking so much of RAM.....
|
|
|
|
|
20 years "experience" means also 20 years of not getting a promotion (getting boss or manager)
By the way I have also a lot of "experience" in that way...
Greetings from Germany
|
|
|
|
|
Now you have me confused. Does this not show the correct array size when it is run?
Seriously, who knows what he thought he was doing. Sometimes everyone does not see the forest anymore because of all the trees. Things like that have happened to me, usually after editing the code several times in a hurry, leaving senseless relics like this appears to be.
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: Does this not show the correct array size when it is run
Actually, it does. But I think the probability that j is equal to a.length at the end of the loop is very high.
~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
|
|
|
|
|
I sure know that. Irony does not communicate well in a post ))
To me it just looks like the loop previously contained some code which got edited away, leaving this construction. Even then, using the counter variable may be a valid, but not very wise choice.
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: Does this not show the correct array size when it is run?
never ever trust CLR. Who knows if it right about the array size...
Yusuf
|
|
|
|
|
Hahaha, classic
|
|
|
|
|
Yeah, we can only hope you don't trust the processor to handle your computations either - I made that mistake a long time ago. I handle all of mine now at the binary level.
|
|
|
|
|
Now that you mention it... taken to the extreme this means building your own processor from discrete parts, building the rest of the computer the same way around it and then starting on an own operating system. This will be one slow and bulky contraption, so much is sure.
Never trust a computer that you have not personally misconstructed and misprogrammed, like in the good old days.
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.
|
|
|
|
|
Reminds me of "The story of Mel" :
I had been hired to write a Fortran compiler for this new marvel and Mel was my guide to its wonders. Mel didn't approve of compilers.
"If a program can't rewrite its own code," he asked, "what good is it?"
|
|
|
|
|
if (Session["UserID"] != null && Session["UserID"].ToString() == "administrator")
{
adminRight = "W";
}
return adminRight;
well first of all if it's UserID i expect it to be number,
ok somebody squeezed here 'administrator' nice job. Another thing is if userID == 'administrator'
it cant be in any case at the same time null.
|
|
|
|
|
The rest of the code may be pretty dumb but checking for null first is good coding. Of course, you wouldn't realise that if you were VB coder.
Phil
The opinions expressed in this post are not necessarily those of the author, especially if you find them impolite, inaccurate or inflammatory.
|
|
|
|