Are You Proud of Your Code? 682
An anonymous reader writes "I am downright embarrassed by the quality of my code. It is buggy, slow, fragile, and a nightmare to maintain. Do you feel the same way? If so, then what is holding you back from realizing your full potential? More importantly, what if anything are you planning to do about it? I enjoy programming and have from a young age (cut my teeth on BASIC on an Apple IIe). I have worked for companies large and small in a variety of languages and platforms. Sadly the one constant in my career is that I am assigned to projects that drift, seemingly aimlessly, from inception to a point where the client runs out of funding. Have any developers here successfully lobbied their company to stop or cut back on 'cowboy coding' and adopt best practices? Has anyone convinced their superiors that the customer isn't always right and saying no once in awhile is the best course of action?"
This Should Explain It (Score:2, Funny)
This post [slashdot.org] should explain it. If you think hiring practices are discriminatory for minorities, try being like me!
Cherish YOUR THUMBS!
Happy with mine (Score:1, Funny)
Re:Something to note about other people's opinions (Score:5, Funny)
Worse Than Failure (Score:3, Funny)
That said, I do revisit code that I'd written a few years back and think "WTF were you thinking?!"
Lost out (Score:5, Funny)
Edsger Dijkstra
Sorry mate, there is no hope
Re:Something to note about other people's opinions (Score:5, Funny)
CalcCallWaitingTime StripIllegalCharacters CreateInterfaceToACD DrawCalendarOutline may well be quite a long title ( often it's easier to acronymise them before I hand the code over ) but it's amazing the number of loops you can reuse if you have enough switches.
Re:Something to note about other people's opinions (Score:5, Funny)
That way you only need to create a single do loop and allow your cx(...) sub (result passed back in the 14th argument unless the 3rd is "E" or above in which case its pushed onto the reference you passed as arg[19 + val(arg4)].
The last guy who tried to use the code was so awestruck with my genius he passed out!
Yes (Score:5, Funny)
Re:Something to note about other people's opinions (Score:5, Funny)
You should realise that programming is an art. In art school what you''re referring to is called a critique. It's a good thing. From an old tome I wrote about ten years ago, Steve's School of Fine Art [mcgrew.info]:
-mcgrew
Condsidering the subject matter, every comment on this story should be modded "flamebait".
Always write code... (Score:5, Funny)
Re:Something to note about other people's opinions (Score:4, Funny)
A: 10. 1 to change the bulb, and 9 to say "no, I would have done it like this..."
For me, this is part of the "Is programming is a science or an art?" argument. You can send a person to Art College and then have them paint for 10 years, and even then they won't necessarily produce masterpieces. Sometimes we comment like that on code we've taken over, because it really is awful...
Re:Something to note about other people's opinions (Score:3, Funny)
Re:Something to note about other people's opinions (Score:3, Funny)
Everybody does it, from companies big to hobbyists small, so therefore a university cannot possibly allow it.
Re:Something to note about other people's opinions (Score:5, Funny)
# Les gars sont agiles droite. Si le code est écrit Bien, il va parler pour lui-même.
# Il n'ya pas besoin de Double emploi avec ce que dit le code dans une autre
# langue (Anglais). C'est peu comme votre commentant Anglais paragraphes d'une
# interprétation française. À moins français est votre langue maternelle c'est
# juste aller Pour obtenir de la manière et de rendre la lecture de la même Anglais
# Plus difficile. Comme un programmeur, c'est mon travail d'être Parle couramment le
# langage de programmation de mon choix. Reading Code devrait être aussi simple que de lire un livre.
The agile guys are right. If the code is written well, it will speak for itself. There's no need to
duplicate what the code says in another language (i.e. english). It's kind of like commenting your
english paragraphs with a french interpretation. Unless french is your native tongue it's just going
to get in the way and make reading the english even more difficult. As a programmer, it's my job to
be fluent in my programming langauge of choice. Reading code should be as easy as reading a book.
# Cela dit, parfois, vous avez vraiment à écrire Quelque chose d'anormal, et, dans ce cas, vous devriez
# Commentaire. Toutefois, ces cas sont rares Entre.
That said, sometimes you really do have to write something abnormal, and in those cases you should
comment it. However, those instances are few and far between.
Re:The normal response of an inexperienced program (Score:1, Funny)
LOGDIR=/opt/oracle/logs
cd ${LOGDIR}
rm -rf *
The above ran as root. I'm hardly a graybeard programmer, but that just gave me chills because they wanted me to help with the code.
Ah, kids these days... (Score:4, Funny)
I remember one piece of code that makes even that seem tame. Assembly, mind you, back in the 386 days.
Someone had calculated something as a 4 byte float, then took it as a 32-bit integer, swapped the higher and lower 16-bit words, wrote it into a memory location at the start of a function, and then actually jumped to that location. I.e., he actually executed that result. That was actually in the (uncommented) assembly source code, mind you, not some accidentally disasssembling a piece of the data segment and discovering that it makes no sense.
To this day, I have no clue what that did. Awestruck is putting it mildly.
Re:Sorry, I have to bite about this. (Score:5, Funny)
No, programming is like sex. Make one mistake and you end up supporting it the rest of your life.