Software Engineering for Students A Programming Approach

Software Engineering for Students A Programming Approach Software Engineering for Students A Programming Approach

web.firat.edu.tr
from web.firat.edu.tr More from this publisher
21.08.2013 Views

CHAPTER 14 14.1 ● Introduction The basics This chapter reviews the basic features of a programming language suitable for software engineering, including: ■ design principles ■ syntax ■ control structures ■ methods and parameters ■ data typing ■ simple data structures. Everyone involved in programming has their favorite programming language, or language feature they would like to have available. There are many languages, each with their proponents. So this chapter is probably the most controversial in this book. This chapter is not a survey of programming languages, nor is it an attempt to recommend one language over another. Rather, we wish to discuss the features that a good programming language should have from the viewpoint of the software engineer. We limit our discussion to “traditional” procedural languages, such as Fortran, Cobol, Ada, C++, Visual Basic, C# and Java. (Other approaches to programming languages are functional programming and logic programming.) The main theme of this chapter is a discussion of the basic features a language should provide to assist the software development process. That is, what features encourage the development of software which is reliable and maintainable? A significant part of the software engineer’s task is concerned with how to model, within a program, objects from some problem domain. Programming, after all, is largely the manipulation of data. In the words of Niklaus Wirth, the designer of Pascal, “Algorithms + Data Structures = Programs” – which asserts the symbiosis between data

176 Chapter 14 ■ The basics and actions. The data description and manipulation facilities of a programming language should therefore allow the programmer to represent “real-world” objects easily and faithfully. In recent years, increasing attention has been given to the problem of providing improved data abstraction facilities for programmers. We discuss this in Chapter 15 on programming language features for OOP. As we shall see, most mainstream programming languages have a small core and all the functionality of the language is provided by libraries. This chapter addresses this core. Facilities for programming in the large are reviewed in Chapter 16. Other features of languages – exceptions and assertions – are dealt with in Chapter 17. 14.2 ● Classifying programming languages and features It is important to realize that programming languages are very difficult animals to evaluate and compare. For example, although it is often claimed that language X is a general purpose language, in practice languages tend to be used within particular communities. Thus, Cobol has been the preferred language of the information systems community, Fortran, the language of the scientist and engineer, C, the language of the systems programmer and Ada, the language for developing real-time or embedded computer systems. Cobol is not equipped for applications requiring complex numerical computation, just as the data description facilities in Fortran are poor and ill suited to information systems applications. Programming languages are classified in many ways. For example, “high-level” or “low-level”. A high-level language, such as Cobol, Visual Basic or C#, is said to be problem-oriented and to reduce software production and maintenance costs. A low-level language, such as assembler, is said to be machine-oriented, facilitating the programmer’s complete control over the efficiency of their programs. Between high- and lowlevel languages, another category, the systems implementation language or high-level assembler, has emerged. Languages such as C attempt to bind into a single language the expressive power of a high-level language and the ultimate control which only a language that provides access at the register and primitive machine instruction level can provide. Languages may also be classified using other concepts, such as whether they are weakly or strongly typed. This is discussed below. 14.3 ● Design principles Simplicity, clarity and orthogonality One school of thought argues that the only way to ensure that programmers will consistently produce reliable programs is to make the programming language simple. For programmers to become truly proficient in a language, the language must be small and simple enough that it can be understood in its entirety. The programmer can then use the language with confidence, probably without recourse to a language manual.

CHAPTER<br />

14<br />

14.1 ● Introduction<br />

The basics<br />

This chapter reviews the basic features of a programming<br />

language suitable <strong>for</strong> software engineering, including:<br />

■ design principles<br />

■ syntax<br />

■ control structures<br />

■ methods and parameters<br />

■ data typing<br />

■ simple data structures.<br />

Everyone involved in programming has their favorite programming language, or language<br />

feature they would like to have available. There are many languages, each with<br />

their proponents. So this chapter is probably the most controversial in this book. This<br />

chapter is not a survey of programming languages, nor is it an attempt to recommend<br />

one language over another. Rather, we wish to discuss the features that a good programming<br />

language should have from the viewpoint of the software engineer. We limit<br />

our discussion to “traditional” procedural languages, such as Fortran, Cobol, Ada, C++,<br />

Visual Basic, C# and Java. (Other approaches to programming languages are functional<br />

programming and logic programming.)<br />

The main theme of this chapter is a discussion of the basic features a language should<br />

provide to assist the software development process. That is, what features encourage the<br />

development of software which is reliable and maintainable?<br />

A significant part of the software engineer’s task is concerned with how to model,<br />

within a program, objects from some problem domain. <strong>Programming</strong>, after all, is largely<br />

the manipulation of data. In the words of Niklaus Wirth, the designer of Pascal,<br />

“Algorithms + Data Structures = Programs” – which asserts the symbiosis between data

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!