What are the key aspects of a strongly typed language?

前端 未结 8 2093
后悔当初
后悔当初 2020-12-09 17:26

What makes a language strongly typed? I\'m looking for the most important aspects of a strongly typed language.

Yesterday I asked if PowerShell was strongly typed, b

8条回答
  •  臣服心动
    2020-12-09 17:51

    According to B.C. Pierce, the guy who wrote "Types and Programming Languages and Advanced Types and Programming Languages" :

    I spent a few weeks trying to sort out the terminology of "strongly typed," "statically typed," "safe," etc., and found it amazingly difficult... The usage of these terms is so various as to render them almost useless.

    So no wonder why your collegues disagree.

    I'd go with the simplest answer : if you can concatenate a string and an int without casting, then it's not strongly typed.

    EDIT: as stated in comments, Java just does that :-(

提交回复
热议问题