Absolutely. I've actually had to work with someone I knew was cheating in school and they couldn't code their way out of a pile of leaves, let alone a wet paper sack.
They got the grades because they cheated. They got the job because they got the grades. Eventually, they were among the first to get the layoff because B and C students like me just plain outperformed them day in and day out on the job.
Years ago I worked as a developer for a subsidiary of Fujitsu. One day a colleague asked for my help.
The crux of the problem was that he was unfamiliar with the concept of a 'while' loop. Not the specific implementation in the language he was using, but the actual concept itself. He had some kind of computer science degree and he'd been working in the same team as me, as a developer, for at least two years.
It took me a while to realise what the problem was, as it never occurred to me that he might be unfamiliar with basic control flow. He sheepishly explained that the bulk of his degree was coursework (presumably he got some 'help') and that he'd been hammering square blocks into round holes for the last couple of years. From what I recall, whenever a while loop was appropriate he'd instead use a for loop with an extremely high upper limit and a break condition.
If you want to see his head explode try to explain for each.
Please come from again? (Which by the grammar-error equivalent of Godwin's Law, is almost certainly not the grammatically correct Intercal [wikipedia.org] that I intend.)
by Anonymous Coward writes:
on Friday February 12, 2010 @10:59AM (#31113022)
Usually makes sense to establish what CS is in any article headline to establish defined context.
So it used to be a lot easier to cheat in CS. I used to use an old wallhack that I hex edited and was able to use for years without detection. When they switched from WON to Steam, it all became harder.
Yup. Although, come to think of it, the WHILE loop tests its condition before executing, not after. DO...WHILE is not quite the same as WHILE...LOOP. The inside of the loop has to be written slightly differently and you may need to ensure that it won’t run through once anyway if the condition is initially false.
Which is kind of the point of a do while, to force it to run at least once. You use a while if you want it completely conditional, Do While if you want it to run at least once and then check the condition.
No, for (;condition;) is a while, not a do..while.
As I said up higher in this thread, the middle argument is a LOOP INVARIANT. This means that it is always true for the inside of the loop block, unless you change it, in which case the loop will terminate when the propulsion statement is evaluated.
If you don't want the loop to be run the first time if the condition is initially false.. why would you use a do..while loop instead of a regular while loop?
> In fact, some of the examples given, a for loop would had been much more appropriate since it used a counter inside of the while loop to control its exit e.g., while ( x > 1 ).... if ( y == foobar ) x = 0; else// do something
Why not simply
while (x > 1 && y == foobar) or
if (y == foobar) break; ?
Years ago I worked as a developer for a subsidiary of Fujitsu. One day a colleague asked for my help.
The crux of the problem was that he was unfamiliar with the concept of a 'while' loop. Not the specific implementation in the language he was using, but the actual concept itself. He had some kind of computer science degree and he'd been working in the same team as me, as a developer, for at least two years.
It took me a while to realise what the problem was, as it never occurred to me that he might be unfamiliar with basic control flow. He sheepishly explained that the bulk of his degree was coursework (presumably he got some 'help') and that he'd been hammering square blocks into round holes for the last couple of years. From what I recall, whenever a while loop was appropriate he'd instead use a for loop with an extremely high upper limit and a break condition.
I'm sad to say that I've encountered the same situation several times where someone that is supposed to be a CS grad (or what should be a junior/senior CS student) is lacking in something fundamental. Sometimes it is in things that are not so obvious (but should be) such as not knowing what an interface or abstract class is for or thinking that procedural programming means "programming with GOTO statements", or simply not knowing what structured programming really is.
I actually used to do in something similar in an interpreted language (I won't name names).
This: For i=32767, i=i+1, i 32767
{statements} EndFor
would run much faster than this: While True
{statements} EndWhile
The token check to evaluate True took the interpreter longer than adding 1 to i which would overflow each time i reached 32767 and checking it was less than 32767.
Holy crap. That's amazing. Sure, it's amazing that somebody could go that long being functionally illiterate in the computer language, but even moreso it's amazing that he understood FOR loops but not WHILE loops! If anything, a WHILE loop is perfectly plain, it does precisely what it says it does; whereas a FOR loop is something that needs five seconds of explanation for a newb. Also, ferkrisake, he couldn't google "while loop"?
I had a similar experience with a co-worker who had an MSc in CS (from U. of Windsor, Ontario). "Stack, stack! What's all this about stack?" he impatiently groused to me one day during a work conversation. I pulled him into a back room (because I was embarassed for him) and explained to him what a stack was.
Who cheats who (Score:5, Insightful)
Re: (Score:5, Interesting)
Absolutely. I've actually had to work with someone I knew was cheating in school and they couldn't code their way out of a pile of leaves, let alone a wet paper sack.
They got the grades because they cheated. They got the job because they got the grades. Eventually, they were among the first to get the layoff because B and C students like me just plain outperformed them day in and day out on the job.
Re:Who cheats who (Score:5, Interesting)
Years ago I worked as a developer for a subsidiary of Fujitsu. One day a colleague asked for my help.
The crux of the problem was that he was unfamiliar with the concept of a 'while' loop. Not the specific implementation in the language he was using, but the actual concept itself. He had some kind of computer science degree and he'd been working in the same team as me, as a developer, for at least two years.
It took me a while to realise what the problem was, as it never occurred to me that he might be unfamiliar with basic control flow. He sheepishly explained that the bulk of his degree was coursework (presumably he got some 'help') and that he'd been hammering square blocks into round holes for the last couple of years. From what I recall, whenever a while loop was appropriate he'd instead use a for loop with an extremely high upper limit and a break condition.
Re:Who cheats who (Score:4, Funny)
Re: (Score:2)
even better, give him some list comprehensions or some functional language stuff, pref. with some closures thrown in for a good measure
Re: (Score:1)
Or recursion.
Re:Who cheats who (Score:5, Funny)
Re: (Score:1)
And then....
Stack Overflow...
Re: (Score:1)
Re:Who cheats who (Score:4, Funny)
Re:Who cheats who (Score:5, Funny)
Re: (Score:1, Funny)
break
Re: (Score:1, Funny)
Or recursion [youtube.com]
Re: (Score:2)
Stack Overflow.
Droping to debugger.
Re: (Score:2)
Please come from again?
(Which by the grammar-error equivalent of Godwin's Law, is almost certainly not the grammatically correct Intercal [wikipedia.org] that I intend.)
Journalism (Score:5, Funny)
Usually makes sense to establish what CS is in any article headline to establish defined context.
So it used to be a lot easier to cheat in CS. I used to use an old wallhack that I hex edited and was able to use for years without detection. When they switched from WON to Steam, it all became harder.
You meant computer science?
Re:Journalism (Score:4, Funny)
I thought the same thing and I never even played CS.
Re: (Score:2)
He did. But what I can't figure out is what the hell you were talking about.
Re: (Score:2)
Take your pick. [wikipedia.org]
Re: (Score:1)
Re: (Score:2)
That’s actually quite funny, because if he understood the for loop properly he’d have known that a “while” condition is simply this:
for (; condition == true; ) {
}
Re: (Score:2)
You are absolutely correct, of course.
The for-loop (in C) is actually the embodiment of the computer science loop concept:
Anybody who does not understand this does should have their CS degree taken away.
The OP's moronic cow-irker clearly only understands the FOR..NEXT loop from BASIC.
Re: (Score:2)
Yup. Although, come to think of it, the WHILE loop tests its condition before executing, not after. DO...WHILE is not quite the same as WHILE...LOOP. The inside of the loop has to be written slightly differently and you may need to ensure that it won’t run through once anyway if the condition is initially false.
Re: (Score:2)
Which is kind of the point of a do while, to force it to run at least once. You use a while if you want it completely conditional, Do While if you want it to run at least once and then check the condition.
Re: (Score:2)
What I meant to say was that for (; condition; ) is a do...while, not a while.
Re: (Score:2)
No, for (;condition;) is a while, not a do..while.
As I said up higher in this thread, the middle argument is a LOOP INVARIANT. This means that it is always true for the inside of the loop block, unless you change it, in which case the loop will terminate when the propulsion statement is evaluated.
Re: (Score:2)
You’re right. For some reason I was thinking that it was only checked after the propulsion statement is executed...
Re: (Score:2)
Re: (Score:2)
Because all you know how to use is a for. ;)
Re: (Score:1)
Wow... just uhhh wow... how can such a thing happen.
while(1) doesNotCompute();
Re: (Score:2)
> In fact, some of the examples given, a for loop would had been much more appropriate since it used a counter inside of the while loop to control its exit e.g., while ( x > 1 ) .... if ( y == foobar ) x = 0; else // do something
Why not simply
while (x > 1 && y == foobar)
or
if (y == foobar) break;
?
Break is nice...
Re: (Score:2)
Would that be goto with tags, or line numbers?
Oh, how I miss goto's with line numbers. :)
[sarcasm off]
Re: (Score:2)
You know, there are probably a whole lot of people who have no idea what we're talking about..
instead of this:
it would be written like this (stolen from Wikipedia [wikipedia.org])
professors cheat unqualified/non-talented students (Score:3, Interesting)
Years ago I worked as a developer for a subsidiary of Fujitsu. One day a colleague asked for my help.
The crux of the problem was that he was unfamiliar with the concept of a 'while' loop. Not the specific implementation in the language he was using, but the actual concept itself. He had some kind of computer science degree and he'd been working in the same team as me, as a developer, for at least two years.
It took me a while to realise what the problem was, as it never occurred to me that he might be unfamiliar with basic control flow. He sheepishly explained that the bulk of his degree was coursework (presumably he got some 'help') and that he'd been hammering square blocks into round holes for the last couple of years. From what I recall, whenever a while loop was appropriate he'd instead use a for loop with an extremely high upper limit and a break condition.
I'm sad to say that I've encountered the same situation several times where someone that is supposed to be a CS grad (or what should be a junior/senior CS student) is lacking in something fundamental. Sometimes it is in things that are not so obvious (but should be) such as not knowing what an interface or abstract class is for or thinking that procedural programming means "programming with GOTO statements", or simply not knowing what structured programming really is.
In other cases, the deficiency is gra
Re: (Score:3, Interesting)
I actually used to do in something similar in an interpreted language (I won't name names).
This:
For i=32767, i=i+1, i 32767
{statements}
EndFor
would run much faster than this:
While True
{statements}
EndWhile
The token check to evaluate True took the interpreter longer than adding 1 to i which would overflow each time i reached 32767 and checking it was less than 32767.
Re: (Score:3, Insightful)
Re: (Score:2)
Holy crap. That's amazing. Sure, it's amazing that somebody could go that long being functionally illiterate in the computer language, but even moreso it's amazing that he understood FOR loops but not WHILE loops! If anything, a WHILE loop is perfectly plain, it does precisely what it says it does; whereas a FOR loop is something that needs five seconds of explanation for a newb. Also, ferkrisake, he couldn't google "while loop"?
It's almost unbelievable!
Re: (Score:3, Interesting)
You must be talking about the guy who wrote this code:
http://thedailywtf.com/Articles/Break-Out.aspx [thedailywtf.com]
Re: (Score:3, Interesting)
I had a similar experience with a co-worker who had an MSc in CS (from U. of Windsor, Ontario).
"Stack, stack! What's all this about stack?" he impatiently groused to me one day during a work conversation.
I pulled him into a back room (because I was embarassed for him) and explained to him what a stack was.
Re: (Score:1)
Well, why is while( expr == true ) fundamentally better than for( ; expr == true ; )?
Other than while is just shorter and reads better... they both do the same.
Re: (Score:2)
To be pedantic, there is actually no difference between a for loop with no incremental operator, and a while loop.
IE, this:
for( ; blah ; ) { // do stuff
blah = false;
}
Is the same as this:
while( blah ) { //do stuff
blah = false;
}
And this:
for( bool blah = true; blah ; ) { // do stuff