|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Friday, July 20, 2012 1:47 PM
Points: 3,
Visits: 35
|
|
It's one thing to not spout off on code as a consultant, as steveb mentioned. But to argue against criticizing code at all smacks of the "we are all winners, everyone's idea is as good as any other" school of thought that is the enemy of quality.
If you want to talk about humility, I think there is a need for humility on the code writer's part. I've run into MANY developers who code in Frankenstein's Lab, keeping their code secret because they do not want external criticism of their code before it's set in deadline-driven stone.
What is needed is for developers to have the humility to put their rough sketches of a code design before their peers BEFORE it's written and say, "This is what I'm thinking, see if you can punch holes in it or think of a better way of doing it."
Because at the end of the day, the goal should be to develop the best code/design possible, not to be the sole originator of the idea.
So sorry, if someone comes out of Frankenstein's Lab with a piece of junk code, I'm going to call it out. I recently ran into this situation and was able to rewrite the code in 5 hours, leading to an 80% decrease in data access and runtime.
Rereading the article, it's clear that the author is coming from a consultant's viewpoint. And I think that's a really important detail: You have to be tactful as a consultant. But you can still criticize tactfully. If the original coder is available, they can explain valid reasons for the tortured approach which will help inform your work. If they were just a bad coder (or inexperienced at the time the code was written), the discussion can validate trying to refactor the code into shape, while at the same time educating the coder on a better design.
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Today @ 7:03 AM
Points: 1,355,
Visits: 1,739
|
|
Reminds me of the time, back in 1993 (in a world far, far away, in a different programming language), of having to figure out a program in which the author used the variable names a, b, c, d, e,... s, t - literally! Took me a LONG time to figure out what he was doing. I did know who the programmer was, and he had left the company, and all I really cared about was trying to reproduce the results for a client. (The programmer was well-respected, and I wasn't going to dis him.) (I did rename all those variables and added comments by the time I was done.)
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Saturday, November 12, 2011 10:55 AM
Points: 1,
Visits: 4
|
|
| i totally disagree with your observation. if the code is poorly written no matter what the circumstances were, there is no point in muddling through bad code to fix it. you will simply be wasting time fixing in one place and breaking it somewhere else. and also bad code is not testable. if you are given the task of maintaining such horrendous code, take the time to reverse engineer and re-factor and re-write the piece which needs immediate attention from inside out and at the same time make sure that the new code is testable too. if the new code is not testable a unit at a time that means you still have a "code smell".
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Thursday, April 18, 2013 5:18 AM
Points: 32,
Visits: 407
|
|
| Most idiotic editorial I've ever seen.
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Friday, July 20, 2012 1:47 PM
Points: 3,
Visits: 35
|
|
| Ouch, it's starting to get ugly here...
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Today @ 7:33 AM
Points: 5,103,
Visits: 20,213
|
|
|
|
|
|
SSC-Insane
         
Group: General Forum Members
Last Login: Today @ 4:09 AM
Points: 21,357,
Visits: 9,539
|
|
bitbucket-25253 (11/13/2011)
sherifffruitfly (11/13/2011) Most idiotic editorial I've ever seen.I hope your comment was made as a joke, for it was not ....
That would be called self fulflling prophecy
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Wednesday, February 22, 2012 11:15 PM
Points: 130,
Visits: 404
|
|
Hi Phil
Nice editorial, sort of follows on from your piece "Never offend a captive audience"
Personally I am happy to receive the criticism.
Anyone interested in criticising my code - please feel free to take a shot. If it is cheap, duck. If constructive, I am grateful for the chance to learn, and take the knowledge so gained to the next task with thanks.
Those arrogant enough to think that they were perfect when they started out in IT, I would rather not know; if they can't accommodate the lack of experience in others, I have no time for them. For those who think they are perfect now, good luck.
For the rest of us, well I for one know that I still have much to learn. That is why I use SQLServerCentral. That's why I like to see a better way of doing something than the way I that came to mind for me. I enjoy the learning.
I rarely get the opportunity to criticise, but my biggest bugbear is a lack of commentary. I really like knowing what is going on...
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Today @ 9:21 AM
Points: 1,300,
Visits: 3,893
|
|
Thanks for the article Phil.
I agree that bad criticism along the lines of "oh wow! look what this idiot did!" is not helpful and just shows you up as ignorant.
There are many reasons why non-optimal code is written in whichever environment - and unfortunately, unless you know the author really well, there is usually no way to know the reasons why it happened.
I would say there is definitely one exception to this though : when a mate that you know is competent writes some stinking code - in this case you should go for it - they deserve it and so do you!
One other exception: If I answer a question on SSC and my answer is incorrect or less than optimal, I would worry if it was not criticised - after all, that is the best thing about these forums - the group review.
MM
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Saturday, March 03, 2012 4:24 AM
Points: 8,
Visits: 15
|
|
| Having been writing code for over 30 years, some of it good, some of it less so, I know there would be times that a consultant could justify critising my code, but I also know that unless done at the time the code is written, there is no point in critizing it. If the code does not work, say so, if circumstances have changed, and there is now a better way of achieving an outcome, say so, but never critise the coder. They may have moved on from coding and be a fantasic PM, they may be related to the person talking to you, they may just have been having a bad day when it was written, or they may have been working with code from an even older legacy system, the reasons for bad code are numerous. When I started it was immperative to reuse variables for something else to save the few bytes of memory (and tape) having another one would use-- Today, that looks like bad coding!
|
|
|
|