A weakly dynamically typed programming language (like PHP) made that the programmer's mistakes occur as non-coherent behaviours (for instance, the program gonna display stupid informations).
With a strongly dynamically typed language (like python), the programming mistakes causes error message. It makes the mistakes easier to uncover and diagnosis but in general the program became not usable after the message has been shown.
Finally, with a strongly statically typed language (like Java, Ada, OCaml, Haskell, ...) some mistakes can be uncovered at compile time and hence reduce the risk to provide an bugged program. (but the release occurs later)
Generally it's a matter of personal preference and the role that the architects of a given language's intended use.
PHP (a scripting language) for example makes sense to be weakly typed, as the tasks it generally performs are far less complex, and require less constraints then say a compiled language.
发布评论
评论(3)
弱动态类型编程语言(如 PHP)使得程序员的错误以不连贯的行为发生(例如,程序会显示愚蠢的信息)。
使用强动态类型语言(如Python),编程错误会导致错误消息。它使错误更容易发现和诊断,但一般来说,在显示消息后该程序变得不可用。
最后,使用强静态类型语言(如 Java、Ada、OCaml、Haskell 等)可以在编译时发现一些错误,从而降低提供有错误的程序的风险。 (但发布会稍后进行)
A weakly dynamically typed programming language (like PHP) made that the programmer's mistakes occur as non-coherent behaviours (for instance, the program gonna display stupid informations).
With a strongly dynamically typed language (like python), the programming mistakes causes error message. It makes the mistakes easier to uncover and diagnosis but in general the program became not usable after the message has been shown.
Finally, with a strongly statically typed language (like Java, Ada, OCaml, Haskell, ...) some mistakes can be uncovered at compile time and hence reduce the risk to provide an bugged program. (but the release occurs later)
是的。 Python 使用动态类型。
一般来说,这是个人喜好以及给定语言的架构师预期使用的角色的问题。
例如,PHP(一种脚本语言)是弱类型的,因为它通常执行的任务远没有那么复杂,并且比编译语言需要更少的约束。
Yes. Python uses Dynamic Typing.
Generally it's a matter of personal preference and the role that the architects of a given language's intended use.
PHP (a scripting language) for example makes sense to be weakly typed, as the tasks it generally performs are far less complex, and require less constraints then say a compiled language.
关于你的最后一个问题,Mathematica据说是“无类型的。 ”
Regarding your final question, Mathematica is said to be "typeless."