Exercises

  1. Tuples and Lists. What is the value in having both immutable sequences (tuples) and mutable sequences (lists)? What are the circumstances under which you would want to change a string? What are the problems associated with strings that grow in length? How can storage for variable length strings be managed?

  2. Unicode Strings. What is the value in making a distinction between Unicode strings and ASCII strings? Does it improve performance to restrict a string to single-byte characters? Should all strings simply be Unicode strings to make programs simpler? How should file reading and writing be handled?

  3. Statements and Data Structures. In order to introduce the for statement in the section called “Iterative Processing: For All and There Exists”, we had to dance around the sequence issue. Would it make more sense to introduce the various sequence data structures first, and then describe statements that process the data structure later?

    Something has to be covered first, and is therefore more fundamental. Is the processing statement more fundamental to programming, or is the data structure?