Are the posted questions getting worse?

  • Eirikur Eiriksson (11/12/2015)


    MUST Resist...temptation...bad...joke!!

    😎

    I'm not sure about the bad joke, but I couldn't resist posting. :pinch:

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • Luis Cazares (11/12/2015)


    Eirikur Eiriksson (11/12/2015)


    MUST Resist...temptation...bad...joke!!

    😎

    I'm not sure about the bad joke, but I couldn't resist posting. :pinch:

    Think English sarcasm mixed with Icelandic frigid humor:-D

    😎

    Must resist.......

    SELECT STUFF(I.T,1,5,'UP') FROM my... AS I.............

    ouch........

  • Grant Fritchey (11/12/2015)


    jasona.work (11/12/2015)


    BrainDonor (11/12/2015)


    My Grandmother had an expression, when she thought somebody was being really lazy - "Sit down and I'll walk around for you" - http://www.sqlservercentral.com/Forums/Topic1735905-392-1.aspx#bm1735907

    I just glanced at the pop-up summary and the title, and my first thought was "homework."

    It's almost tempting to take some time one evening for one of these (I think) fairly obvious homework questions, to come up with the most complicated, hard to read, redundant, confusing, redundant, obfuscated queries possible, that still returns the expected results.

    But my time is worth more than trolling someone like that...

    Still, could be fun. Build out a nested CTE inside a function, use the same table aliases over and over, don't format the code. It'll be impossible to read.

    Also, you need temp tables. When (im)properly used they can be a wonderful aid to writing eye-bleeding obfuscated ****. Particularly beauties like one I found in a codebase once

    create table #tmp(a varchar, b varchar, c varchar)

    created with a select into - then re-used for something else later on in the proc.

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

  • I would just like to say, that I've always admired the people that are willing to publish articles on this site.

    Now that I've faced the editor for this, I really admire those people...

    It reminds me of WordPerfect for DOS, but it isn't as much fun.

  • Brandie Tarvin (11/12/2015)


    Oh, I comment the crap out of my stuff. I've got one proc that has almost 2 pages worth of version history comments (if I printed it out in Word). But it's so complicated with all the business rules it still sometimes takes me an hour or two to trace through the code to explain to the BU why it treated certain data in a specific way.

    And when they ask me to make changes... YIKES. Talk about cascade effect.

    A nice way to comment code is on a wiki.

    The current page has the relevant current information. You can see the historical pages for the earlier versions.

    412-977-3526 call/text

  • BrainDonor (11/13/2015)


    I would just like to say, that I've always admired the people that are willing to publish articles on this site.

    Now that I've faced the editor for this, I really admire those people...

    It reminds me of WordPerfect for DOS, but it isn't as much fun.

    I wasn't very good with it, Luckily for me Steve really helped me a lot.

  • BL0B_EATER (11/13/2015)


    BrainDonor (11/13/2015)


    I would just like to say, that I've always admired the people that are willing to publish articles on this site.

    Now that I've faced the editor for this, I really admire those people...

    It reminds me of WordPerfect for DOS, but it isn't as much fun.

    I wasn't very good with it, Luckily for me Steve really helped me a lot.

    I found that having everything ready on a Word document helps a lot. After that, it's just adding tags like any post in the forums. It'd be great to see a preview of the article before submitting it.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • Luis Cazares (11/13/2015)


    BL0B_EATER (11/13/2015)


    BrainDonor (11/13/2015)


    I would just like to say, that I've always admired the people that are willing to publish articles on this site.

    Now that I've faced the editor for this, I really admire those people...

    It reminds me of WordPerfect for DOS, but it isn't as much fun.

    I wasn't very good with it, Luckily for me Steve really helped me a lot.

    I found that having everything ready on a Word document helps a lot. After that, it's just adding tags like any post in the forums. It'd be great to see a preview of the article before submitting it.

    The Word document definitely helped. Using the header levels made it pretty simple. Aside from the forum-specific tags that Luis mentioned, I had to upload images and move them around. While it definitely has some shortcomings, it really isn't bad for an online editor.

  • Jack Corbett (11/12/2015)


    Sean Lange (11/12/2015)


    Brandie Tarvin (11/12/2015)


    Sean Lange (11/12/2015)


    djj (11/12/2015)


    Grant Fritchey (11/12/2015)


    Still, could be fun. Build out a nested CTE inside a function, use the same table aliases over and over, don't format the code. It'll be impossible to read.

    Sounds like any program I have written and come back to after six months. 😀

    Oh good...it isn't just my code then. 😉

    My boss has looked at some of the convoluted stuff I've written and come back to ask "Why did you code it like that?"

    My response is "Because it works."

    He really doesn't have a response to that 90% of the time. @=)

    That sounds like the conversations I have with myself when cracking open code I haven't seen in a few months. 😀

    "Why did I write this like this? What the #$@% was I thinking? Oh well, it works."

    Y'all are driving me nuts with this. This is why you put in comments on WHY you did it the way you did it, so when you go back you at least know the original reason.

    But then the comments will be so convoluted that you can't understand them at all, and will make it even harder to understand the code.

    Anyway the real question should be WHY is Sean looking at it if "Oh well, it works." is correct?

    Tom

  • TomThomson (11/13/2015)


    Jack Corbett (11/12/2015)


    Sean Lange (11/12/2015)


    Brandie Tarvin (11/12/2015)


    Sean Lange (11/12/2015)


    djj (11/12/2015)


    Grant Fritchey (11/12/2015)


    Still, could be fun. Build out a nested CTE inside a function, use the same table aliases over and over, don't format the code. It'll be impossible to read.

    Sounds like any program I have written and come back to after six months. 😀

    Oh good...it isn't just my code then. 😉

    My boss has looked at some of the convoluted stuff I've written and come back to ask "Why did you code it like that?"

    My response is "Because it works."

    He really doesn't have a response to that 90% of the time. @=)

    That sounds like the conversations I have with myself when cracking open code I haven't seen in a few months. 😀

    "Why did I write this like this? What the #$@% was I thinking? Oh well, it works."

    Y'all are driving me nuts with this. This is why you put in comments on WHY you did it the way you did it, so when you go back you at least know the original reason.

    But then the comments will be so convoluted that you can't understand them at all, and will make it even harder to understand the code.

    Anyway the real question should be WHY is Sean looking at it if "Oh well, it works." is correct?

    I can only say that often times you end up looking at code near the code that makes you scratch your head because you need to figure out what is causing something to happen. I am speaking more of application code than t-sql which is generally far less convoluted.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

  • Sean Lange (11/13/2015)


    TomThomson (11/13/2015)


    Jack Corbett (11/12/2015)


    Sean Lange (11/12/2015)


    Brandie Tarvin (11/12/2015)


    Sean Lange (11/12/2015)


    djj (11/12/2015)


    Grant Fritchey (11/12/2015)


    Still, could be fun. Build out a nested CTE inside a function, use the same table aliases over and over, don't format the code. It'll be impossible to read.

    Sounds like any program I have written and come back to after six months. 😀

    Oh good...it isn't just my code then. 😉

    My boss has looked at some of the convoluted stuff I've written and come back to ask "Why did you code it like that?"

    My response is "Because it works."

    He really doesn't have a response to that 90% of the time. @=)

    That sounds like the conversations I have with myself when cracking open code I haven't seen in a few months. 😀

    "Why did I write this like this? What the #$@% was I thinking? Oh well, it works."

    Y'all are driving me nuts with this. This is why you put in comments on WHY you did it the way you did it, so when you go back you at least know the original reason.

    But then the comments will be so convoluted that you can't understand them at all, and will make it even harder to understand the code.

    Anyway the real question should be WHY is Sean looking at it if "Oh well, it works." is correct?

    I can only say that often times you end up looking at code near the code that makes you scratch your head because you need to figure out what is causing something to happen. I am speaking more of application code than t-sql which is generally far less convoluted.

    Unless you are having to write dynamic SQL (often) due to the design of the system you are working with and really not in a position to effect any significant changes to the schema (think government contracted software development).

  • Sean Lange (11/13/2015)


    TomThomson (11/13/2015)


    Jack Corbett (11/12/2015)


    Sean Lange (11/12/2015)


    Brandie Tarvin (11/12/2015)


    Sean Lange (11/12/2015)


    djj (11/12/2015)


    Grant Fritchey (11/12/2015)


    Still, could be fun. Build out a nested CTE inside a function, use the same table aliases over and over, don't format the code. It'll be impossible to read.

    Sounds like any program I have written and come back to after six months. 😀

    Oh good...it isn't just my code then. 😉

    My boss has looked at some of the convoluted stuff I've written and come back to ask "Why did you code it like that?"

    My response is "Because it works."

    He really doesn't have a response to that 90% of the time. @=)

    That sounds like the conversations I have with myself when cracking open code I haven't seen in a few months. 😀

    "Why did I write this like this? What the #$@% was I thinking? Oh well, it works."

    Y'all are driving me nuts with this. This is why you put in comments on WHY you did it the way you did it, so when you go back you at least know the original reason.

    But then the comments will be so convoluted that you can't understand them at all, and will make it even harder to understand the code.

    Anyway the real question should be WHY is Sean looking at it if "Oh well, it works." is correct?

    I can only say that often times you end up looking at code near the code that makes you scratch your head because you need to figure out what is causing something to happen. I am speaking more of application code than t-sql which is generally far less convoluted.

    Crystal clear like something along these lines?

    😎

  • Eirikur Eiriksson (11/13/2015)


    Sean Lange (11/13/2015)


    TomThomson (11/13/2015)


    Jack Corbett (11/12/2015)


    Sean Lange (11/12/2015)


    Brandie Tarvin (11/12/2015)


    Sean Lange (11/12/2015)


    djj (11/12/2015)


    Grant Fritchey (11/12/2015)


    Still, could be fun. Build out a nested CTE inside a function, use the same table aliases over and over, don't format the code. It'll be impossible to read.

    Sounds like any program I have written and come back to after six months. 😀

    Oh good...it isn't just my code then. 😉

    My boss has looked at some of the convoluted stuff I've written and come back to ask "Why did you code it like that?"

    My response is "Because it works."

    He really doesn't have a response to that 90% of the time. @=)

    That sounds like the conversations I have with myself when cracking open code I haven't seen in a few months. 😀

    "Why did I write this like this? What the #$@% was I thinking? Oh well, it works."

    Y'all are driving me nuts with this. This is why you put in comments on WHY you did it the way you did it, so when you go back you at least know the original reason.

    But then the comments will be so convoluted that you can't understand them at all, and will make it even harder to understand the code.

    Anyway the real question should be WHY is Sean looking at it if "Oh well, it works." is correct?

    I can only say that often times you end up looking at code near the code that makes you scratch your head because you need to figure out what is causing something to happen. I am speaking more of application code than t-sql which is generally far less convoluted.

    Crystal clear like something along these lines?

    😎

    Yeah that would fall outside of the "generally less convoluted" category and would need some comments. :-D:-D Well done on that one!!!

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

  • Whhoooo!!!

    *I* nearly got singed by this reply: http://www.sqlservercentral.com/Forums/FindPost1736339.aspx

    Not that I blame Jeff, he's probably had the "joy" of interviewing people like the OP...

  • jasona.work (11/13/2015)


    Whhoooo!!!

    *I* nearly got singed by this reply: http://www.sqlservercentral.com/Forums/FindPost1736339.aspx

    Not that I blame Jeff, he's probably had the "joy" of interviewing people like the OP...

    I'm curious... How did you almost get singed by my response?

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 15 posts - 51,361 through 51,375 (of 66,712 total)

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