Homework 5: Java vs. C++
Contents:
[Background and Motivation]
[What to Read]
[Directions]
[The Problems]
Due: July 22, 1997.
C++ was once top of the heap: the most popular
and the dominant object-oriented langauge.
But Java has a great syntactic similarity with C++,
and a similar semantics.
Will Java take over from C++ as the top language for
object-oriented computing? For education?
In this homework, you will prepare for a class discussion and debate
on these questions.
This homework will also help you learn how to use research resources
better.
Especially on the internet, be sure to consider who is saying what,
and what their qualifications are. For example, are authors associated
with Sun Microsystems unbiased in their assessment of Java?
Are authors from Bell Labs?
This homework requires you to understand Java and C++ in programming
languages in detail.
You may want to refer to several of our books.
For example, look at chapters 2-7, 10, and 13 of
The Java Programming Language
by Arnold and Gosling (Addison-Wesley, 1996).
Or read chapters 3 and 4 of Just Java
by van der Linden (Prentice-Hall, 1997).
For a definitive reference, look at
The Java Language Specification
by Gosling, Joy, and Steele (Addison-Wesley, 1996).
You might want to compare to a C++ reference,
such as The Annotated C++ Reference Manual
by Margaret A. Ellis and Bjarne Stroustrup
(Addison-Wesley,1990)
or the reference manual section (R) in
The C++ Programming Language (second edition)
by Bjarne Stroustrup (Addison-Wesley,1991).
The draft standard for C++ is available on the web
at
http://www.cygnus.com/misc/wp/index.html.
This homework, like the others in this seminar,
will be open-ended and somewhat ill-defined.
we'll try to give you some idea of the difficulty/effort involved
in each part.
Do what you feel you have time for,
but please do something so that you can participate in the discussion.
The following problems are really questions to ponder while you read.
You don't necessarily need to write anything down.
-
(easy)
As you find new resources or good things to read,
post a URL or description of where to find them to our newsgroup:
isu.coms.java.
-
(moderate)
What makes one computer langauge more popular than another?
What technical factors affect the popularity of a language?
Do you think that the technical matters make a difference,
in the short or the long run?
-
(easy)
What syntactic differences are there between Java and C?
Between Java and C++? What is the rationale behind these
differences? Do you believe the rationale? Why?
-
(moderate)
Java doesn't use a preprocessor, it has no #include
directives and no macros. Is this a serious problem or a serious
benefit in Java? Why or why not?
-
(moderate)
What differences are there between the type systems of Java and C++?
What is the rationale behind these
differences? Do you believe the rationale? Why?
-
(harder)
What problems would the C++ type system cause for Java security?
Why?
-
(moderate)
Java has garbage collection as a standard language feature.
How does this affect your programming style?
Does it make programs easier or harder to write?
Do you think it will make people more productive?
Will it make programs more wasteful?
Will it make it harder to write some kinds of programs in Java?
What kinds of programs?
-
(moderate)
Java goes to some lengths to define details of arithmetic
and primitive types such as characters and integers.
Why? What benefits are there to the programmer from such
precision in a language definition?
Is there any cost in terms of speed of code execution?
-
(harder)
How would you compare the support for exception handling in Java
to that in C++? Does this affect your programming style?
Does it have other benefits for programmers?
Does it have a significant cost in execution speed?
-
(harder)
Compare the library support for C++ and Java.
Which makes it easier to write standard character-based applications?
Graphical user interface programs? Network programs? Graphics?
Are there any barriers to writing libraries of classes in Java or C++?
Are there any barriers to code reuse in either language?
-
(harder)
Which language is more complex, Java or C++?
Which would be easier to learn by experienced programmers?
By novices (students)? Which would you recommend that we teach
to freshman at Iowa State? Why?
Does the complexity of a language have other benefits or costs?
-
(harder)
Which language is more regular? That is, which language
has a more consistent set of rules and design principles?
-
(moderate)
Which language helps one write portable code more easily?
Why?
-
(hard)
What things could be improved about both Java and C++?
That is, what are the common problems they have?
[Back to the Fun with Java Seminar homepage]
Last update: $Date: 1997/07/22 22:05:33 $
Gary T. Leavens