Ask Slashdot: How Can I Explain To a Coworker That He Writes Bad Code? 683
An anonymous reader writes "I have a coworker who, despite being very smart, and even very knowledgeable about software, writes the most horrible code imaginable. Entire programs are stuffed into single functions, artificially stretched thanks to relentless repetition; variable and class names so uninformative as to make grown men weep; basic language features ignored, when they could make everything shorter and more readable; and OOP abuse so sick and twisted that it may be considered a war crime. Of course, being a very smart person who has been programming since before I was born makes him fairly impervious to criticism, so even a simple 'Do you see how much better this function is when written this way?' is hopeless. How can I make him see the light, realize the truth, and be able to tell good code from bad?"
Re:You don't (Score:5, Funny)
Nobody puts Baby in a corner....
Ok ok (Score:5, Funny)
I GET IT!!! My code sucks. You have made this clear. You don't have to start posting on forums you know I read. Sheesh....
Criticism should be handled delicately... (Score:5, Funny)
Leave him an anonymous poem:
Roses are red,
Violets are blue;
The C obfuscation contest produces bad code,
And so do you.
Provide and solicit feedback. (Score:5, Funny)
For example, you tell him his code code not functional or elegant, and then, you ask him what he thinks about that.
And then you write the goddamn login page yourself.
While you're at it... (Score:5, Funny)
My suggestion. (Score:5, Funny)
To worker: "You write bad code."
See, by choosing the right language for the problem, the solution was very simple. And I did it with just four keywords plus one terminator!
The best approach is persuasion: high school style (Score:2, Funny)
Simply get a group of tough guys together, wait for him after work, drag him into an alley and make him understand. Works every time.
Does the guy really qualify as seasoned? (Score:4, Funny)
Look at Linus (Score:5, Funny)
Submit the best examples to TheDailyWTF (Score:5, Funny)
Re:You don't (Score:5, Funny)
if his attitude is like some of my coworkers, he's no doubt asking his management why the junior engineers aren't rewriting his code to make it efficient while he tackles the big problems more suitable to his seniority.
Re:You don't (Score:5, Funny)
Help him get promoted to "Software Architect" and get him out of the coding business.
Re:You don't (Score:5, Funny)
I can tell you are humble just by reading your Nick.
Re:You don't (Score:5, Funny)
Sometimes, subtlety is overrated.
"John, that piece of code smells worse than your uncle's codpiece (which I wish you would stop wearing to work), and in reviewing it I can deduce that your parents were never formally introduced."
Re:You don't (Score:5, Funny)
"If I'm senior coder, than that means I set the standard."
Your standard for if/then statements must be delightful.