In your experience, how much time do you spend in the JS layer?
In your experience, how much time do you spend in the JS layer?
And even if you want to use those features, you could just use (even automatic!) polyfilling or a library that abstracts any differences away.
No application I've got my hands in nowadays (and there are some with a total of more than 100k LOC) contains a single line like "if (isMicrosoftEdge) { ... }". If you're doing that, you're not writing idiomatic JavaScript.
Of course you can do things that aren't portable, but writing open("/tmp/mytempfile.txt", "a") in python isn't portable either. Avoiding that is just knowing your job.
I'm preferring dynamic languages and lots of tracing and rollback capabilities in production in 2021.
Modern statically-typed languages are a totally different beast. Type inference is widespread and powerful, and you end up writing very little additional boilerplate. On top of that, guarantees like the prevention of null values greatly increase the value you get from having static types.
If you haven't tried one in a few years, I recommend revisiting them. TypeScript is a great place to start.
PS: It's totally possible, but also totally unnecessary, to write TypeScript like you would Java or C# (lots of classes, nullable-everything, explicit types for everything). To get the most out of it you honestly have to do the exact opposite of that (turn on strict null checks, use plain types, leverage type inference as much as possible).
I don't think people have that view because they haven't experienced modern static typing systems. I think they have that view because they aren't willing to admit that they make the kinds of mistakes that static types help with, and they aren't willing to admit that they benefit from the kinds of assistance that static types provide (autocomplete, go to definition, etc.).
It's annoying.
Of course, there is no general rule. This is true for the type of projects that I've been recently working on, which are small-scale distributed web systems.
If a new project demands a rigorous type system, I would probably go to something like PureScript[0] before going to C# clones like TypeScript. It seems that the compiler would help me a lot more in a language like that.
No you don't. See how autocomplete does with this function:
def foo(s):
s.
Now try it with type annotations: def foo(s: str):
s.A lot of misguided programmers think they don't write bugs and they don't need any help from autocomplete or linting or whatever. It's not just inexperienced programmers! A lot of experienced ones mistakenly think that they don't write bugs and therefore don't need to use anything that helps them detect bugs. How very dare you suggest that I might make a typo?!
I guess it is just hubris.
Of course for many advanced things you are forced to use types. Like shader languages. But thats not because the advancement there is in the domain of programming languages.
And your boos mean nothing. I’ve seen what makes you cheer.
I think Latin is even more of a "typed" language.
But anyway that is really irrelevant because it's not programming.
> But thats not because the advancement there is in the domain of programming languages.
Well, no because static typing is ancient.