Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!pt.cs.cmu.edu!sei!prp From: prp@sei.cmu.edu (Patrick Place) Newsgroups: comp.lang.misc Subject: Re: Which language to teach first? Message-ID: <3861@fy.sei.cmu.edu> Date: 16 Aug 89 16:09:17 GMT References: <2685@aplcen.apl.jhu.edu> Organization: Carnegie-Mellon University (Software Engineering Institute), Pgh, PA Lines: 35 In article <2685@aplcen.apl.jhu.edu>, genesch@aplvax.jhuapl.edu (Eugene Schwartzman) writes: > You yourself said that the above example would produce an error, granted > I don't know whether you mean logical or compiler... Honestly, I don't > know how the compiler would handle it, but if I remember anything from > one of my classes, it would gripe and tell you that they type are > incompatible. Also, the two ranges are different, sooner or later it > would crash anyway and the problem would be discovered (hopefully, in > the testing stages :-) In the example, (deleted for brevity), Pascal would compile the code, which as we have said is incorrect. As you say, sooner or later it will crash anyway. Big deal, let us assume that we are fortunate and the crash occurs in the procedure Macedonia, we can spend a long time looking at the code of Macedonia, which is all correct, so nothing is found. It is the call that is in error. The Ada compiler will not permit the call to occur, it is a syntactic error. And so may be fixed immediately. It is much easier to fix a syntactic error, than a semantic error which may not be at the point at which the program crashes. > I am not surehow you define debug, but I define it as fixing the logical > problems. So, if you spend more time figuring out syntax errors with > Ada and same time for logical errors with Ada and Pascal, which one > takes more time to write a program in? The whole point is that moving more checking into the compiler reduces the amount of time spent looking at "logical errors" such as those described in the example. > > Are you crazy? :-) Who in their right mind would write something that > big as a single source file? Now, you'll tell me that Pascal cannot > be split? To that I say, that according to a lot of my friends who > have worked in the 'real' world with Pascal to write a large program, > Pascal can be split up, very easily. Only because they are not using standard Pascal. This is a very important point. Non standard Pascals permit separate compilation. THEY ARE NOT PORTABLE. Pat Place prp@sei.cmu.edu