[comp.lang.misc] Learning Ada

billwolf%hazel.cs.clemson.edu@hubcap.clemson.edu (William Thomas Wolfe,2847,) (08/08/89)

From genesch@aplvax.jhuapl.edu (Eugene Schwartzman):
> Personal example - I wrote a *very* small program (2 -3 packages, 
> ~10 lines/package) and it took me days to figure out why I kept 
> getting certain syntax error (not that the errors themselves were
> very helpful).  Call me stupid, inexperienced with Ada, whatever, 
> but imagine a beginning student running into that.  

    OK; let's imagine.  Student gets syntax error.  Student tries
    to determine cause, giving up after about an hour.  Student
    shows the program to the local Consultant and asks what the
    problem is.  Consultant points out the obvious error.  Student
    resumes programming and goes on to obtain a CS degree.

    Introductory CS classes generally have special consultants just
    for that class, in addition to the consultants at the computing
    center, and in addition to the professor teaching the course.
    Now if the student doesn't take advantage of all this help, then
    the student would probably be better off as a truck driver anyway.

> As far as Ada being real-world, I'd have to disagree with you very loudly.
> The only "real" world that uses it with any regularity is government and 
> military.  What if the person doesn't want to work for either?  

    Why, then the person could work for Arthur Andersen, Reuters, or
    any of the many other non-defense companies using Ada...  simple, 
    huh?  The demand for Ada people greatly exceeds the current supply. 


    Bill Wolfe, wtwolfe@hubcap.clemson.edu
        

genesch@aplvax.jhuapl.edu (Eugene Schwartzman) (08/08/89)

In article <6205@hubcap.clemson.edu> billwolf%hazel.cs.clemson.edu@hubcap.clemson.edu (William Thomas Wolfe,2847,) writes:

=From genesch@aplvax.jhuapl.edu (Eugene Schwartzman):
=> Personal example - I wrote a *very* small program (2 -3 packages, 
=> ~10 lines/package) and it took me days to figure out why I kept 
=> getting certain syntax error (not that the errors themselves were
=> very helpful).  Call me stupid, inexperienced with Ada, whatever, 
=> but imagine a beginning student running into that.  
=
=    OK; let's imagine.  Student gets syntax error.  Student tries
=    to determine cause, giving up after about an hour.  Student
=    shows the program to the local Consultant and asks what the
=    problem is.  Consultant points out the obvious error.  Student
=    resumes programming and goes on to obtain a CS degree.
=
=    Introductory CS classes generally have special consultants just
=    for that class, in addition to the consultants at the computing
=    center, and in addition to the professor teaching the course.
=    Now if the student doesn't take advantage of all this help, then
=    the student would probably be better off as a truck driver anyway.

     Everything you mentioned is nice in *theory*. Let's walk backwards,
     1) most professors don't want to deal with debugging, so there goes that.
     2) most consultants (aides) won't know Ada because it is usually not
	taught at the college level (at least not where I go, is it anywhere?)
	so there goes that and leaves only the class consultant (TA)
     3) most TA's have verty limited office hours (~3/hrs week) and the 
	classroom (~2 hrs/week).  5 hours a week is too little for the amount
	of students who have problems (I know, I've been a TA/tutor).

     Now, again, I agree with you. unfortunately it is all in *THEORY*, but
     in reality, there is very little help available and most students relly
     on other student's help, but then how many students do you know that are
     willing to take up the time helping others - not many.

gene schwartzman
genesch@aplvax.jhuapl.edu
_______________________________________________________________________________
| GO BEARS, GO CUBS, GO WHITE SOX, GO BULLS, GO BLACKHAWKS, GO TERPS !!!!!    |
| Soccer is a kick in the grass (and sometimes on astroturf)!                 |
| GO DIPLOMATS, GO STARS, GO BAYS, GO BLAST !!!!		              |	
| CFL -> GO EDMONTON ESKIMOS!!!!   VFL -> GO CARLTON BLUES !!!!		      |
|_____________________________________________________________________________|
Disclaimer:  These are my opinions and not of my employer.
=
=> As far as Ada being real-world, I'd have to disagree with you very loudly.
=> The only "real" world that uses it with any regularity is government and 
=> military.  What if the person doesn't want to work for either?  
=
=    Why, then the person could work for Arthur Andersen, Reuters, or
=    any of the many other non-defense companies using Ada...  simple, 
=    huh?  The demand for Ada people greatly exceeds the current supply. 

pardo@june.cs.washington.edu (David Keppel) (08/08/89)

>[Ongoing discussion of Ada as a first programming language]
>[Errors: who helps the student?]

The University of Washington Department of Computer Science and
Engineering is now using Ada as the language for the introductory
programming courses.  I happen to think that this is a bad idea, but
that's just my preference.

The teaching does not follow the usual course of, say, Modula-2 or
Pascal intro courses.  For example, the students are taught about
exceptions before they are taught about records.  A first program will
often be something like `copy text file to screen' and will look
something like (pardon my lack of Ada syntax):

	file = open_file (name);
	loop COPY
	    char = get_char (file);
	    put_char (c);
	end loop COPY;

	when OPEN_FAILS =>
	    exit (some error);
	when GET_FAILS =>
	    done (normal status);
	when PUT_FAILS =>
	    exit (some other error);

There are two kinds of people to help with the programming.  There are
consultants, and there are TA's.  The consultants are on duty ``at all
hours''.  The TA's are required not only to have quiz sections, but
also to have `on duty' time at appointed hours in the terminal rooms.
As a matter of practice, consultants know some Ada, even though the
class has being taught for only one year.  Since consultants are often
CS undergrads, next year will see many more consultants who are
familiar with the bizarre errors of Ada.

I know of no other univerisities or colleges that are teaching Ada in
an introductory course.

	;-D on  ( Green pegs in software holes )  Pardo
-- 
		    pardo@cs.washington.edu
    {rutgers,cornell,ucsd,ubc-cs,tektronix}!uw-beaver!june!pardo

peter@ficc.uu.net (Peter da Silva) (08/08/89)

In article <6205@hubcap.clemson.edu>, billwolf%hazel.cs.clemson.edu@hubcap.clemson.edu (William Thomas Wolfe,2847,) writes:
>     OK; let's imagine.  Student gets syntax error.  [...] Student
>     shows the program to the local Consultant [who] points out
>     the obvious error.

Ever been a consultant at a university comp center? I have. The next
stage, if the student is working in Fortran, C, or some other production
language (ADA wasn't around back then), is...

      Student comes back in 10 minutes with the same error.
or...
      Consultant spends 10 minutes explaining error to student, and
      maybe fails. Meanwhile 6 other students get tired of waiting...

If the student is programming in Pascal, they are much more likely to
understand the error.

ADA is considerably more complex than Fortran or C.
-- 
Peter da Silva, Xenix Support, Ferranti International Controls Corporation.
Business: peter@ficc.uu.net, +1 713 274 5180. | "The sentence I am now
Personal: peter@sugar.hackercorp.com.   `-_-' |  writing is the sentence
Quote: Have you hugged your wolf today?  'U`  |  you are now reading"

billwolf%hazel.cs.clemson.edu@hubcap.clemson.edu (William Thomas Wolfe,2847,) (08/09/89)

From pardo@june.cs.washington.edu (David Keppel):
> As a matter of practice, consultants know some Ada, even though the
> class has being taught for only one year.  Since consultants are often
> CS undergrads, next year will see many more consultants who are
> familiar with the bizarre errors of Ada.

    Ada does not define error messages; all error messages are
    the complete responsibility of the compiler vendor.

    If you are obtaining "bizarre" errors, I would strongly
    recommend that you start using a better-quality compiler. 

> I know of no other univerisities or colleges that are teaching Ada in
> an introductory course.

    Check the proceedings from recent ASEET (Ada / Software Engineering
    Education and Training) conferences; you'll find quite a few.


    Bill Wolfe, wtwolfe@hubcap.clemson.edu

zuhn@umn-cs.CS.UMN.EDU (david d [zoo] zuhn) (08/09/89)

In article <5595@ficc.uu.net> peter@ficc.uu.net (Peter da Silva) writes:
>In article <6205@hubcap.clemson.edu>, billwolf%hazel.cs.clemson.edu@hubcap.clemson.edu (William Thomas Wolfe,2847,) writes:
>>     OK; let's imagine.  Student gets syntax error.  [...] Student
>>     shows the program to the local Consultant [who] points out
>>     the obvious error.
>
>Ever been a consultant at a university comp center? I have. The next
>stage, if the student is working in Fortran, C, or some other production
>language (ADA wasn't around back then), is...

I currently am a consultant in a CS lab situation..

>      Student comes back in 10 minutes with the same error.
>or...
>      Consultant spends 10 minutes explaining error to student, and
>      maybe fails. Meanwhile 6 other students get tired of waiting...

except that 4 of those 6 students are having the same problem, so your
5-10 minute explanation isn't going to just one person, if you understand
what everyone else is gong through.

>If the student is programming in Pascal, they are much more likely to
>understand the error.

I disagree there.  Obvious syntax errors are obvious syntax errors.  Ada
is better for students, because many problems I encounter are people who
cannot quite remember when to use 'var' in a paramater declaration.  'in'
and 'out' are very obvious.

>ADA is considerably more complex than Fortran or C.

and any course which introduces a language doesn't make full use of that
language.  ever see an intro to c course that make use of doubly linked
lists of pointers to function which return a pointer to another function?
I haven't?  But I've used such twisted arrangements.  

My first HLL was pascal, and most of my programming has been done in pascal.
I was thrust into doing an ada assignment, and I did the whole thing in about
three hours, without any problems at all.  

I'd much rather have to deal with students learning Ada than students learning
Pascal.  It just seems a little less arbitrary to beginners, unlike most
of the Pascal I/O support.

>-- 
>Peter da Silva, Xenix Support, Ferranti International Controls Corporation.
>Business: peter@ficc.uu.net, +1 713 274 5180. | "The sentence I am now
>Personal: peter@sugar.hackercorp.com.   `-_-' |  writing is the sentence
>Quote: Have you hugged your wolf today?  'U`  |  you are now reading"


David D "Zoo" Zuhn //    University of Minnesota      \\ Twin Cities
          Computer Science Systems Consultant, EE/CS 4-204
zuhn@umn-cs.cs.umn.edu,    zuhn@umn-cs.UUCP,   ..rutgers!umn-cs!zuhn

peter@ficc.uu.net (Peter da Silva) (08/09/89)

[ I sed, Pascal tends to produce simpler error messages than ADA ]

In article <15126@umn-cs.CS.UMN.EDU>, zuhn@umn-cs.CS.UMN.EDU (david d [zoo] zuhn) writes:
> I disagree there.  Obvious syntax errors are obvious syntax errors.

> and any course which introduces a language doesn't make full use of that
> language.

True, but the compiler does. With real languages like ADA or C where
errors can be buried in a mess of packages, and a typo can produce
a completely weird error message if you don't understand the more
advanced concepts in the language. Or do you just tell them the way
to fix the problem without explaining why they went wrong?

Really, there are reasons to use a language designed for teaching, like
Pascal or Logo. And one of them is that with a smaller universe to deal
with it's much easier for the compiler writer to produce error messages
that will be meaningful to novices.

  10	a = a + b
	  ^-------- Warning: replaced '=' with ':='.
  11	c = 5
	^-------- Warning: missing ';' before this statement.
	  ^-------- Warning: replaced '=' with ':='.
-- 
Peter da Silva, Xenix Support, Ferranti International Controls Corporation.
Business: peter@ficc.uu.net, +1 713 274 5180. | "The sentence I am now
Personal: peter@sugar.hackercorp.com.   `-_-' |  writing is the sentence
Quote: Have you hugged your wolf today?  'U`  |  you are now reading"

genesch@aplvax.jhuapl.edu (Eugene Schwartzman) (08/09/89)

In article <15126@umn-cs.CS.UMN.EDU> zuhn@umn-cs.CS.UMN.EDU (david d [zoo] zuhn) writes:
#In article <5595@ficc.uu.net> peter@ficc.uu.net (Peter da Silva) writes:
#>In article <6205@hubcap.clemson.edu>, billwolf%hazel.cs.clemson.edu@hubcap.clemson.edu (William Thomas Wolfe,2847,) writes:
#>>     OK; let's imagine.  Student gets syntax error.  [...] Student
#>>     shows the program to the local Consultant [who] points out
#>>     the obvious error.
#>
#>Ever been a consultant at a university comp center? I have. The next
#>stage, if the student is working in Fortran, C, or some other production
#>language (ADA wasn't around back then), is...
#
#I currently am a consultant in a CS lab situation..
#
#>      Student comes back in 10 minutes with the same error.
#>or...
#>      Consultant spends 10 minutes explaining error to student, and
#>      maybe fails. Meanwhile 6 other students get tired of waiting...
#
#except that 4 of those 6 students are having the same problem, so your
#5-10 minute explanation isn't going to just one person, if you understand
#what everyone else is gong through.

	Now you're guessing, and what of they aren't???  And even if they are
	odds are you will still have to re-exaplain the problem to 1 or 2 of
	them.
#
#>If the student is programming in Pascal, they are much more likely to
#>understand the error.
#
#I disagree there.  Obvious syntax errors are obvious syntax errors.  Ada
#is better for students, because many problems I encounter are people who
#cannot quite remember when to use 'var' in a paramater declaration.  'in'
#and 'out' are very obvious.

	Well, then they are just plain stupid and don't deserve to be in
	programming to begin with.  The first programs I wrote all used
	'var', we didn't even get into value passing until we ran into
	recursion.  With Ada, you need to remember when to use in/out and
	when not too, granted it is very obvious, but even still with them
	you have in, out, in/out combinations, with 'var' you have just one
	'VAR'.
#
#>ADA is considerably more complex than Fortran or C.
#
#and any course which introduces a language doesn't make full use of that
#language.  ever see an intro to c course that make use of doubly linked
#lists of pointers to function which return a pointer to another function?
#I haven't?  But I've used such twisted arrangements.  

	In a beginning level class????  Please try to remember that the ongoing
	discussion is concentrated about the *BEGINNING* level class.  Also, 
	if you used such a twisted arrangement in a program in the 'real-world'
	the boss would tear your head off.  The idea in the 'real' world is to
	keep it simple enough so that people can look at it years later and
	understand what is going on.  Take a look at that program 5 years later,
	and see if you can figure out what is going on - bet you can't.
#
#My first HLL was pascal, and most of my programming has been done in pascal.
#I was thrust into doing an ada assignment, and I did the whole thing in about
#three hours, without any problems at all.  

	One of the few lucky ones, or the assignment must of been very simple.
#
#I'd much rather have to deal with students learning Ada than students learning
#Pascal.  It just seems a little less arbitrary to beginners, unlike most
#of the Pascal I/O support.

	I know Pascal I/O is so hard - open, close, read, write, as compared to
	the simplicity of ADA - with TEXT_IO, use TEXT_IO, with FLOAT_IO, use
	FLOAT_IO, with FIXED_IO, use FIXED_IO, etc.. etc...  Give us a break..
	ADA uses a multitide of packages if you want to print out a simple
	statement that uses different types, Pascal has a simple write/writeln
	statement.

gene schwartzman
genesch@aplvax.jhuapl.edu
_______________________________________________________________________________
| GO BEARS, GO CUBS, GO WHITE SOX, GO BULLS, GO BLACKHAWKS, GO TERPS !!!!!    |
| Soccer is a kick in the grass (and sometimes on astroturf)!                 |
| GO DIPLOMATS, GO STARS, GO BAYS, GO BLAST !!!!		              |	
| CFL -> GO EDMONTON ESKIMOS!!!!   VFL -> GO CARLTON BLUES !!!!		      |
|_____________________________________________________________________________|
Disclaimer:  These are my opinions and not of my employer.

scott@shuksan.UUCP (Scott Moody) (08/15/89)

I think that the beginning college student today has already
had more exposure to programming than any of us. Should
we keep them in the past with giving them simple languages to learn
or make it harder (in our eyes) on them and provide them with
the next generation of languages (eg Ada, etc).

Let those students that haven't had exposure take the remedial 
CS courses, which should be more advanced than the remedial 
courses of today. Keep advancing the entry level of the beginning courses.

Keeping the entry level at the same basic level may not be
in the best interest of the more intelligent generation of students
and makes advancements in CS technology slower.

--scott

genesch@aplvax.jhuapl.edu (Eugene Schwartzman) (08/16/89)

In article <1502@shuksan.UUCP> scott@shuksan.UUCP (Scott Moody) writes:
>I think that the beginning college student today has already
>had more exposure to programming than any of us.

	Define 'us'.  Or did you mean to say any of us had when we *started*?

> Should
>we keep them in the past with giving them simple languages to learn
>or make it harder (in our eyes) on them and provide them with
>the next generation of languages (eg Ada, etc).

	What do you consider 'simple' languages? Pascal? Lisp? Prolog? 
	Assembly? What?  In my university the beginning language of the CS
	department is Pascal.  It has a course in FORTRAN in the CS and 
	Engineering departments for those who want to learn a language but
	don't want the hassle of all CS stuff and also there is a course in
	Pascal for non-majors.  Basically, Pascal without any CS stuff.  The
	Business Management Dpt. offers COBOL (ugh...).  So, as you can see
	there are plenty of places to go if you don't want to learn CS.
>
>Let those students that haven't had exposure take the remedial 
>CS courses, which should be more advanced than the remedial 
>courses of today. Keep advancing the entry level of the beginning courses.

	And what do you teach in these 'remedial' courses?
>
>Keeping the entry level at the same basic level may not be
>in the best interest of the more intelligent generation of students
>and makes advancements in CS technology slower.
>
	Oh hell, why don't we just make them write an OS using Prolog as the
	very first program in college.  That way thay can design a brand new
	computer by the time they are seniors. :-)

	Seriously, I don't care how many languages a person knows or how well
	he programs when he enters college, but who wants to bet that they
	have none or little conception of what is a structured program and
	almost nobody knows how to write algorithms.  There are certain basics
	that a CS student must know, otherwise he cannot do more advanced
	stuff and how many high school teachers worry about teaching structured
	programming, algorithms, etc...?

gene schwartzman
genesch@aplvax.jhuapl.edu
_______________________________________________________________________________
| GO BEARS, GO CUBS, GO WHITE SOX, GO BULLS, GO BLACKHAWKS, GO TERPS !!!!!    |
| Soccer is a kick in the grass (and sometimes on astroturf)!                 |
| GO DIPLOMATS, GO STARS, GO BAYS, GO BLAST !!!!		              |	
| CFL -> GO EDMONTON ESKIMOS!!!!   VFL -> GO CARLTON BLUES !!!!		      |
|_____________________________________________________________________________|
Disclaimer:  These are my opinions and not of my employer.

grichard@hydroplane.cis.ohio-state.edu (Golden Richard) (08/17/89)

Regarding article <8954@june.cs.washington.edu> posted by 
<pardo@june.cs.washington.edu>:

The University of New Orleans has been using Ada as an intro language
with much success for the past several years.  Exceptions need not
necessarily be covered early in the curriculum.  Ada provides an
end of file test just like Modula-2 and Pascal.  As for the test for a file 
open or write failing, Pascal code would simply crash, since there *is*
no way to perform such a test.    With proper planning, there is no reason 
that an introductory sequence in Ada need overwhelm the student with
unnecessary details.   Ada's "core" syntax is relatively clean and quite
easy to teach.







-=-
+--------------------------------------------------------------------------+
| Golden G. Richard III                        grichard@cis.ohio-state.edu |
+--------------------------------------------------------------------------+

nevin1@cbnewsc.ATT.COM (nevin.j.liber) (08/24/89)

In article <57769@tut.cis.ohio-state.edu> Golden Richard <grichard@cis.ohio-state.edu> writes:

>With proper planning, there is no reason 
>that an introductory sequence in Ada need overwhelm the student with
>unnecessary details.   Ada's "core" syntax is relatively clean and quite
>easy to teach.

But are the students allowed to *use* more than the core syntax?

There is nothing more annoying than to be able to use only part of a
language because that is all the professor thought was important, and
that is what tends to happen when only a subset of the language is
taught in an introductory course.
-- 
NEVIN ":-)" LIBER  AT&T Bell Laboratories  nevin1@ihlpb.ATT.COM  (312) 979-4751

marc@hpfcdc.HP.COM (Marc[e] Sabatella) (08/24/89)

>There is nothing more annoying than to be able to use only part of a
>language because that is all the professor thought was important, and
>that is what tends to happen when only a subset of the language is
>taught in an introductory course.

Except possibly being forced to use a language that doesn't even have the
other features (we won't mention any names, but it rhymes with "Ask Al").

I don't think students should be prevented from using more advanced features
if they want.  It will allow the faster students a way to challenge themselves
without confusing the slower ones.

grichard@cherokee.cis.ohio-state.edu (Golden Richard) (08/24/89)

In article <2658@cbnewsc.ATT.COM> nevin1@ihlpb.ATT.COM (nevin.j.liber) writes:

>But are the students allowed to *use* more than the core syntax?

I can't vouch for other programs, but at the University of New Orleans the
approach was to gradually introduce additional Ada features as the course
sequence progressed.   There was no penalty whatever for using some part of
Ada that hadn't been "officially" covered in class as long as said use was
reasonably intelligent (for instance:  using exceptions to catch an end of
file condition would result in being an ingredient in the next batch of
gumbo.)   Major facilities were covered in the UNO high-level language core
courses in approximately this fashion :

CS1583  (intro)                          Pascal-ish  "core" syntax, maybe some
                                         mention of exceptions, packages as
                                         an aside

CS2120  (algorithm design)               packages, exceptions

CS2125  (data structures)                "hard-core" package use for ADTs,
                                         generics, possibly some tasking

CS4401  (operating systems)              tasking


-=-
--
Golden Richard III        OSU Department of Computer and Information Science
grichard@cis.ohio-state.edu         "I'm absolutely positive....or not."    

db@lfcs.ed.ac.uk (Dave Berry) (08/31/89)

In article <2658@cbnewsc.ATT.COM> nevin1@ihlpb.ATT.COM (nevin.j.liber) writes:
>There is nothing more annoying than to be able to use only part of a
>language because that is all the professor thought was important.

What about having the compiler complain about something obscure or advanced
that you won't learn about for ages, just because you made a simple
mistake in writing your rpogram and you are using a system that is way
too powerful for the basic task of learning to program?

Dave Berry, Laboratory for Foundations      db%lfcs.ed.ac.uk@nsfnet-relay.ac.uk
    of Computer Science, Edinburgh Uni.	    <Atlantic Ocean>!mcvax!ukc!lfcs!db

   "Another hope, another dream, another truth, installed by the machine."

billwolf%hazel.cs.clemson.edu@hubcap.clemson.edu (William Thomas Wolfe,2847,) (08/31/89)

From article <283@castle.ed.ac.uk>, by db@lfcs.ed.ac.uk (Dave Berry):
> In article <2658@cbnewsc.ATT.COM> nevin1@ihlpb.ATT.COM (nevin.j.liber) writes:
>>There is nothing more annoying than to be able to use only part of a
>>language because that is all the professor thought was important.
> 
> What about having the compiler complain about something obscure or advanced
> that you won't learn about for ages, just because you made a simple
> mistake in writing your rpogram 

    Students should have little trouble with this as they write their
    "rpogram", since Ada has very few reserved words.  It only becomes 
    a problem in languages like COBOL, whose reserved words number well 
    over 200... 


    Bill Wolfe, wtwolfe@hubcap.clemson.edu

grichard@cherokee.cis.ohio-state.edu (Golden Richard) (08/31/89)

In article <6354@hubcap.clemson.edu> billwolf%hazel.cs.clemson.edu@hubcap.clemson.edu writes:

>    Students should have little trouble with this as they write their
>    "rpogram", since Ada has very few reserved words.  It only becomes 
>    a problem in languages like COBOL, whose reserved words number well 
>    over 200... 

I agree.  COBOL compilers tend to be incredibly stupid, too.  Accidentally 
using a reserved word as an identifier can lead to errors like
"missing period" being flagged scores of lines from the actual trangression.




-=-
Golden Richard III        OSU Department of Computer and Information Science
grichard@cis.ohio-state.edu         "I'm absolutely positive!  ...or not."    

hutch%citron.cs.clemson.edu@hubcap.clemson.edu (David Hutchens) (08/31/89)

From article <6354@hubcap.clemson.edu>, by billwolf%hazel.cs.clemson.edu@hubcap.clemson.edu (William Thomas Wolfe,2847,):
> From article <283@castle.ed.ac.uk>, by db@lfcs.ed.ac.uk (Dave Berry):
>> 
>> What about having the compiler complain about something obscure or advanced
>> that you won't learn about for ages, just because you made a simple
>> mistake in writing your rpogram 
> 
>     Students should have little trouble with this as they write their
>     "rpogram", since Ada has very few reserved words.  It only becomes 
>     a problem in languages like COBOL, whose reserved words number well 
>     over 200... 
> 

Of course there is the classic (from Ada): "Gee I need the cube of X":
	z := x ** 3;
which, of course (:-) generates the message "Ambiguous Expression".

The beginning student might be slightly confused by the reason:
   "The constant 3 is overloaded (as both integer and short integer)
    and there are 2 distinct ** operators, so the compiler doesn't
    know which to pick!"
If there are enough of these, the number of reserved words doesn't
matter as it plays no role in the confusion.

Note:  I'm not sure if there are enough in Ada or not, but reports
from people who have taught it as a first language suggests it works
reasonably well.  Besides there are weird things like this in all
languages.

			David Hutchens
			hutch@hubcap.clemson.edu

billwolf%hazel.cs.clemson.edu@hubcap.clemson.edu (William Thomas Wolfe,2847,) (08/31/89)

From hutch%citron.cs.clemson.edu@hubcap.clemson.edu (David Hutchens):
> Of course there is the classic (from Ada): "Gee I need the cube of X":
> 	z := x ** 3;
> which, of course (:-) generates the message "Ambiguous Expression".
> 
> The beginning student might be slightly confused by the reason:
>    "The constant 3 is overloaded (as both integer and short integer)
>     and there are 2 distinct ** operators, so the compiler doesn't
>     know which to pick!"

   Actually, the compiler does know... the exponentiation operator's
   right operand is required to be of type INTEGER, as per Appendix
   C, page 2, paragraphs 6 & 7 of ANSI/MIL-STD-1815A:

      -- function "**" (LEFT : INTEGER; RIGHT : INTEGER) return INTEGER;

      -- An implementation may provide additional predefined integer 
      -- types... The specification of each operator... for any additional
      -- predefined integer type, is obtained by replacing INTEGER by the
      -- name of the type in the specification of the corresponding
      -- operator of the type INTEGER, except for the right operand 
      -- of the exponentiating operator.
  
   Similarly, 4.5.6.4 states:

      The highest precedence exponentiating operator ** is predefined
      for each integer type and for each floating point type.  In either
      case the right operand, called the exponent, is of the predefined
      type INTEGER. 

   Thus, the constant 3 is not overloaded; it is clearly of type INTEGER. 

   In view of the fact that the "classic" case described is actually a
   double violation of the Ada reference manual, it seems highly probable
   that this is an error which is traceable either to the user defining 
   an unnecessary overloading of "**", or to an unvalidated compiler. 


   Bill Wolfe, wtwolfe@hubcap.clemson.edu

hutch%citron.cs.clemson.edu@hubcap.clemson.edu (David Hutchens) (09/01/89)

From article <6359@hubcap.clemson.edu>, by billwolf%hazel.cs.clemson.edu@hubcap.clemson.edu (William Thomas Wolfe,2847,):
> From hutch%citron.cs.clemson.edu@hubcap.clemson.edu (David Hutchens):
>> Of course there is the classic (from Ada): "Gee I need the cube of X":
>> 	z := x ** 3;
>> which, of course (:-) generates the message "Ambiguous Expression".
>> 
>> The beginning student might be slightly confused by the reason:
>>    "The constant 3 is overloaded (as both integer and short integer)
>>     and there are 2 distinct ** operators, so the compiler doesn't
>>     know which to pick!"
> 
>    Actually, the compiler does know...
      [Stuff about special characteristics of the ** operator deleted.]
> 

It is good to see that is "fixed".  Of course this introduces a special
case into the compiler, and into the minds of the experienced user that
I might easily claim is as bad or worse than the "Pre-fixed" version.
Now we have several lines in the LRM and several lines of code in
correct compilers to solve a stupid little problem.
(By the way, I tried this example on several of the early "validated"
compilers and they ALL worked the way I stated.  I don't happen to
know if the compilers were broken at the time or they changed the spec
of the language ... but I think the latter.)

So I was wrong in the specifics, but even more right in the intent
because the designers had to gum up the language specification to get
it to work the way people would feel most comfortable.
I don't think keywords are the only source of inexperienced user
frustration with large languages.


	- David Hutchens
	  hutch@hubcap.clemson.edu

billwolf%hazel.cs.clemson.edu@hubcap.clemson.edu (William Thomas Wolfe,2847,) (09/01/89)

From hutch%citron.cs.clemson.edu@hubcap.clemson.edu (David Hutchens):
>>> 	z := x ** 3;
>>>   which, of course (:-) generates the message "Ambiguous Expression".
>>>     [...] there are 2 distinct ** operators, so the compiler doesn't
>>>     know which to pick!"
>>  Actually, the compiler does know...
>
> (By the way, I tried this example on several of the early "validated"
> compilers and they ALL worked the way I stated.  I don't happen to
> know if the compilers were broken at the time or they changed the spec
> of the language ... but I think the latter.)

    This would imply that validation certificates were being given
    to compilers built to the 1980 Preliminary LRM rather than to
    the 1983 ANSI/ISO-approved "Final" LRM, which I tend to doubt
    rather seriously.  The early compilers did have quite a few
    problems, due in part to the fact that the early validation
    suites were not very extensive at the time, but now that the
    "second generation" highly optimizing Ada compilers are hitting 
    the market, compiler maturity is not so much of an issue any more. 

> So I was wrong in the specifics, but even more right in the intent
> because the designers had to gum up the language specification to get
> it to work the way people would feel most comfortable.

    Actually, even with the situation you described, there would
    still be a means of resolving the situation: assuming that the
    exponentiation functions followed the general rule (both parameters
    of the same type), the type of x would determine the exponentiation 
    function to use.  Since the 3 is a constant of type universal_integer,
    it would be capable of matching whatever integer type was required, 
    be it short, regular, long, or whatever.  In order to get a problem,
    it would therefore be necessary for the _user_ to define a new "**"
    function with parameters of different types.

    Therefore, I am again led to the conclusion that the error was
    the result of immature compilers and immature validation suites. 

> I don't think keywords are the only source of inexperienced user
> frustration with large languages.

    Certainly not; there are some very irritating problems with Ada 83
    such as the inability to define an ADT's Destroy routine such that
    the routine is automatically invoked upon block exit, but this is
    being addressed right now via the Ada 9X scheduled revision process.

    Of course, Ada 83 can almost always provide a good workaround 
    (in the above example, by having the user invoke Destroy at
    the end of the block), and this is absolutely nothing compared 
    to the total frustration of using smaller languages like Modula-2 
    which do not permit generic ADTs at all.  


    Bill Wolfe, wtwolfe@hubcap.clemson.edu

marc@hpfcdc.HP.COM (Marc[e] Sabatella) (09/01/89)

>Of course there is the classic (from Ada): "Gee I need the cube of X":
>	z := x ** 3;
>which, of course (:-) generates the message "Ambiguous Expression".

This is a feature of the compiler, not the language.
It would be an argument against Ada only in those environments where you can't
get a good Ada compiler

--------------
Marc Sabatella
HP Colorado Language Lab (CoLL)
marc@hpmonk

norvell@csri.toronto.edu (Theodore Stevens Norvell) (09/01/89)

In article <6354@hubcap.clemson.edu> billwolf%hazel.cs.clemson.edu@hubcap.clemson.edu writes:
>From article <283@castle.ed.ac.uk>, by db@lfcs.ed.ac.uk (Dave Berry):
>> In article <2658@cbnewsc.ATT.COM> nevin1@ihlpb.ATT.COM (nevin.j.liber) writes:
>>>There is nothing more annoying than to be able to use only part of a
>>>language because that is all the professor thought was important.
>> 
>> What about having the compiler complain about something obscure or advanced
>> that you won't learn about for ages, just because you made a simple
>> mistake in writing your rpogram 
>
>    Students should have little trouble with this as they write their
>    "rpogram", since Ada has very few reserved words.  It only becomes 
>    a problem in languages like COBOL, whose reserved words number well 
>    over 200... 
>
>
>    Bill Wolfe, wtwolfe@hubcap.clemson.edu

What about having the compiler NOT complain about something obscure or
advanced ...

DO 10 I = 1. 100    Fortran

i = 1,000 ;         C

if( x = 0 )         C 

x := r--q ;         Ada