Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!news.swapon.de!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: Sat, 22 Jun 2013 19:26:27 +0200 Organization: A noiseless patient Spider Lines: 73 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: Sat, 22 Jun 2013 17:21:18 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="f367d9e8a7c7f2a10160e0639e957a17"; logging-data="15734"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18HBfPAeWzM9QggvfkdBNiX" User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 In-Reply-To: Cancel-Lock: sha1:tgQJLkw7mRvyjZqxMhWCQx8C0/g= Xref: csiph.com comp.lang.java.programmer:24512 On 22/06/2013 10:03, lipska the kat allegedly wrote: > On 21/06/13 15:24, Daniele Futtorovic wrote: >> On 21/06/2013 04:33, Arved Sandstrom allegedly wrote: >>> On 06/19/2013 11:42 AM, Daniele Futtorovic wrote: >>>> 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. >>>> >>> It's a good discussion. I'm not personally convinced that verbosity adds >>> complexity, as a rule. There's really two types of complexity here: >>> maintainability complexity - as in, can Joe Blow 12 months later >>> understand the code best if it's compact versus unrolled, and formal >>> complexity, cyclomatic and otherwise. >>> >>> I'll admit that verbosity does usually add maintainability complexity, >>> if not the other kind. But not always. I've seen plenty of code that is >>> conceptually quite complex but very terse. >> >> Sorry to nitpick, but I don't think you understood me right. I'm not >> saying that verbosity adds complexity; I'm saying: if the piece of code >> does something tricky, something complicated, tend to make it verbose, >> otherwise, tend to make it terse. Thus, seeing a big blob of (e.g. >> unrolled, step-by-step) code holds the message "here be dragons". (And >> if it cannot be made verbose, then it means it absolutely requires an >> in-line comment). >> >> At least the way I perceived it, this discussion was about making stuff >> verbose indiscriminately, viz. basic code as well. I disagree with that >> in the above sense. > > .... and who makes these seemingly arbitrary decisions about what is and > what isn't 'complex'. This idea that some bits of code can be written > differently (more/less verbosely) depending on someones definition of > 'complex' is exactly the sort of thing that makes code less readable. > Let's be quite clear about this, the *most important* thing > is readability. Complexity is an objective measure, relative to the environment constituted by the software as a whole, of how sensitive the process in question is. > Anyone who has experienced 'flow' when writing code will > know that what was blindingly obvious yesterday can be arcane and obtuse > today. You need to pick a style and stick with it, not chop and change > between arbitrary styles on some whim. > > I'm tempted to say that this behavior typifies the too clever by half > attitude that makes our job so frustrating sometimes but that might be > construed as confrontational so I won't ... :-) And who makes this arbitrary decision about what is and isn't "too clever by half"? Cleverness is not a sin. As it were, I strive for it. Cleverness is the path to betterment, individual as well as human as a whole. If you aren't clever or don't want to be, that's not my problem, but get out of my way. -- DF.