Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.help > #1130

Re: <identifier> expected error

From Roedy Green <see_website@mindprod.com.invalid>
Newsgroups comp.lang.java.help
Subject Re: <identifier> expected error
Date 2011-09-25 00:13 -0700
Organization Canadian Mind Products
Message-ID <hqjt771jctj23ao4hmm7vdsbgoef05b04q@4ax.com> (permalink)
References <c4db596b-eb82-4d41-bfd6-372b4037bfca@l2g2000vbn.googlegroups.com> <seko77pvl58ld3n7kbithfe65gtsrka76h@4ax.com> <7371102.30.1316805058374.JavaMail.geo-discussion-forums@prec11> <ii7q779k5782v8amlv5ersmm73hapv6964@4ax.com> <20643304.220.1316825785758.JavaMail.geo-discussion-forums@prng5>

Show all headers | View raw


On Fri, 23 Sep 2011 17:56:25 -0700 (PDT), Lew <lewbloch@gmail.com>
wrote, quoted or indirectly quoted someone who said :

>Good question and interesting insights from Roedy.

Warning: this is a somewhat meandering post nibbling at various
aspects of error messages.

This problem goes way back.  I used to man the help desk at UBC for
people with FORTRAN problems first on the IBM 1620 then 7044 then IBM
360 under MTS.

The error messages were always stated from the point of view of the
parser, and utterly baffling to the engineers trying to use it. Since
FORTRAN is a quite strange language to parse, the message were
unusually strange, accusing you of defining statement functions when
you had, in your mind, done no such thing.

Later the WatFor compiler gave error messages much closer to the way
people saw the problem.

The errormessage that gives Java programmers most trouble is a run
time error message - NoClassDefFoundError.

I have collected 42 causes of the error. 

see
http://mindprod.com/jgloss/runerrormessages.html#NOCLASSDEFFOUNDERROR

 I wish Oracle could find some way to give you more information to
 help sort out which possible causes are at play.

Sun's attitude was if they pointed you to the place where the parser
had trouble, they had done their job. 

I hope someday there is a post processor that corrects errors (e.g.
missing ) }, spelling mistakes, missing declarations, and that
explains to you things it cannot correct is more programmer terms,
perhaps giving some alternate takes on what is causing the problem,
and letting you choose from an array of fixes.

I use the IntelliJ IDE. It pretty well tells you on a keystroke  by
keystroke basis if the program is well formed.  It also does
completion while typing variable names so I rarely make spelling
errors.  I rarely have any errors on a compile. Any any program that
uses only elements I have used before usually works first time. So
perhaps the cleverness belongs in the IDE, not the error message
post-processor.

I find the  most time-consuming syntax problem is getting { } properly
balanced. I think the fault is in the language design, using {} for
too many things.  If end of class, end of method, and end of loop had
unique markers, narrowing down where the unbalance is would be much
easier. It would also make it easier to skim code. I await the SCID
where I can do this without permission from anyone else.

I even wrote BraceBalancer to help sort out intractable cases.
http://mindprod.com/products1.html#BRACEBALANCER


-- 
Roedy Green Canadian Mind Products
http://mindprod.com
It should not be considered an error when the user starts something
already started or stops something already stopped. This applies
to browsers, services, editors... It is inexcusable to 
punish the user by requiring some elaborate sequence to atone,
e.g. open the task editor, find and kill some processes.

Back to comp.lang.java.help | Previous | NextPrevious in thread | Find similar


Thread

<identifier> expected error Kathy Walker <kjata1013@gmail.com> - 2011-09-22 16:40 -0700
  Re: <identifier> expected error "John B. Matthews" <nospam@nospam.invalid> - 2011-09-22 20:54 -0400
    Re: <identifier> expected error Kathy Walker <kjata1013@gmail.com> - 2011-09-22 18:08 -0700
      Re: <identifier> expected error "John B. Matthews" <nospam@nospam.invalid> - 2011-09-22 21:24 -0400
  Re: <identifier> expected error Lew <lewbloch@gmail.com> - 2011-09-22 17:56 -0700
    Re: <identifier> expected error Kathy Walker <kjata1013@gmail.com> - 2011-09-22 18:09 -0700
  Re: <identifier> expected error Roedy Green <see_website@mindprod.com.invalid> - 2011-09-23 02:30 -0700
  Re: <identifier> expected error Roedy Green <see_website@mindprod.com.invalid> - 2011-09-23 02:32 -0700
    Re: <identifier> expected error Lew <lewbloch@gmail.com> - 2011-09-23 12:10 -0700
      Re: <identifier> expected error Roedy Green <see_website@mindprod.com.invalid> - 2011-09-23 17:10 -0700
        Re: <identifier> expected error Lew <lewbloch@gmail.com> - 2011-09-23 17:56 -0700
          Re: <identifier> expected error Roedy Green <see_website@mindprod.com.invalid> - 2011-09-25 00:13 -0700

csiph-web