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: Daniele Futtorovic Newsgroups: comp.lang.java.programmer Subject: Re: About java program. Date: Wed, 19 Jun 2013 16:42:31 +0200 Organization: A noiseless patient Spider Lines: 34 Message-ID: References: <324f929f-772e-4004-81e1-6b454cdae794@googlegroups.com> <19wnriq53qxel.u9rt8wy6z52g.dlg@40tude.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Injection-Date: Wed, 19 Jun 2013 14:37:27 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="123b9be74c86173b128748477a8dfb8e"; logging-data="20788"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/yILL9oZEq0SUZpeT6IX7z" User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 In-Reply-To: Cancel-Lock: sha1:7W2xprt6TNhYEX69ZmVIyeVcdPU= Xref: csiph.com comp.lang.java.programmer:24471 On 18/06/2013 22:50, Arved Sandstrom allegedly wrote: > > See my answer to Eric, all this is just ridiculing reasonable > programming practices. > > Even given Robert's example where the NPE-safe equals() is wrapped in a > method that constrains the type of object being compared to, it may not > be expected or acceptable that the String is null. So perhaps you do > want to check for that, maybe with Apache StringUtils.isBlank(). > > Sure, the contrived absurd examples are retarded; so is the mockery of > defensive programming. Oh well, there's a reason why most software > projects still fail or go vastly over budget. I'm all for defensive programming, but I think that there's a limit where it can be on the verge of silliness, and that that limit has been grazed here. Less-than-bright programmers IMO cannot be a justification for crossing that line; less-than-bright programmers have more ways to mess things up than you could possibly ever guard against. "Do not underestimate the ingenuity of complete fools", as the saying goes. And for me, there is an additional aspect: if a piece of code does something simple, something basic, then I will want it to be short, and vice-versa. Verbosity of code, to me, should hold a first-glance indication of the complexity of the algorithm. In other words: be terse IFF it's basic, be verbose IFF it's not. Perhaps your mileage does vary. No beef with that. Just throwing in my two cents. -- DF.