Most of you probably believe TypeScript is best practices these days. It has some advantages, but also disadvantages. Here are some myths and probl...
Some comments have been hidden by the post's author - find out more
For further actions, you may consider blocking this person and/or reporting abuse
The research you linked doesnt appear to conclude what you are concluding from it.
This is true. Type safety does not directly reduce bugs. It just catches some bugs at compiletime instead of runtime. A lot of the repos they tested use other testing strategies to catch runtime bugs. They also discuss this in their discussion a few reasons why their research could be wrong about this :P
They say exactly the opposite about bug resolution time from what you claim:
And in their discussion part, they discuss atleast one other study who found that Typescript DOES decrease the number of bugs. So one could just as easily link to that research and claim the opposite of what you are saying...
Your problem #1: I dont follow your reasoning... You dont want to use named exports? Then dont... You can simply turn it off in your eslint. Your code completion is going to suck, but whatever floats your boat I guess 🤷
Your problem #2: Why would you want to fetch ts files over a network? You compile typescript to javascript... How imports are handled in the compiled js depends on the module resolution you specify in your tsconfig: typescriptlang.org/docs/handbook/e... you can control nearly every aspect of how your ts code is compiled into js, here are all the options: typescriptlang.org/tsconfig
Your problem #3 I disagree with completely. Typescript is powerful because it does type inference, MS spent a shitload of time making sure it has very strong type inference. They encourages you to NOT over-use typing, but rely on type inference whenever possible.
Everything I claim has support in the research, everything. If you don't agree so is it unfortunate, but your words have no weight compared to that research paper.
Regarding others research papers that claim the opposite:
I am free to change my mind, but you need to show me a research paper that have:
Named exports is bad because it increase coupling and it my friend have proven to be bad. Why do you think we have variables? Functions? Modules? Every single thing of those are connected to less coupling. And do I actually need to tell you that you don't need to tell a more senior developer than you what she or he cannot do? Answer: You don´t.
You want to avoid path traversal and you do it by providing specific import/dependency specifiers. If you don´t understand why it is bad thing with the explanation I gave in the post so is there nothing I can say to help you, unfortunately.
So you would say the general recommendation in the TypeScript community is not to add type-annotations and instead let the TypeScript compiler figure it out? I gotta say, you have no clue what you are talking about then. If it was the goal, would TypeScript team remove the "strict" mode immediately and just give a warning the code complexity is so high so it cannot understand what type some value has.
I quoted literal phrases from the research that YOU shared. They are not compatible with the claims that you make. Ergo, you are just here to troll. I would be impressed, except this particular troll topic has already been visited by so many other trolls, its kinda sad you couldn't come up with something new.
I claim TypeScript have equal or more bugs than JavaScript code. And it is the result from the research:
I don't claim TypeScript don´t have benefits, even if you code in assembler it has benefits. I claim TypeScript do not make your code having less bugs. THAT IS THE CLAIM!
Correlation doesn't equal causation, though. There could be any number of reasons for that, e.g. TS apps could also be correlated with having more mature bug reporting systems, hence more bugs are reported, hence more bugs fixed. Another hypothesis could be that devs working on TS projects are more likely to classify something as a bug vs an enhancement. Or that they're less likely to combine multiple bugfixes into a single commit. Or that the overall speed of iteration is faster on TS projects, hence more bugs are introduced, because feature commits tend to cover more functionality at one time.
Not saying any one of those is necessarily true, just that a correlation on its own proves nothing without further investigation.
Sure, but its research. There is always a bunch a reason why something are the way they are. That is why more investigation is needed. However,if you keep in mind:
Makes your explanation very unlikely. Sure, it can be that way, but it's unlikely. Why should developers behave complete different in their commit-style if they have the same skill? They probably´t don't.
In science is it always extremely important to take the most logical explanation first until evidence says otherwise even if you don't like it. As newton would argue: An apple falls down to the ground. The ground does not rise to the apple.
We should also mention, that module encapsulation in Javascript is also not very strict (see here). As TS is transpiled to JS, this will affect the result anyway.