Software Engineering for Students A Programming Approach
Software Engineering for Students A Programming Approach Software Engineering for Students A Programming Approach
The following issues are considered to be important: ■ matching the language to the application area of the project ■ clarity, simplicity, and orthogonality ■ syntax ■ control abstractions ■ primitive data types ■ data typing ■ enumerations ■ arrays ■ records (structures). Exercises 197 • Exercises 14.1 Suppose that you were asked to design a new programming language for software engineering. ■ select and justify a set of control structures ■ select and justify a set of primitive data types. 14.2 Argue either for or against strong typing in a programming language. 14.3 How many kinds of looping structure do we need in a programming language? Make suggestions. 14.4 From the discussion in this chapter, list the possible problem features with either programming languages in general or a programming language of your choice. 14.5 “In language design, small is beautiful.” Discuss. 14.6 Argue for or against the inclusion of the break statement in a programming language 14.7 The language LISP has the ultimate simple syntax. Every statement is a list. For example: (+ 1 2) returns the sum of the parameters. Investigate the syntax of Lisp and discuss whether every language could and should have syntax that is as simple.
198 Chapter 14 ■ The basics Answers to self-test questions 14.1 When some input from the user’s keyboard is required. It must be checked and, if necessary, new input solicited until the input is correct. 14.2 int[] table; boolean search(int wanted) { boolean found = false; int i = 0; } endSearch: while (i < table.length) { if (table[i] == wanted) { found = true; break endSearch; } i++; } return found; Without using break: int[] table; boolean search(int wanted) { boolean found = false; int i = 0; } while (i < table.length and found == false) { if (table[i] == wanted) found = true; else i++; } return found; 14.3 Yes and no. Clearly these operations are not something that should be allowed with integers and reals. But in Java the bit structure of these data types is precisely defined. Also the effects of these operations are precisely defined. So these particular data types have an extended set of valid operations.
- Page 170 and 171: 11.7 ● Discussion Summary 147 OOD
- Page 172 and 173: 11.11 Compare and contrast the prin
- Page 174 and 175: CHAPTER 12 This chapter explains: 1
- Page 176 and 177: 12.3 Delegation 153 The concepts of
- Page 178 and 179: 12.5 Factory method 155 The followi
- Page 180 and 181: 12.8 Model, view controller (observ
- Page 182 and 183: Figure 12.4 Pipe and Filter pattern
- Page 184 and 185: Figure 12.6 Layers in a distributed
- Page 186 and 187: Answers to self-test questions 163
- Page 188 and 189: CHAPTER 13 Refactoring This chapter
- Page 190 and 191: 13.3 ● Move Method 13.6 Inline Cl
- Page 192 and 193: class Sprite Instance variables x y
- Page 194 and 195: Summary Summary 171 it is making po
- Page 196: PART C PROGRAMMING LANGUAGES
- Page 199 and 200: 176 Chapter 14 ■ The basics and a
- Page 201 and 202: 178 Chapter 14 ■ The basics > > >
- Page 203 and 204: 180 Chapter 14 ■ The basics > Ear
- Page 205 and 206: 182 Chapter 14 ■ The basics > Cas
- Page 207 and 208: 184 Chapter 14 ■ The basics > > >
- Page 209 and 210: 186 Chapter 14 ■ The basics > } }
- Page 211 and 212: 188 Chapter 14 ■ The basics Unfor
- Page 213 and 214: 190 Chapter 14 ■ The basics Ada d
- Page 215 and 216: 192 Chapter 14 ■ The basics The w
- Page 217 and 218: 194 Chapter 14 ■ The basics In a
- Page 219: 196 Chapter 14 ■ The basics > str
- Page 223 and 224: CHAPTER 15 Object-oriented programm
- Page 225 and 226: 202 Chapter 15 ■ Object-oriented
- Page 227 and 228: 204 Chapter 15 ■ Object-oriented
- Page 229 and 230: 206 Chapter 15 ■ Object-oriented
- Page 231 and 232: 208 Chapter 15 ■ Object-oriented
- Page 233 and 234: 210 Chapter 15 ■ Object-oriented
- Page 235 and 236: 212 Chapter 15 ■ Object-oriented
- Page 237 and 238: 214 Chapter 15 ■ Object-oriented
- Page 239 and 240: 216 Chapter 15 ■ Object-oriented
- Page 241 and 242: 218 Chapter 15 ■ Object-oriented
- Page 243 and 244: 220 Chapter 15 ■ Object-oriented
- Page 245 and 246: 222 Chapter 16 ■ Programming in t
- Page 247 and 248: 224 Chapter 16 ■ Programming in t
- Page 249 and 250: 226 Chapter 16 ■ Programming in t
- Page 251 and 252: 228 Chapter 16 ■ Programming in t
- Page 253 and 254: 230 Chapter 16 ■ Programming in t
- Page 255 and 256: 232 Chapter 16 ■ Programming in t
- Page 257 and 258: 234 Chapter 16 ■ Programming in t
- Page 259 and 260: 236 Chapter 16 ■ Programming in t
- Page 261 and 262: 238 Chapter 17 ■ Software robustn
- Page 263 and 264: 240 Chapter 17 ■ Software robustn
- Page 265 and 266: 242 Chapter 17 ■ Software robustn
- Page 267 and 268: 244 Chapter 17 ■ Software robustn
- Page 269 and 270: 246 Chapter 17 ■ Software robustn
The following issues are considered to be important:<br />
■ matching the language to the application area of the project<br />
■ clarity, simplicity, and orthogonality<br />
■ syntax<br />
■ control abstractions<br />
■ primitive data types<br />
■ data typing<br />
■ enumerations<br />
■ arrays<br />
■ records (structures).<br />
Exercises 197<br />
•<br />
Exercises<br />
14.1 Suppose that you were asked to design a new programming language <strong>for</strong> software<br />
engineering.<br />
■ select and justify a set of control structures<br />
■ select and justify a set of primitive data types.<br />
14.2 Argue either <strong>for</strong> or against strong typing in a programming language.<br />
14.3 How many kinds of looping structure do we need in a programming language? Make<br />
suggestions.<br />
14.4 From the discussion in this chapter, list the possible problem features with either programming<br />
languages in general or a programming language of your choice.<br />
14.5 “In language design, small is beautiful.” Discuss.<br />
14.6 Argue <strong>for</strong> or against the inclusion of the break statement in a programming language<br />
14.7 The language LISP has the ultimate simple syntax. Every statement is a list. For<br />
example:<br />
(+ 1 2)<br />
returns the sum of the parameters.<br />
Investigate the syntax of Lisp and discuss whether every language could and should<br />
have syntax that is as simple.