|
At least it probably wasn't copied and pasted from an example on a disk that came with a book.
|
|
|
|
|
More proof that an idiot can write bad code in any language - not just VB.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
|
More proof that an idiot can make any language look like VB...
----
It appears that everybody is under the impression that I approve of the documentation. You probably also blame Ken Burns for supporting slavery.
--Raymond Chen on MSDN
|
|
|
|
|
eunderwo00 wrote: private integer inc(integer int_i)
And what language is this, btw? Looks like C# or Java except for the integer type which is VB-like.
|
|
|
|
|
I would have to see the rest of their work before deciding, unless they where expected to work alone.
A degree does not guarantee that someone is a programmer, only that they are capable of learning. Until recently I did not have a degree and I have been a programmer for years. I did already have an associates degree in electronics, but I was not a technician long enough to claim it as a profession.
Here is an idea: Give them a personality test, that way you will have a better idea of how good a programmer they have the potential of becoming.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
I didn't consider the possibility, maybe he just had a brain fart? I can remember writing what i was thinking one or two times. Granted he SHOULD have read over his code before presenting it... I can say I've presented code to my boss without fully testing it out of stupid young confidence.
|
|
|
|
|
Bunch of bruts aren't you. Have some mercy for the young and inexperienced. In my work I sometimes see more creative work from people you would have fired.
|
|
|
|
|
That was more than a brain fart, but it would have done what it was designed to do. It was just a foolish thing to do.
I have never had a boss that could really understand the code without me explaining it to him. Matter of fact I cust one for saying I did not understand the question, when the fact was he did not understand the answer. Of course they had just hired him and he eventialy learned that I knew what I was doing.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
Did you offer him/her constructive criticism?
Otherwise they'll continue writing bad code. IMHO it's not really bad code as from what I can tell it looks valid. More bad practice, which is something only experience can teach you - at least osmething that trivial as I don't think Fowler, etc address those kind of design choices. :P
I'm finding the only constant in software development is change it self.
|
|
|
|
|
Hockey wrote: Did you offer him/her constructive criticism?
It doesn't sound like he did. In a few posts in this thread, I've been mentioning it...
|
|
|
|
|
eunderwo00 wrote: I hired a programmer right out of school.
Right out of Jr. High? How did the "programmer" pass his classes with skills like that?
█▒▒▒▒▒██▒█▒██
█▒█████▒▒▒▒▒█
█▒██████▒█▒██
█▒█████▒▒▒▒▒█
█▒▒▒▒▒██▒█▒██
|
|
|
|
|
Captain See Sharp wrote: How did the "programmer" pass his classes with skills like that?
To me this code shows that the programmer does not know c++ java or has not used it in a very long time.
Last modified: 2hrs 11mins after originally posted --
John
|
|
|
|
|
John M. Drescher wrote: To me this code shows that the programmer does not know c++ java or has not used it in a very long time.
Well, I starting learning C when I was 13. The increment and decrement operators are almost impossible to forget. There are many things about the C family of languages that really stick.
█▒▒▒▒▒██▒█▒██
█▒█████▒▒▒▒▒█
█▒██████▒█▒██
█▒█████▒▒▒▒▒█
█▒▒▒▒▒██▒█▒██
|
|
|
|
|
I think he should be informed of his mistake, encouragement might help him to overcome his deficiencies.
A.A.
asif
|
|
|
|
|
|
So what is wrong with it?
Use of private before a return declaration?
I'm unfamiliar with this syntax. In C++, private and public are used in the class declaration, not the function definitions.
|
|
|
|
|
eunderwo00 wrote: private integer inc(integer int_i)
{
integer int_j=int_i+1;
return int_j;
}
Ok this is an unnecessary function but what is the reason you let him go?
CleaKO
"I think you'll be okay here, they have a thin candy shell. 'Surprised you didn't know that.'" - Tommy (Tommy Boy) "Fill it up again! Fill it up again! Once it hits your lips, it's so good!" - Frank the Tank (Old School)
|
|
|
|
|
I'm wondering if he wrote additional functions for the remaining operators.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
I can only think that int_j should be explicitly assigned a value at declaration, before actual use in case int_i is passed unassigned, hence :
private integer inc(integer int_i)
{
integer int_j=0;
int_j=int_i+1;
return int_j;
}
|
|
|
|
|
sprint_sport wrote: I can only think that int_j should be explicitly assigned a value at declaration, before actual use in case int_i is passed unassigned, hence :
private integer inc(integer int_i)
{
integer int_j=0;
int_j=int_i+1;
return int_j;
}
Integers by default are 0 when declared just as booleans are false, strings are nothing, etc...
CleaKO
"I think you'll be okay here, they have a thin candy shell. 'Surprised you didn't know that.'" - Tommy (Tommy Boy) "Fill it up again! Fill it up again! Once it hits your lips, it's so good!" - Frank the Tank (Old School)
|
|
|
|
|
It was about to become really costful, as he was paid on the number of lines he was writing. He even managed to write wrappers over each native Win32 API, even the ones he was not using, just to charge more... And above this, he planned to rewrite Windows in a VM !
That's an explanation, find more
Kochise
In Code we trust !
|
|
|
|
|
|
Kochise wrote: he was paid on the number of lines he was writing
Oh, no! You're working in a place that measures code by the yard, and then complain that somebody fresh out of the egg is - well let's say a little uncertain in their grasp of fundamentals. Get a grip!
Frankly, I'd have fired others, starting (in the very first femtosecond) with the guy who instigated the fatuous "quantity rather than quality" regime, continuing with whoever did the hiring (since this job apparently called for an accurate, experienced programmer), and possibly with whoever did the firing (though that may have been for factors other than the predictable howlers from a coding tyro).
Kochise wrote: He even managed to write wrappers over each native Win32 API, even the ones he was not using
Did they work? That's moderately sophisticated for a kid straight out of school. This sounds to me like someone who, with a modicum of sympathetic mentoring obviously not available in your shop, could well turn into a real code warrior.
Oh, and what was the kid's supervisor doing while he did all this apparently unnecessary work? Think I'll add him to the firing line as well.
|
|
|
|
|
Regarding the language used by the programmer. I don't see anything bad with the code, at least he had the concept of private. Also this in reality doesn't speak so good from you and not from the "programmer right out from school".
Are many thing to take in consideration. He probably thought it will impress you doing this, or he didn't realize what he did. Also one of the obligation of seasoned Developers, is help the new generations to going the right direction.
Are thousands more other aspects that I take in consideration to say if someone it's or not a good programmer, than simple review his code.
|
|
|
|