If you're about to say one of SmallTalk/Lisp/Python/Ruby, then no, they are good at prototyping but have all the pitfalls of Javascript when used on large teams. If you're about to say one of Java/Go, then no, you give up a lot of prototyping flexibility for their explicitness.
No, they absolutely don't.
>>> "1" + 1
Javascript: 11
Perl: 2
This is the kind of approach works ok for small programs. Where the code that does these implicit type casts isn't too buried.
When it's buried 3 layers down in a dependency used by a dependency used by a dependency, you want this to happen instead:
Python/Ruby: Type error
It does nothing to communicate invariants or guide API usage at design-time.
Consider PHP, which does have some of those bizarre and frustrating conversions, yet at the same time it also has stuff like type-hints and interfaces that can be used for design-time checking.
Literally what this entire thread is all about.
Lots of languages have this issue and it manifests in the instability and indeterminacy of large scale applications in Perl and PHP much as it does in javascript.
Type hinting is, honestly, a pretty poor way of dealing with the problem of turning "1" + 1 into 2, but that's a separate issue.
No it isn't, that's just what you've been fixated on. Please re-read nostrademons' post, because you aren't actually addressing the issues they brought up, namely:
> It's dynamic typing with a prototype-based object model. This type system [...] tends to be pretty bad at communicating invariants to other programmers or nailing down APIs for other subsystems to build off.
While it's true that Python "fails nicer" than JS, it addresses neither of those two issues about preventing failures.
I find that the big benefit of types are in documentation. They are executable, explicit, compiler-checked documentation of the programmer's intended usage. Without this, it becomes much harder to read through and comprehend a large codebase that was mostly written by other people. It becomes even harder to change it.
I like Python, I like Javascript - but they have their uses, and those uses don't include large-scale mature software engineering. I actually argued otherwise for my first couple years at Google (where both are used extensively, though the JS is largely statically typed), but eventually saw the wisdom of more experienced engineers in this, and relegated my Python to exploratory coding.
I guess companies should stop using Java for big enterprise applications with tons of dependencies. Or this isn't a problem because programmers usually know the basics of the language they are using. And if they don't, then that is the problem, not the language.
btw, Python: '1' * 3 -> '111'
Main.java:17: error: incompatible types: String cannot be converted to int
int z = x + y;
>btw, Python: '1' * 3 -> '111'In theory I agree with this but in practise I see this so rarely used it barely matters.
see here: https://repl.it/Cqeq/0
But that's not really the point, crdoconnor seems to think that languages should throw an error in cases like this, not just keep the type of the first argument.
What concrete examples were you thinking of? (You didn't mention any strongly-typed-dynamic languages in your replies to the others.)