3 ms·
static type checking is like compile-time asserts -- it doesn't add to solution complexity, it just verifies assumptions about inherent existing complexity.
by dustingetz 15y ago
static type checking is like compile-time asserts -- it doesn't add to solution complexity, it just verifies assumptions about inherent existing complexity.
- pekk 15y agoSatisfying a rigid, static type checking system often requires adding additional code which may not be significant to the solution. In other words, verifying assumptions requires additional code. Which assumptions actually need to be verified? Bondage-and-discipline languages do force you to do more thorough checking, but that doesn't necessarily mean the code is clearer or more concise. That isn't even the point of a bondage-and-discipline language. Getting normal things done with static type checking is not always simple; sometimes code gets skewed toward satisfying the type system. This is not completely unlike the way some people pepper their code with statements that serve no purpose except to shut up a lint tool, or make their test code simpler by making their solution code more complex. Assertions are an interesting case, as the programmer controls what gets verified and when, rather than being forced to code around an inflexible static checking system that inserts itself into language syntax.
- bad_user 15y agoit doesn't add to solution complexity Yes it does.