The Worst Comments

  • Jeff Moden (3/26/2015)


    ...I use whatever it takes to get the point across. At work, it's sometimes considered to be an HR violation. 😛

    My kinda guy 😀

    Gaz

    -- Stop your grinnin' and drop your linen...they're everywhere!!!

  • -- Whilst I'm a consultant named Jack

    -- I swear that I'll never be back

    -- Removing this code

    -- Causes server overload

    -- Despite you're thinking its a hack.

    See what I mean?


    My mantra: No loops! No CURSORs! No RBAR! Hoo-uh![/I]

    My thought question: Have you ever been told that your query runs too fast?

    My advice:
    INDEXing a poor-performing query is like putting sugar on cat food. Yeah, it probably tastes better but are you sure you want to eat it?
    The path of least resistance can be a slippery slope. Take care that fixing your fixes of fixes doesn't snowball and end up costing you more than fixing the root cause would have in the first place.

    Need to UNPIVOT? Why not CROSS APPLY VALUES instead?[/url]
    Since random numbers are too important to be left to chance, let's generate some![/url]
    Learn to understand recursive CTEs by example.[/url]
    [url url=http://www.sqlservercentral.com/articles/St

  • dwain.c (3/26/2015)


    -- Whilst I'm a consultant named Jack

    -- I swear that I'll never be back

    -- Removing this code

    -- Causes server overload

    -- Despite you're thinking its a hack.

    See what I mean?

    Well, quite frankly the chap's English is appalling. I mean "Despite you're thinking its a hack." Really!!! Shocking grammar. The limerick has an element of wit about it and were it not for the lack of professionalism and the total inappropriateness of it then I would have thought it a worthwhile endeavour i.e. C- for effort.

    (Now for everyone else to have a pop at my grammar!!! ;-))

    Gaz

    -- Stop your grinnin' and drop your linen...they're everywhere!!!

  • Gary Varga (3/27/2015)


    dwain.c (3/26/2015)


    -- Whilst I'm a consultant named Jack

    -- I swear that I'll never be back

    -- Removing this code

    -- Causes server overload

    -- Despite you're thinking its a hack.

    See what I mean?

    Well, quite frankly the chap's English is appalling. I mean "Despite you're thinking its a hack." Really!!! Shocking grammar. The limerick has an element of wit about it and were it not for the lack of professionalism and the total inappropriateness of it then I would have thought it a worthwhile endeavour i.e. C- for effort.

    (Now for everyone else to have a pop at my grammar!!! ;-))

    As a side note I like limericks and find their history fascinating and can be traced back to C13th.

    The standard form of a limerick is a stanza of five lines, with the first, second and fifth rhyming with one another and having three feet of three syllables each; and the shorter third and fourth lines also rhyming with each other, but having only two feet of three syllables. The defining "foot" of a limerick's meter is usually the anapaest, but catalexis (missing a weak syllable at the beginning of a line) and extra-syllable rhyme (which adds an extra unstressed syllable) can make limericks appear amphibrachic .

    But more important is the fact the vicars rhymes with knickers.

    -------------------------------Posting Data Etiquette - Jeff Moden [/url]Smart way to ask a question
    There are naive questions, tedious questions, ill-phrased questions, questions put after inadequate self-criticism. But every question is a cry to understand (the world). There is no such thing as a dumb question. ― Carl Sagan
    I would never join a club that would allow me as a member - Groucho Marx

  • Gary Varga (3/27/2015)


    dwain.c (3/26/2015)


    -- Whilst I'm a consultant named Jack

    -- I swear that I'll never be back

    -- Removing this code

    -- Causes server overload

    -- Despite you're thinking its a hack.

    See what I mean?

    Well, quite frankly the chap's English is appalling. I mean "Despite you're thinking its a hack." Really!!! Shocking grammar. The limerick has an element of wit about it and were it not for the lack of professionalism and the total inappropriateness of it then I would have thought it a worthwhile endeavour i.e. C- for effort.

    (Now for everyone else to have a pop at my grammar!!! ;-))

    Ooh, an invitation to 'have a pop' ... irresistible! Except your grammar is pretty good, damn it! Apart from missing a comma after frankly, I can find nothing wrong.

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

  • Phil Parkin (3/27/2015)


    Gary Varga (3/27/2015)


    dwain.c (3/26/2015)


    -- Whilst I'm a consultant named Jack

    -- I swear that I'll never be back

    -- Removing this code

    -- Causes server overload

    -- Despite you're thinking its a hack.

    See what I mean?

    Well, quite frankly the chap's English is appalling. I mean "Despite you're thinking its a hack." Really!!! Shocking grammar. The limerick has an element of wit about it and were it not for the lack of professionalism and the total inappropriateness of it then I would have thought it a worthwhile endeavour i.e. C- for effort.

    (Now for everyone else to have a pop at my grammar!!! ;-))

    Ooh, an invitation to 'have a pop' ... irresistible! Except your grammar is pretty good, damn it! Apart from missing a comma after frankly, I can find nothing wrong.

    [Turns chair to face the corner of the room in shame.]

    😉

    Gaz

    -- Stop your grinnin' and drop your linen...they're everywhere!!!

  • Phil Parkin (3/13/2015)


    Going off on a slight tangent, what about bad error messages?

    I've just had this one in SSIS:

    Executing the query "exec ..." failed with the following error: "Package execution failed with status: Failed

    Thanks for that.

    Oh, similar things have happened before:-

    Error name: DC_IT_WONT_WORK

    Errornumber: (I can't remember what it was)

    Associated Text: A software or hardware error occurred.

    That dates from 1976. And I have to admit it was me wot did it - I invented that message and replaced code which took the system down instantly (this for mainframes with mac and tp access as well as batch work) with code that delivered that message to whatever app made the OS call had ended up at the "let's crash the system now" code.

    Working out what was going on and causing the error was much lower priority than switching from crashing the whole system to just slapping the app. The message you quote may have had a similar excuse.

    Tom

  • dwain.c (3/26/2015)


    Gary Varga (3/26/2015)


    dwain.c (3/25/2015)


    ...I beginning to think that when I wrote this article (based on a quotation from Jeff):

    Make it Work, Make it Fast, Make it Pretty[/url]

    Maybe I should have entitled it" Make it Work, Make it Fast, Make it Pretty... and then Comment the Crap out of it."

    No!!! "Make it Work, Make it Fast, Make it Pretty... whilst commenting the Crap out of it." would be much better 😉

    I personally love that word whilst but at a guess Jeff being American would never use it.

    Nothing to do with being American. He wouldn't use it because what he'd say is:

    "Comment how to Make it Work, Make it Fast, and Make it Pretty and then write the code you commented"

    Tom

  • ChrisM@Work (3/26/2015)


    mister.magoo (3/26/2015)


    ChrisM@Work (3/26/2015)


    Phil Parkin (3/26/2015)


    dwain.c (3/26/2015)


    Gary Varga (3/26/2015)


    dwain.c (3/25/2015)


    ...I beginning to think that when I wrote this article (based on a quotation from Jeff):

    Make it Work, Make it Fast, Make it Pretty[/url]

    Maybe I should have entitled it" Make it Work, Make it Fast, Make it Pretty... and then Comment the Crap out of it."

    No!!! "Make it Work, Make it Fast, Make it Pretty... whilst commenting the Crap out of it." would be much better 😉

    I personally love that word whilst but at a guess Jeff being American would never use it.

    I'm British and I don't use it either 🙂

    Whilst, betwixt and amongst are in the same family of words, so unless you are prepared to use all of them (ie, don't use 'whilst' and then 'among' in the same document), it is more consistent to use none.

    I'd almost agree with this. Whilst and amongst don't appear to me to be uncommon, unless it's the HR folks I spend too much time listening to. Betwixt sounds too much like confectionary nowadays to be taken seriously. Who amongst us would dare?

    Whom amongst us??

    Unbeknownst to us, we have grammar police in our midst.

    what, grammar police? I've only seen a grammar violator - using "whom" for nominative case indeed, if we had any grammar police he be in the interrogationinterview room now.

    Incidentally, I sometimes use "betwixt" - but only in the phrase "betwixt and between", where it's redundant but can sometimes sound nice. Never yet in a code comment though.

    Somewhat more on topic: I disagree with those who think all commented out code is bad; there are several cases where it's rather useful: case (i): there are two ways of doing it, and one way is right for you current situation (data size, throughput requirement, required concurrency of access, and so on) but won't work well when requirements get a bit heavier and additional hardware capability is available; the other will be good when the requirements get a bit heavier, but is not suitable for use on the currently available hardware and is therefor commented out with appropriate comments indicating the situation. case (ii): the board of directors is engaged in internecine strife, and there are two versions of the requirement; we have code for both versions; the one that is currently losing at the board meetings is the one that's commented out. case (iii): we have two algorithms, both of which work well on small scale problems but we will have to handle large scale problems in future; we intend to switch back and forth between the two algorithms as and when larger scale instances become available until we've collected enough performance data to tell us which one will be best in the long term. There are probably plenty more cases.

    In none of these cases is more than a single procedure call or function call commented out - both procedures/functions are included in every build, but only one of them will be used.

    We have no desire to have a parameter which chooses which code to use, that just hands users a chance to screw things up.

    I've experienced. or been told about someone elses experience of, all three of my examples. Yes, this could be done without commented out code, but it would be a lot more error-prone: it is obvious to developers changing the not currently commented out code that they have to look at whether they should be switching to the commented out code instead or should be modifying the commented out code as well (and testing it and getting it through QA) according to the reasons for the changes, wheras if it's buried in documentation somewhere the current out version may be out of date and/or devlopers may end up re-inventing the current out version at far greater cost than just doing a switch.

    Tom

  • -- Do some magic

  • Nevyn (3/30/2015)


    -- Do some magic

    This reminded me of a comment I used to use as an "off-limits marker" in the old days

    /* HC SVNT DRACONES */

    😎

  • -- Some nitwit posting under the moniker of Dwain.C with a big fish for an avatar

    -- gave me this code on a SQL forum.

    -- Call him if it doesn't work.

    Now that's scary!

    Haven't gotten any calls yet though.


    My mantra: No loops! No CURSORs! No RBAR! Hoo-uh![/I]

    My thought question: Have you ever been told that your query runs too fast?

    My advice:
    INDEXing a poor-performing query is like putting sugar on cat food. Yeah, it probably tastes better but are you sure you want to eat it?
    The path of least resistance can be a slippery slope. Take care that fixing your fixes of fixes doesn't snowball and end up costing you more than fixing the root cause would have in the first place.

    Need to UNPIVOT? Why not CROSS APPLY VALUES instead?[/url]
    Since random numbers are too important to be left to chance, let's generate some![/url]
    Learn to understand recursive CTEs by example.[/url]
    [url url=http://www.sqlservercentral.com/articles/St

  • Oddly enough, my boss loves how I comment my code (even though I worry that I may over-comment at times).

    There was one change that the BU kept asking us to make to a piece of code, it would fail in test (because the destination system wasn't set up correctly) and we'd have to pull the code. For some reason, I marked that section with a comment the first time this happened. Turned out to be a good thing because it then happened two more times (a year apart) which I also dated and commented. The fourth time the BU made the request, I was out of the office and the boss took a look at my proc to see why the request was coming in again (hadn't Brandie coded this already?).

    He read my comments and immediately pushed the request back to the business saying "Not until Department X fixes their crap. Resubmit then."

    But, here's the template we use:

    CREATE PROC / FUNCTION MyName

    AS

    /*---------------------------------------------------------

    Description: This proc was created to pull the XYZ records into a neat

    and pleasing format to be ETLed over to Dept Y for X feed.

    Install DB: MyDatabase3

    Created: 2015.04.07 / Brandie / MyTicket#

    Version History:

    <insert date, dev initials, Ticket #s along with notes on changes>

    ---------------------------------------------------------*/

    BEGIN

    --code gets inserted here and if it's complex (like mine tends to be)

    --different blocks and variables get commented individually

    END

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

  • Jeff Moden (3/13/2015)


    Gary Varga (3/13/2015)


    I was going to try and say "no comment" in a witty way but as I am not first to highlight the issue (and I am not always that witty) I shan't bother. Instead I have the following anecdote:

    I have recently worked with people who have analysed code because of the lack of documentation (i.e. no specification and limited/poor/non-existent comments) and made paper notes then augmented the code with their own uncommented code. Muppets.

    I've run into that many times, as well. I love it when someone spends two days analyzing some nasty, large, totally uncommented code and it turns out that same way when they're done. I just don't understand it.

    There are <redacted> about who honestly believe their code being a stinking pile is a form of job security. Comments are often limited to

    -- This bit's really clever / complicated

    <badly formatted snakepit of cursors, temp tables and names like #A, @var etc>

    I'm a DBA.
    I'm not paid to solve problems. I'm paid to prevent them.

  • I came across a stored procedure recently where there were 2 developers clearly arguing

    we didn't have source control for sql at the time of the argument (way before I started) and all dev work was on the live server, so all code changes were commented out as a rollback strategy (sigh)

    the comments went something like this...

    /*

    Fixed Jan 20 2011 -Dave Jones

    Rolled back Jan 21 2011 fix did not work

    Reimplemented fix -Dave Jones

    Rolled back

    Reimplemented because some idiot keeps rolling it back without telling us why. please do not change this code -Dave Jones

    rolled back because some idiot cant code

    */

    it went on for about 20 lines without any indication of what the fix was, or what the defect was

    MVDBA

Viewing 15 posts - 121 through 135 (of 156 total)

You must be logged in to reply to this topic. Login to reply