Stephen Franchak
CMPS 334
Professor Jackowitz
Due 2/6/2012
Homework 01 – Exercises from Chapter 1
-
Why is it useful for a programmer to have some background in language design, even though he or she may never actually design a programming language?
Even though a programmer may never design a programming language, it is likely that studying and having a background in language design will make him or her a better programmer. By studying concepts of programming languages, a programmer can potentially increase his or her capacity to express abstract ideas, improve his or her insight for choosing appropriate languages for a new project, increase his or her ability to learn new languages, improve his or her understanding of implementation issues and details, and learn about the unfamiliar and unused features of a programming language that he or she already knows.
-
Why is type checking the parameters of a subprogram important?
Type checking the parameters of a subprogram is important because type errors in the program are detected before the entire program or the erroneous statement of the program is executed. The earlier an error such as a type error is detected, the less expensive and time-consuming it is to diagnose the cause of the issue and to make the required repairs. For instance, if the programmer accidentally passes an int type variable to a function that expects a float type variable as its formal parameter, any use of that parameter would potentially produce nonsense. Without the compiler or the run-time environment notifying the programmer that the type of the actual parameter in a function call does not match the type of the formal parameter in the function, a programmer may spend an indefinite amount of time debugging the code given that it produces unexpected output.
-
What have been the strongest influences on programming language design over the past 50 years?
The strongest influences on programming language design over the past 50 years have been machine architecture and software design methodologies. Most of the popular languages of the past 50 years have been designed around the von Neumann architecture. The languages designed around this specific architecture are called imperative languages. The central features of imperative languages closely model and efficiently utilize the underlying architecture. For instance, variables model the memory cells that data and instructions are stored in, assignment statements are based on how the architecture pipes data and instructions between the memory and the CPU, and the iterative form of repetition is the most efficient way to implement repetition because instructions are stored in adjacent cells in memory. Programming languages have also been designed around new software design methodologies that have emerged over the past 50 years.
Share with your friends: |