4 ms·
And the flip side of that, you can code much more according to interface and be less concerned with the specific type of bits in a variable.
by antidoh 14y ago
And the flip side of that, you can code much more according to interface and be less concerned with the specific type of bits in a variable.
- DannoHung 14y agoI'd like you to back that assertion. Why couldn't your types mirror your interface?
- antidoh 14y agoprintf, you have to know ahead of time whether you're going to be printing a string or a number. In python you just print
- DannoHung 14y agoprintf is not statically typed. That's the problem. What's the type of printf? it's int printf(const char *,...) The "..." part means that the function has to figure out what the types of all the arguments are. printf accomplishes this by, at runtime, parsing the string format and deciding what types to use. Contrast with a string representation function from a language like Haskell: show::(Show a) => a -> String No matter what argument is provided to the function show, as long as it observes the type constraint (Show a), a sensible result will be returned. Since it is known at compile time whether the argument observes the class constraint, there's never a surprise that value is printed incorrectly.