TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy


Options: Use Classic View

Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Topic: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
"Brashear, Phil" <[log in to unmask]>
Thu, 5 Oct 2000 14:00:39 -0400
text/plain (105 lines)
In my earlier message, I didn't address the OO aspects.
First, C++ is a "better" C -- I think that "cout << Variable;" is a lot more
intuitive that "printf ( .... )" (or whatever the poor C programmer has to
use) -- though it certainly doesn't hold a candle to "Put_Line ( Variable
);".  If I had to choose between C and C++ for the intro courses, I'd choose

That having been said:

In CS1, the students have one assignment using user-defined classes.
In CS2, the class is used as the encapsulation/abstraction mechanism for
producing Abstract Data Types -- that's in all assignments (7.5 assignments
in my case).  By the fourth (middle) assignment, my kids are creating and
using class templates.  For the sixth assignment, they implement Queue as a
child of List, so they're seeing inheritance.  The 1/2 assignment (6A) deals
with a heterogenous list (linked list of class-wide objects to us Ada

I certainly wouldn't say I'm teaching an object-oriented course, but it's
certainly object-based with an introduction to OOP.  (Pretty much what I did
in the Ada version of the course, once Ada 95 compilers were available.)

Now that I've got my feet pretty well grounded in the C++ stuff, I'm waiting
for the Java shoe to drop.  I think that would be worse.


Philip W. Brashear
Software Quality Assurance
EDS Corporation
[log in to unmask]

-----Original Message-----
From: [log in to unmask] [mailto:[log in to unmask]]
Sent: Thursday, October 05, 2000 12:57 PM
To: [log in to unmask]
Subject: Re: C++ as a first language

>The intro C++ is being taught without the object
>oriented aspects of the language, so I guess it really becomes a
>"C class using the non-object oriented constructs specific to C++ and
>not in C, and using a C++ compiler",
>from what I can tell.  The professors there are very concerned because
>students are performing much more poorly than they did with Pascal as an
>intro language.

>Now factoring out issues such as "teaching C++ for the first time" (which
>maybe is more important in all of this than the language) ..... well what
>your all thoughts on this.

My personal opinion, for what it's worth, is that this sounds a bit stupid!

If they're going to teach C++ without the OO aspects, they would be as well
teaching C as it would be much less confusing for beginners, however if that
the case, they would be much better teaching Ada as:

1) It has a Pascal-like syntax (so shouldn't be too difficult for the
to pick up)
2) It's OO features (at least those that are non-essential from a Software
Engineering point of view, such as inheritance and classwide programming)
can be
avoided if required for simplification
3) It is better as an introduction to Software Engineering because it makes
think more about what you're trying to do WRT type conversions, proper used
defined types and all.
4) It has inbuilt parallelism which replicates the way the real world works

One of the particularly good things about Pascal is the fact that it was
designed by Niklaus Wirth as a teaching language, this is not the case with
and certainly not with C++. Since Ada is, to a significant extent, a
of Pascal, it should also be adequate as a teaching language.

Whose idea was it to use C++? If they are looking to make the transition to
programming later on, then surely they could continue with Pascal in the
instance and then move on to Delphi?

I started with Pascal at university and, after using it for a couple of
years in
industry moved on to C. That jump was not particularly big as they're both
functional languages. However, in the early days of trying to run with C++ I
found it completely non-intuituve, particularly without a thorough grounding
the OO concepts on which C++ depended.

My view is therefore that if they want to teach C++, they need to teach the
concepts first (or at least at the same time).

Hope this is useful.