Ask Slashdot: How Can I Explain To a Coworker That He Writes Bad Code?
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?"
Nobody puts Baby in a corner....
Irony? Yea, it's like goldy and bronzy, only it's made of iron!
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....
Leave him an anonymous poem:
Roses are red,
Violets are blue;
The C obfuscation contest produces bad code,
And so do you.
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.
Why don't you convince him to start using deodorant, shave his neckbeard, and start dating a supermodel?
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!
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.
Pretty good is actually pretty bad.
For example, nothing was said about GOTOs being liberally sprinkled throughout the code. If he's working in a non-optimal language that doesn't support GOTO, he should try hacking in the functionality with preprocessor defines. Maybe even hack in a preprocessor if the language designer forgot one, or add another preprocessor if not. With a few stacked preprocessors one can even write his own (better) computer language, and what seasoned programmer doesn't aspire to have one or two of those under his belt?
Try not. Do or do not, there is no try.
-- Dr. Spock, stardate 2822-3.
Didn't Linus set an example just a few days back?
And send him the link.
I eat only the real part of complex carbohydrates.
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.
Help him get promoted to "Software Architect" and get him out of the coding business.
Never answer an anonymous letter. - Yogi Berra
I can tell you are humble just by reading your Nick.
Sierra Tango Foxtrot Uniform
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."
Do not mock my vision of impractical footwear
"If I'm senior coder, than that means I set the standard."
Your standard for if/then statements must be delightful.
We know where leadership by an anti-intellectual "strongman" who scapegoats minorities and likes boisterous rallies goes