|
|
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.
|
|
|
|
|
GTuritto wrote: I don't see anything bad with the code,
Can you name just a single use for this function that isn't covered by the "+" operator?
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
None. It could be solved with ++ operator. But you will surprise to know how many Developers, (and some of them are really good) that I personally know that they never in their's life are used ++ and they had no idea about the ++ operator.
Now has I say before, if instead to get fuming and kick the guy out we drop our Ego has the greatest Developer's, we will realize that the idea even if it's stupid it's not bad. And before any one goes crazy here, let me explain my self. I have no idea in what context this method was, then I can't talk about this method it self.
If it was me first I will be say "What a F...", then I will have a chat with the guy asking why he did that, third I will lecture him why the method is bad, and showing to him the ++ operator, fourth I will see if we can improve the idea, or tell to the programmer to fix the little issue, fifth I will check again to see if he fixed in the right way. And last but not least, I will never, never laugh at someone in this way. All of us we did some stupid mistake like that.
Laugh at your self, not to a kid that just came out from school.
|
|
|
|
|
Not ++ it's just a + .
I now wonder why it wasn't written to take a second parameter to specify the size of the increment.
|
|
|
|
|
GTuritto wrote: It could be solved with ++ operator. But you will surprise to know how many Developers, (and some of them are really good) that I personally know that they never in their's life are used ++ and they had no idea about the ++ operator.
I, thankfully, am not one of them. I for one, as are most people, am completely satisfied with i=i+1 in the event that a ++ operator doesn't exist, in any language I use. I the consequences and performance benefits/costs of making a call to a function along with the optimizations available in todays compilers.
GTuritto wrote: If it was me first I will be say "What a F...", then I will have a chat with the guy asking why he did that, third I will lecture him why the method is bad, and showing to him the ++ operator, fourth I will see if we can improve the idea, or tell to the programmer to fix the little issue, fifth I will check again to see if he fixed in the right way.
Reading the original post, it's entirely possible that this DID occur, and he still doesn't work for the company. Maybe this person did all kinds of stupid things in his code, maybe not. We simply don't know. I know, it's no reason to be critical of it. But, we also don't know what kind of skill level assumption he was hired under either. If they were expecting higher quality work and he just couldn't deliver past high-school code, out the door he goes.
GTuritto wrote: All of us we did some stupid mistake like that.
There's a huge difference between making a stupid mistake like that and turning it in as production code. I for one, have never turned in a stupid mistake, no, let me change that, a stupid rationalisation like that! What on earth was this guy thinking when he wrote this? What's the rationale behind writing a function like this? Having said that, what's going through this guys head with the rest of the code he turned in, or will turn in in the future?
How much work are we going to now have to invest in him AND cleaning up his code. This guy wasn't ready for a full-time coding job, plain and simple. School, or his own study habits, it seems, has failed to prepare him for a real world coding job. In this cut-throat business, I don't know of too many internships that could spare the time or the resources to teach him what he should have learnt in class.
I know there's a certain minimum level of expertise you should expect of someone comming out of school, but this code sample fell WAY short of that.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Even then, why write a function to do it, he could just easily call +1 on the integer.
|
|
|
|
|
Exactly my point!
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Better still - I say get rid of the person who hired him in the
first place. At least that way you guarantee such a disaster wont
enter "the" organisation again.
|
|
|
|
|
Arash Partow wrote: I say get rid of the person who hired him in the
first place. At least that way you guarantee such a disaster wont
enter "the" organisation again.
I agree. The OP should have at least mentored him with the tech review, and if it happened again, then fire the programmer. Doesn't sound like the person was given much of a chance...
|
|
|
|
|
eunderwo00 wrote: He no longer works for the company.......
That's pretty lame of you to can him over stupid code like that. You could have at least maybe mentored him with Code Complete
|
|
|
|
|
I need sample code for Paging in ASP 3.0 for Page Break while printing the Page(Report Page developed with HTML Tables) and continuing with the Page Heading and Remaining lines in the next Page and so on for the Oncoming pages if the no of Records are more.
|
|
|
|
|
I will study the source data carefully when testing my UI!
I've just laid out a data bound WinForms form three times, the first two discarded with disgust because the databinding provided by the VS2005 wizard sucked. I was pressing back and forward on the BindingNavigator much better but the record detail was staying the same. Something was wrong, so I deleted the form and tried again from scratch. Same thing, so I try and create the whole data source again.
Then, on the third form, I notice that most of the records are for companies, who are allocated a range of phone numbers, and I have one record for each phone number, with ALL the other field values identical. then I noticed that clicking back and forward on the navigator is indeed changing records by my observation of the last digit of the phone number.
|
|
|
|
|
Thou Shalt Know Thy Incoming Data.
|
|
|
|
|
It is the little things that get you after a while!
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
A few years back, I started a consulting engagement. We took over support of all client/server programs. Get this, it was a public utility and all internal databases were in Access. Anyway, there was a large complicated program written by a non-programmer. How bad was the code?
Well, if there was more than one way to connect to a database, the "programmer" used each type. If there was more than one way to do ANYTHING, they used every method. Then, to top it off, whenever we would make a change in one section of the program (tons of SQL) then another part would break. Each time a bug would be raised, it would be a few hours for fixing, testing, and fixing the sections that should not have broke but did. We stopped answering our phones at 4pm because we wanted to go home at 5. Otherwise, we'd work into dinner time.
|
|
|
|
|
joemerchant wrote: databases were in Access
joemerchant wrote: written by a non-programmer. How bad was the code?
Who cares about the skill level of the "programmer". Being written in Access is bad enough!
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Dave Kreskowiak wrote: Being written in Access is bad enough!
Yes, being written in bad enough, but, for SOME (very few) instances, that may be the best option available. There is a missions orgnanization near me that sends people to various areas of the world - they have no computer support near by, so, simple apps are written in Access for them to use... if they have to, they can probably ZIP the files to a floppy and mail them back to the support size if a program arises.
Again, not preferable, but what is best for them.
Tim
|
|
|
|
|
vb front end, access back end...to clarify.
|
|
|
|
|
Live and learn! Programs like that is what made me so good at debugging. I was brought into a company to write a custom program and was later hired full time. One of my duties was to maintain and update their software. The first time I looked at the code I automatically wanted to rewrite it. I tried to fix the 350+ warning messages (most should have been errors), but doing so broke the code; that was out. Although I had discovered that touching a single line of code anywhere could break it, I soon learned how to modify it without breaking it.
Rule #1: Ye shall break down your code into individual stand-alone pieces, so that changing them has little or no effect on the rest.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
And yet not one word on cat skinning.
|
|
|
|
|
Trying to track down a bug. Very simple little routine calls a few methods in an old COM DLL - some calculations and look-ups, nothing too special. Problem is, it only works once - if the routine is called twice in a row, it'll fail the second time around. Same inputs, same code to create the COM object, call a few methods, finish up... it just doesn't work twice.
So, i track down the code for this old DLL. VB6, which i haven't bothered to install in years, but i don't want to rebuild it anyway unless there's no way around it. Unzip the code and start browsing through it...
...and it's all forms. Except for a couple hundred lines in a .cls file for wiring up the COM interface, it's all forms. There is absolutely no UI for this damn thing, none, it exists only for some routine calculations and to retrieve a handful of numbers from an Access database... and it's all implemented by chaining 32 different forms together along with some sort of insestual communication between them.
I feel sick.
----
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
|
|
|
|
|
Sometimes its better to just trash things and recode. You get lost in the code and take 3 times as long to get done trying to patch someone elses work. Good luck with it.
|
|
|
|
|
Sounds like something a VB programmer would do.
|
|
|
|
|