Max Lybbert
Posts: 314
Nickname: mlybbert
Registered: Apr, 2005
|
|
Re: Authors and Computer Scientists Scared of Definitions?
|
Posted: Sep 11, 2006 2:44 PM
|
|
/* Eivind Eklund: I firmly believe that most of the time, the cost of the type declarations (in terms of programmer attention) is not worth it. */
/* James Watson: Assuming this is true, is saying that [whether a program will halt] could be determined by a type system the same as saying that halting is a type? */
No, but it is possible to determine that the program's use of types is incorrect and can lead to halting.
/* I can come up with some other possible 'properties' of a program: correct, efficient, backwards-compatible, multi-platform, beta, production-ready, state-of-the-art, exciting, boring, annoying... */
And while those may not be types, in many cases a type system can help you reason about those properties (backwards compatible, search for "Mr. Rogers" in http://www.joelonsoftware.com/printerFriendly/articles/fog0000000036.html "The code will be factored to use two interfaces: V1 and V2. ... V1::Save can handle the backwards compatibility while V2::Save can be used to save all the new stuff. If you've opened a V1 file and try to use V2 functionality, the program can warn you right away, and you will have to either convert the file or give up the new functionality.")
So far I like Vesa's definition, that a type defines data and the accepted operations on data. You may choose to go through a language mechanism to create a type, or you may simply decide to use int s, and outlaw multiplcation by management fiat. You could even go with a dynamically-typed system. Regardless, you've got the data and you've got the acceptable operations. And armed with those two, you can reason better about what you're doing.
|
|