On reviewing a colleagues’ code recently I suggested he might want to change the name of his SortAndDelete sub to something that more accurately described what it did.
My proposal was FuckEverythingRightUp!
His response? That was meant to be a one time use system, the user had reloaded it with data of a very different structure.
My reply? if it was one time use then he should have run it and given the user the results only. Sods Law dictates that everything you give to your users(/customers) will be brutally abused and destroyed with no mercy.
He then pointed out he was trying to fix something I wrote a while ago that was initially quick and dirty fix, but was at that moment just dirty, and broken.
I asked what the comments said (comments are vital to quality code). He confirmed there was a
‘// sm 2010 quick and dirty bodge
comment, which I believe is better than a get out of gaol (jail) free card.
He also pointed out another of my comments from a while ago on a different system, he was now handholding:
‘// sm 2009 please god don’t let this bag of shite still be live in 2011.
Like I said comments are vital to back covering.
What’s the funniest, most inappropriate comment you have seen/written?
(I’m not sure if I should mention the dictionary object one of my colleagues used, using correct reddick tlp:
Dim dicHead as Scripting.Dictionary)
cheers
Simon
Monday, 12th December, 2011 at 2:06 am |
People writing the checks don’t care about this. It sounds like the guy is tyring to gainsay your work for his immediate masters. I don’t know your world, but you should not let a mental midget like this get the better of you.
Monday, 12th December, 2011 at 8:02 am |
I also have an AutoDeleteRows sub within my list of scripts for general use. Our attempt at limiting its potential misuse was to ensure that the database started in cell $A$1.
The script is 7 years old but I think the original concept was that (within Excel) a managed database would probably start outside the first cell in order to offer a separate title of heading.
This is not realy secure. I’ve often thought that the function should automatically take a copy of the datalist and work on that.
As regards code comments. I almost never use them in my own code. If I can’t read and understand it (7 years later) then it was no good in the first place.
Monday, 12th December, 2011 at 3:38 pm |
Stephen you are a smarter man than I if you can recall your own code that quickly. I’m a “casual coder” and I comment extensively.
My favorite comment I found in some SQL code was something like:
–WTF?! Why do my customer counts not match? Who are these extra people?
and then later in the code:
–Oh, I see. They are from the future. Let’s kill them, shall we?
(A few bad dates crept into the DB from client at some point, so we had a small number of customers whose first purchase was in 2020.)
Monday, 12th December, 2011 at 9:04 pm |
Surely, those sort of comments are exactly what brings comments into disrepute.
Monday, 12th December, 2011 at 6:20 pm |
“(comments are vital to quality code).”
:Thank you :-)
Wednesday, 14th December, 2011 at 12:15 am |
I hope you realise I was being sarcastic, comments are for back covering and rude jokes. Worse than useless for code quality.
Wednesday, 14th December, 2011 at 12:29 pm
Well I admit that I thought that you had turned. You should have saved it for a few months.
Wednesday, 14th December, 2011 at 4:38 pm
I know he was, but it was too good an opportunity to miss a quote out of context. Like those theatre reviews that say “This is a great show compared to a poke in the eye with a short stick” and only the first bit gets quoted ;-)
Tuesday, 13th December, 2011 at 10:32 am |
I once saw an error routine that consisted of a comment line that read
‘ This is a really good routine
and had three blank lines and no code.
As a factual statement the comment wasn’t wrong but I’ll leave my real thoughts on this for you all to imagine.
Tuesday, 13th December, 2011 at 11:03 am |
A colleague showed me a comment at the end of several pages of dynamic SQL construction Access VBA code he was maintaining.
‘ If you got this far, it must have worked