Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.datemas.de!rt.uk.eu.org!aioe.org!.POSTED!not-for-mail From: Roedy Green Newsgroups: comp.lang.java.programmer Subject: Re: Java blunders Date: Wed, 23 Jul 2014 04:44:32 -0700 Organization: Canadian Mind Products Lines: 49 Message-ID: <257vs95667e2rm9ff40h8n5bchmc2mv3iu@4ax.com> References: Reply-To: Roedy Green NNTP-Posting-Host: K2Qzzs3EAqXk5RLzfhxcSw.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: ForteAgent/7.20.32.1218 X-Notice: Filtered by postfilter v. 0.8.2 Xref: csiph.com comp.lang.java.programmer:29227 On Tue, 22 Jul 2014 21:02:07 -0500, Joshua Cranmer ? wrote, quoted or indirectly quoted someone who said : > >C. On the balance, I think matching curly braces is superior to >begin/end-ish constructs. If you're spending too much time trying to >figure out where you have an extra or a missing curly brace, then, quite >frankly, your IDE is defective. My IDE points out matching curly braces >and can even fold them based on appropriate matching, and it has been >able to do so since before Java was invented. Possibly since before I >was born, even. I find sorting out braces is by far the most-time consuming busywork in preparing Java source. It is not fun. It is just irritating. I have a problem with IntelliJ. I want to tidy the code to help visually sort out the brace misbalance problem. However, if I invoke the tidier on an program of imperfect syntax, it often does horrible violence. I have even written some tools for balancing in pernicious cases. http://mindprod.com/products1.html#BRACEBALANCER http://mindprod.com/products1.html#MASMBALANCER If you could pin down certain braces as having a given function (e.g. end method, that will not be disturbed by a stray } or one accidentally hidden by a //. The IDE could go right to the problem, and suggest a fix. In JDisplay, my program for colourising and fontifying Java source code for display on the Internet, it use bigger braces on the outside and smaller ones in the inside. This helps visually balance them. I suppose with a fancier parser I could make the braces subtly different colours, so you can more easily tell an end loop from an end method or an end if. You might not even consciously notice it. I could imagine an IDE of the future have set of glyphs it uses in place of {} to tell you the function of the {} it gleaned. You just type {} as always. You might also do things with the backgrounds to demark blocks -- Roedy Green Canadian Mind Products http://mindprod.com Science is what we understand well enough to explain to a computer. Art is everything else we do. ~ Donald Ervin Knuth (born: 1938-01-10 age: 76)