Do You Want to Be Right?

  • Jeff,

    You should not get upset anyway. Just do what you have done, mentor those who come ask for help. You have helped me learn better ways to do things. I approach my SQL coding tasks in much different way than I did at my previous employer (which is also before I started visiting SSC on a regular basis).

    As I said, most people I have talked to learned to write SQL from books. The books teach the "crap" you try to change. All you can hope for is to find more converts to better ways of doing things, and hope they are successful in spreading the word as well.

    And for those who refuse to learn, then you make money off of fixing their "crap".

    😎

  • Thanks for the leg up, Lynn.:)

    --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)
    Intro to Tally Tables and Functions

  • For all those who don't like the chair analogy, perhaps we ought to come up with an alternative.

    An SSC member starts putting together a Question of the Day, and, halfway through, realises he could phrase it better.....

    OK, perhaps not. 😉

    Semper in excretia, sumus solum profundum variat

  • Jeff Moden (6/16/2008)


    GSquared (6/16/2008)


    I have some examples where hardware was a solution. See if you agree with them:

    Yes... we did something similar at work... we changed from SQL Server Standard Edition to Enterprise Edition. We went from a lameo 4 processor box with 2 gig of ram to a 16 processor box with 16 gig of ram and an absolutely killer hard drive system. Everyone was over-joyed when 4 hour processes went down to 30 minute processes. Everyone (except me and my DBA) was in computational Nirvana... all was right with the world... for six months... and then we reached the secondary tipping point where the 30 minute processes went back to 4 hours (and more, in some cases).

    Buying killer hardware is a temporary stopgap... nothing will help crap code except a non-crap rewrite. 😉 Triangular joins are still triangular... correlated sub-queries are still hidden RBAR... cursors and While loops are still RBAR... crap code is still crap code even though Cadilac hardware is available... eventually, the crap code is gonna put a tear in the seat...

    ... and, no, all that new hardware didn't come close to stopping the average of 640 deadloacks per day. Only changing crap code to good code changed that.

    That's not really the situation I was talking about. Using hardware as a substitute for good code is just spending money that will have to be spent again later, every time the load catches up with the capacity.

    The specific examples I had were: A database that, by its very nature, took up a huge amount of resources, and no amount of code optimization was going to change that, being moved to its own server so it wouldn't be competing with other databases for resources; a computer that was, by modern standards, grossly underpowered; and a misconfigured hardware situation that was holding back good code from doing its job well. I'm sure you don't disagree with the need for adequate hardware, I'm just having fun playing devil's advocate and reductio ad absurdem games here. 🙂

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • majorbloodnock (6/17/2008)


    For all those who don't like the chair analogy, perhaps we ought to come up with an alternative.

    An SSC member starts putting together a Question of the Day, and, halfway through, realises he could phrase it better.....

    OK, perhaps not. 😉

    Oh no - that has an altogether different ending....:)

    ----------------------------------------------------------------------------------
    Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?

  • An SSC member starts putting together a Question of the Day, and, halfway through, realises he could phrase it better.....

    Hey, I resemble that remark.

    On the hardware thing. If loads are increasing, I've seen the same thing, but I've also seen loads barely, or not increase. Not a great sign of business, but it also might mean that hardware was a better spend than developer time.

    You have to use judgment here, and the biggest thing I see is that people don't do that. They always go one way or the other.

  • majorbloodnock (6/17/2008)


    For all those who don't like the chair analogy, perhaps we ought to come up with an alternative.

    An SSC member starts putting together a Question of the Day, and, halfway through, realises he could phrase it better.....

    OK, perhaps not. 😉

    Nah. That just ends up with 25 pages of comments in the forums about "lurn 2 right Enlglish beter". 🙂

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • very good discussion!

    I would separate the issue into two strands:

    "Good" design - clean, high-performance, well-commented code. Everyone wants that - even clients who don't really know they want it!

    and

    "Right" design - solutions that fit the business rule they are built for. This is harder to do in some ways because the best design for the system may not be obvious from the project spec.

    Paraphrasing Neal Stephenson - "A well built machine-gun will not help you change a flat tyre".

  • real_cals (6/17/2008)


    Paraphrasing Neal Stephenson - "A well built machine-gun will not help you change a flat tyre".

    No... but I'll bet you can coax someone into doing for you with it. 😛 Just having a little fun, there...

    I think you pretty well summarized the whole thing... and then there's folks like me that want the whole enchilada... 😀

    --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)
    Intro to Tally Tables and Functions

Viewing 9 posts - 46 through 53 (of 53 total)

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