@
FrankHB strong typing weak typing 还是有一定的标准的,例如维基百科上的说法:
In computer programming, programming languages are often colloquially referred to as strongly typed or weakly typed. These terms do not have a precise definition, but in general, a strongly typed language is more likely to generate an error or refuse to compile if the argument passed to a function does not closely match the expected type. On the other hand, a very weakly typed language may produce unpredictable results or may perform implicit type conversion.
概括点来说就是是否 ill-behaved 作为标准:
对于strong typing 来说,类型不符合预期不会导致 ill-behaved 是因为会报错(编译时或运行时都可以),程序无法继续运行。
对于 weak typing 来说,类型不符合预期,会通过隐式类型转换或者忽略而继续执行,导致产生预期以外的结果进而影响程序产生 ill-behaved。
区别在于行为是否在语言预期之中。