In that case, can you tell me what the square root of a string is?
There are basically two ways of solving that:
- It is an error to apply a numerical operator on a string (Strong type system)
- And since it's an error, it should error at compile time if possible (Static type system)
- A string gets converted to a number in some well-defined way (latent type system)
If C/Java/etc. were the state-of-the-art in type systems, I would be for latent types all the way. But C wasn't the state-of-the-art when it was designed (Hindley and Milner were already playing with type inferencing systems at the time), and type systems have been developed a lot since then.
It's OK for C to not reflect the state-of-the-art at the time, since it's a practical language to solve practical problems. Using brand new and unproven concepts in language design is not conductive to solving practical problems. But type inferencing has come a long way, so modern languages no longer have an excuse.
"There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.