5 ms·
I could go on and on. The point is not to get hung up on specific examples, but to note that there is a ton of semantic information about a piece of data, any o
by quanticle 13y ago
I could go on and on. The point is not to get hung up on specific examples, but to note that there is a ton of semantic information about a piece of data, any of which may be a) relevant to the user and b) irrelevant to the goal or capabilities of the compiler's type system.
But doesn't that just mean you have a bad type system? I mean, the entire point of a type system is that it automatically checks these sorts of constraints for you. Otherwise, why have types at all? Why not just use chunks of bits?
- gfodor 13y agoYou can flip it around and ask why have names at all? What is the point of a name? Why not just have randomString() choose your names? The name is an important dimension that is provided by a programming language to describe some piece of information. Hungarian is a way of leveraging this dimension, which is separate from the type system, that is optimized for efficiency at the cost of intuitivity. Also, many of the examples I gave above have little relevance to enforcing constraints on the use of data, which is the job of the type system, but are still relevant to the programmer in helping them understand and properly work on the code.
- noblethrasher 13y agoAmong the things that names/identifiers do: (1) They act as indexes or discriminators. (2) They describe. (3) They prescribe. (1) will be useful for at least as long as we program in a textual medium. (2) is also useful, but type systems make it ancillary. (3) is dangerous since it's merely an ought statement that can easily get divorced from reality; decent type systems obviate the need for that role.
- gfodor 13y agoYou're completely ignoring the role and importance of notation. Type systems do not take on the role of efficiently conveying information to a reader visually through symbology, which is part of the role of notation. Types in a type system have names, after all, and the choice of those names is also one of notation. Good notation comes largely in part from good names and has little to do with type systems. Hungarian is an exercise in notation, hence the name.