Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx05.eternal-september.org!.POSTED!not-for-mail From: =?UTF-8?B?Sm9zaHVhIENyYW5tZXIg8J+Qpw==?= Newsgroups: comp.lang.java.programmer Subject: Re: About java program. Date: Tue, 18 Jun 2013 13:07:27 -0500 Organization: A noiseless patient Spider Lines: 43 Message-ID: References: <324f929f-772e-4004-81e1-6b454cdae794@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Tue, 18 Jun 2013 18:02:29 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="95ab4c362dcce54022543f80bbbb46d3"; logging-data="25063"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18z9CsofWNAaqjuJZYtaH4FbcplkyYZa9g=" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:22.0) Gecko/20100101 Thunderbird/22.0 In-Reply-To: Cancel-Lock: sha1:ixdWgoTVCSbns+MW7ybWuOtBkak= Xref: csiph.com comp.lang.java.programmer:24452 On 6/18/2013 3:03 AM, lipska the kat wrote: > On 17/06/13 23:36, Joshua Cranmer 🐧 wrote: >> On 6/17/2013 8:46 AM, lipska the kat wrote: >>> ... and what is your opinion of defensive coding? >> >> The term, as I understand it, refers to coding under the assumption that >> everyone who uses your API is a stupid idiot who can't follow your rules >> properly. > > Let me say first of all that this has been another very funny exchange. > It really is quite amazing how often you guys get all pompous and > self-righteous about issues that have nothing whatsoever to do with the > issue at hand. Seriously ROFL LOL. At the risk of being called pompous, I wish to point out that you yourself are not innocent of those charges, choosing the least germane part of my message as the only part to discuss. I'll assume you're doing the same thing I tend to do--only responding to the parts of the message you disagree with. > Let me try again, I'll try to keep it simple as you are obviously > struggling. Oh, I am not so incompetent in reading comprehension as to not know what you meant by defensive programming. I was just pointing out that it wasn't the definition I have heard used before by giving the definition that I used. > When you write software to control a device that will be used to > interact with human beings you need to anticipate every possible cock up > in expected input. You need to deal with erroneous key sequences, > incorrect data, communications problems, canceled transactions and any > number of other unexpected occurrences and you need to do this in a way > that allows you to recover the device and place it in a state that > doesn't cause the entire edifice to lock up and crash. > > *This* is what I mean by defensive programming. And I'd call it "basic principles of good programming." :-) -- Beware of bugs in the above code; I have only proved it correct, not tried it. -- Donald E. Knuth