Theory of Programming Languages
Due: September 7, 2011
- In C/C++, you can increment a variable using any of:
x += 1;
x = x+1;
Do some research on these statements to answer the following questions such
- Why have multiple ways of doing the same thing (non-orthogonality)?
- Why is the syntax x += 1; rather than x =+ 1; ? See if you can
track down a version of a language that actually did this.
- Is there any real difference with today's compilers? A bit of
programming can be done here (hint: look at the assembly/intermediate
- What other factors come into play?
- Early versions of COBOL had a limited version of the IF statement.
Track down information on this limitation(s?) and report on it.
- The original designer of Java intentionally left user-defined operator overloading
out of the language. What was his reasoning? There are advocates
of putting this feature back into the language. Discuss the pros and
cons of doing so.
- Chapter 1, Problem Set. Problems 11, 12, and 18.
- Chapter 2, Problem Set. Problems 8, 11, 12, 14, 18, and 24.