This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: Safety and strong typing Safety One property that is sometimes looked for in a programming language is safety. There is some confusion as to what safety means, but here is a definition used in the year 2000 by an ad hoc committee that recommended that the Advanced Placement (AP) test in programming be based on the programming language Java: Safety: Any attempt to misinterpret data is caught at compiletime or generates a well- specified error at runtime. C and C++ are not safe. An array index operation b[k] in these languages may be allowed even though k is outside the range of the array. There is also no built-in protection against using pointer manipulation to access almost any part of memory. "Buffer overflow" — akin to writing outside the boundary of an array— is exploited by many computer viruses. Of course, a progammer can explicitly check for overflow, but the language does not require it....
View Full Document
This note was uploaded on 07/07/2008 for the course CS 101 taught by Professor Gries during the Spring '08 term at Cornell.
- Spring '08