1.8 Learning Outcomes

Satisfying the text objectives outlined in Section 1.1 will lead to the following learning outcomes:

  • an understanding of fundamental and universal language concepts, and design/implementation options for them

  • an ability to deconstruct a language into its essential concepts and determine the implementation options for these concepts

  • an ability to focus on the big picture (i.e., core concepts/features and options) and not the minutia (e.g., syntax)

  • an ability to (more rapidly) understand (new or unfamiliar) programming languages

  • an improved background and richer context for discerning appropriate languages for particular programming problems or application domains

  • an understanding of and experience with a variety of programming styles or, in other words, an increased capacity to describe computational ideas

  • a larger and richer arsenal of programming techniques to bring to bear upon problem-solving and programming tasks, which will make you a better programmer, in any language

  • an increased ability to design and implement new languages

  • an improved understanding of the (historical) context in which languages exist and evolve

  • a more holistic view of computer science

The study of language concepts involves the development of a methodology and vocabulary for the subsequent comparative study of particular languages and results in both an improved aptitude for choosing the most appropriate language for the task at hand and a larger toolkit of programming techniques for building powerful and programming abstractions.

Conceptual Exercises for Chapter 1

Exercise 1.1 Given the definition of programming language presented in this chapter, is HTML a programming language? How about LATEX? Explain.

Exercise 1.2 Given the definition of a programming language presented in this chapter, is Prolog, which primarily supports a declarative style of programming, a programming language? How about Mercury, which supports a pure form of logic/declarative programming? Explain.

Exercise 1.3 There are many times in the study of programming languages. For example, variables are bound to types in C at compile time, which means that they remain fixed to their type for the lifetime of the program. In contrast, variables are bound to values at run-time (which means that a variable’s value is not bound until run-time and can change at any time during run-time). In total, there are six (classic) times in the study of programming languages, of which compile time and run-time are two. Give an alternative time in the study of programming languages, and an example of something in C which is bound at that time.

Exercise 1.4 Are objects first-class in Java? C++?

Exercise 1.5 Explain how first-class functions can be simulated in C or C++. Write a C or C++ program to demonstrate.

Exercise 1.6 For each of the following entities, give all languages from the set {C++, ML, Prolog, Scheme, Smalltalk} in which the entity is considered first-class:

(a) Function

(b) Continuation

(c) Object

(d) Class

Exercise 1.7 Give a code example of a side effect in C.

Exercise 1.8 Are all functions without side effect referentially transparent? If not, give a function without a side effect that is not referentially transparent.

Exercise 1.9 Are all referentially transparent functions without side effect? If not, give a function that is referentially transparent, but has a side effect.

Exercise 1.10 Consider the following Java method:

A set of five code lines in the Java method.
Description

This function cannot modify its parameters because it has none. Moreover, it does not modify its external environment because it does not access any global data or perform any I/O. Therefore, the function does not have a side effect. However, the assignment statement on line 3 does have a side effect. How can this be? The function does not have a side effect, yet it contains a statement with a side effect— which seems like a contradiction. Does f have a side effect or not, and why?

Exercise 1.11 Identify two language evaluation criteria other than those discussed in this chapter.

Exercise 1.12 List two language evaluation criteria that conflict with each other. Provide two conflicts not discussed in this chapter. Give a specific example of each to illustrate the conflict.

Exercise 1.13 Fill in the blanks in the expressions in the following table with terms from the set:

A table with seven expressions with blank spaces.
Description

Exercise 1.14 What is aspect-oriented programming?

Exercise 1.15 Explore the Linda programming language. What styles of programming does it support? For which applications is it intended? What is Linda-calculus and how does it differ conceptually from λ-calculus?

Exercise 1.16 Identify a programming language with which you are unfamiliar— perhaps even a language mentioned in this chapter. Try to describe the language through its most defining characteristics.

Exercise 1.17 Read M. Swaine’s 2009 article “It’s Time to Get Good at Functional Programming” in Dr. Dobb’s Journal and write a 250-word commentary on it.

Exercise 1.18 Read N. Savage’s 2018 article “Using Functions for Easier Programming” in Communications of the ACM, available at https://doi.acm.org/10.1145/3193776, and write a 100-word commentary on it.

Exercise 1.19 Write a 2000-word essay addressing the following questions:

  • What interests you in programming languages?

  • Which concepts or ideas presented in this chapter do you find compelling? With what do you agree or disagree? Why?

  • What are your goals for this course of study?

  • What questions do you have?

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.150.231