I'd say that while there's certainly a ton of purely dynamically-typed code out there, there's also a current reversal of the trend, with static and gradual typing coming back in vogue. Python has fully-supported type annotations, and Typescript is the trendy new way of writing JS. Facebook has ReasonML and Hack/PHP 7. Go and Rust, the current "cool kid" languages, are fully statically typed.
I think that the bad taste left in people's mouths by "enterprise" Java and its 30-character type names is fading, and that we'll see a few years of static types. Then of course the cycle will repeat itself, as is tradition.
in python this is an error:
>>> i = 10
>>> s = "20"
>>> s+=i;
TypeError: cannot concatenate 'str' and 'int' objects
>>> i+=s;
TypeError: unsupported operand type(s) for +=: 'int' and 'str'It should never happen in production - there should be a test that proves this.
In Common Lisp, the SBCL compiler would be such an example:
* (defun foo () (let ((i 10) (s "20")) (concatenate 'string s i)))
; in: DEFUN FOO
; (CONCATENATE 'STRING S I)
;
; caught WARNING:
; Derived type of I is
; (VALUES (INTEGER 10 10) &OPTIONAL),
; conflicting with its asserted type
; SEQUENCE.
; See also:
; The SBCL Manual, Node "Handling of Types"
;
; compilation unit finished
; caught 1 WARNING condition
FOO
*my preferred language is pike, which is a strong and declarative typed language (declarative typing is the term i prefer since not everyone defines static typing the same way, and some statically typed languages are weak, like this example here)
pike does catch type errors at compile time, but behaves like a strong dynamic typed language at runtime.
i understand that python and rubys optional types now allow for something similar.
I'm saying this as an experienced dev, please consider from this and others that you may be wrong, and avoid the trouble we've had.
Or not. Everyone has to find their own way.
I continue to use python without type-hints because of know of no other similar languages with type-hints that are as popular.