SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Defensive Programming


Defensive Programming

Author
Message
Trey Staker
Trey Staker
SSCommitted
SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)

Group: General Forum Members
Points: 1622 Visits: 2788
I would of guessed 1859 and would have missed ths one if it wasn't for my friend google. :-(

---------------------------------------------------------------------
Use Full Links:
KB Article from Microsoft on how to ask a question on a Forum
Hugo Kornelis
Hugo Kornelis
SSCoach
SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)

Group: General Forum Members
Points: 18903 Visits: 12426
I got it right, but I don't like the question.

The QotD should be about testing our knowledge of SQL Server. Not testing our ability to use a search engine. And please don't tell me I've cheated by using one - how relevant is it that I do not recognise the paper from just the quote, or that I do not remember off the top of my head when it was published?

I do thank Tom for the effort of posting a QotD, and about a very important (and often overlooked) issue as well - but next time, please come up with a question about what defensive programming actually is, and how we can do that in the context of databases in general and SQL Server in specific.


Hugo Kornelis, SQL Server MVP
Visit my SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
john.arnott
john.arnott
Hall of Fame
Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)

Group: General Forum Members
Points: 3630 Visits: 3059
Hugo Kornelis (4/23/2010)
I got it right, but I don't like the question.

The QotD should be about testing our knowledge of SQL Server. Not testing our ability to use a search engine. And please don't tell me I've cheated by using one - how relevant is it that I do not recognise the paper from just the quote, or that I do not remember off the top of my head when it was published?

I do thank Tom for the effort of posting a QotD, and about a very important (and often overlooked) issue as well - but next time, please come up with a question about what defensive programming actually is, and how we can do that in the context of databases in general and SQL Server in specific.


Oh, but I do disagree. I see the QOD as a tool for learning more than a test of knowledge. In this case, guessing or searching out the answer is a stimulus to contemplation of the basic problem of whether it's possible to avoid errors or necessary to accept that once any system (computer program or otherwise*) reaches a certain level of complexity, it becomes more and more likely that errors will exist and that defensive measures must be taken.

That this was recognized and studied so early in the history of electronic computers should be taken as a foundation for the discussions you propose on defensive measures. If anyone is developing an appliction or even a single program without considering strategies for reducing or containing errors, they should at least know that they're ignoring a principle that's at least six decades old.

-----------------
* If I were designing a data processing / info technology ciriculum, I'd be sure to include at least one course using Systemantics: How Systems Work and Especially How They Fail by John Gail. Its example cases come from a number of disciplines, but are described in plain terms, intended to reach lay readers.
Tom Thomson
Tom Thomson
One Orange Chip
One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)

Group: General Forum Members
Points: 26104 Visits: 12500
Hugo Kornelis (4/23/2010)
I got it right, but I don't like the question.

The QotD should be about testing our knowledge of SQL Server. Not testing our ability to use a search engine. And please don't tell me I've cheated by using one - how relevant is it that I do not recognise the paper from just the quote, or that I do not remember off the top of my head when it was published?

I can understand that, and in fact I wondered a bit about posting something with relevance quite as tangential or indirect as this, and more about the history of programming than about current practise. But in the end I thought that on balance it might be worth reminding people that defensive programming has been recognised as a need in computing since the very start of the programming stored program computers. Besides, I wanted an easy ride on my first QOTD so that it wouldn't have too many people picking holes in the answer or in the explanation and this was one I thought I couldn't get wrong (I was wrong about that - there's a glaring typing error in the explanation, as has already been pointed out). I expected most people would guess rather than resort to google, but I can't see why anyone would regard use of google as cheating on a question like this; and I was very surprised to see that TPTB had decided to make it worth 6 points, because it is not at all an SQLServer question - although some of the questions tagged humour have been even less relevant yet still higher scoring.
But don't worry, my next QOTD (assuming it gets accepted - it's been pending a while) is T-SQL straight and simple, and I hope that will be more to your taste.

Tom

Hugo Kornelis
Hugo Kornelis
SSCoach
SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)

Group: General Forum Members
Points: 18903 Visits: 12426
Tom.Thomson (4/23/2010)
and I was very surprised to see that TPTB had decided to make it worth 6 points, because it is not at all an SQLServer question - although some of the questions tagged humour have been even less relevant yet still higher scoring.
But don't worry, my next QOTD (assuming it gets accepted - it's been pending a while) is T-SQL straight and simple, and I hope that will be more to your taste.


Hi Tom,

Thanks for the explanation. I do indeed share your amazement at the amount of points alloted to this question, and to almost all "humour" questions. It's almost as if the amount of points for a question is inversely proportional with it's relevance to our everyday job...

I'm glad to hear that you have another question pending, and I'm looking forward to try my hand on it. And, I hope, on many more!


Hugo Kornelis, SQL Server MVP
Visit my SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
Steve Jones
Steve Jones
SSC Guru
SSC Guru (147K reputation)SSC Guru (147K reputation)SSC Guru (147K reputation)SSC Guru (147K reputation)SSC Guru (147K reputation)SSC Guru (147K reputation)SSC Guru (147K reputation)SSC Guru (147K reputation)

Group: Administrators
Points: 147710 Visits: 19440
Of course the points are inversely proportional to your job. Isn't that how reviews are handled as well? And interviews?

It's actually a fun decision on my part, giving people a chance to "catch up" some easy points.

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
Jamie-2229
Jamie-2229
Hall of Fame
Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)

Group: General Forum Members
Points: 3866 Visits: 857
I found the Hartree reference quoted in the American Mathematical Society Journal from 1960... I had half hoped that the "6" in 1960 along with the six possible answers were pointing me toward an answer of 1960 and the AMS article published in 1960 seemed to support that strongly but noticed as I pushed the button it said Trivia rather then Humor as a category.

It would appear a lack of knowledge of the history of Micro-processing stood in my way. As an English Major with a minor in Education, I did not study the Manchester Machine. (http://plato.stanford.edu/entries/computing-history/)

I am curious as to how the SQL language is related to this particular piece of trivia. Did SQL develop from the mathematics for a micro-processor style of defensive programming?

Jamie
Tom Thomson
Tom Thomson
One Orange Chip
One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)

Group: General Forum Members
Points: 26104 Visits: 12500
Jamie Longstreet-481950 (4/24/2010)
I found the Hartree reference quoted in the American Mathematical Society Journal from 1960... I had half hoped that the "6" in 1960 along with the six possible answers were pointing me toward an answer of 1960 and the AMS article published in 1960 seemed to support that strongly but noticed as I pushed the button it said Trivia rather then Humor as a category. {/quote] I'm not sure why you think Humor as a category might have helped. Probably 6 options were too many - if I eever do another question lik ethat I'll maybe go for five options (or maybe severn?). [quote]

It would appear a lack of knowledge of the history of Micro-processing stood in my way. As an English Major with a minor in Education, I did not study the Manchester Machine. (http://plato.stanford.edu/entries/computing-history/)

Studying the Manchester machine would not have helped. The machine in question was the Cambridge Machine.

I am curious as to how the SQL language is related to this particular piece of trivia. Did SQL develop from the mathematics for a micro-processor style of defensive programming?

No, certainly not (although EFC's attitude to NULL [he regarded it as essential] might well be regarded as a vote infavour of defensive probramming). The idea of the question was to remind writers of SQL (who, in my experience, generally regard defensive programming as something that those funny C++ programmers do, despite thae fact that C++ programmers almost never do it) that defensive programming dates from the earlliest times of programming (lomg before HLL's like Fortran or Cobol, let alone SQL or C# [or amazing LLL's like C and C++] had been invented) and is something that has to be done in whatever language you write in (including T-SQL) unless you have a divine dispensation that says your code will never encounter a problem.

Tom

Paul White
Paul White
SSC-Dedicated
SSC-Dedicated (35K reputation)SSC-Dedicated (35K reputation)SSC-Dedicated (35K reputation)SSC-Dedicated (35K reputation)SSC-Dedicated (35K reputation)SSC-Dedicated (35K reputation)SSC-Dedicated (35K reputation)SSC-Dedicated (35K reputation)

Group: General Forum Members
Points: 35908 Visits: 11361
Hugo Kornelis (4/23/2010)
I got it right, but I don't like the question.

The QotD should be about testing our knowledge of SQL Server. Not testing our ability to use a search engine. And please don't tell me I've cheated by using one - how relevant is it that I do not recognise the paper from just the quote, or that I do not remember off the top of my head when it was published?

I do thank Tom for the effort of posting a QotD, and about a very important (and often overlooked) issue as well - but next time, please come up with a question about what defensive programming actually is, and how we can do that in the context of databases in general and SQL Server in specific.

+1. I didn't even bother to Google - I waited for the correct answer to be mailed to me today ;-)

Whatever possessed Steve to throw six points at this?

Paul



Paul White
SQLPerformance.com
SQLblog.com
@SQL_Kiwi
Toreador
Toreador
Hall of Fame
Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)

Group: General Forum Members
Points: 3845 Visits: 8125
Steve Jones - Editor (4/23/2010)
It's actually a fun decision on my part, giving people a chance to "catch up" some easy points.


Easy? Only if you google the results.
All the QOTDs are just as easy if you look up the answer :-)
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search