3 ms·
>Tooling is another major argument. vscode seems to figure out the types in javascript without any static typing. >But it is great for refactoring Searching
by 19873287234 9y ago
>Tooling is another major argument.
vscode seems to figure out the types in javascript without any static typing.
>But it is great for refactoring
Searching for strings isn't that much worse. Also, when it comes to web development, you cross into the client-side and suddenly you can't refactor. So you can only refactor the server-side and end up with a mismatch.
>finding all references to a function or a property or navigating through the code at design time
You can do that without static typing in many cases as well.
>Basically all the features visual studio excels at for .net languages.
When I was working in c# on the server and javascript on the client, I really hated having to go back into c#.
>telling you through a drop down what other options are available from there
vscode seems to be able to figure this out most of the time as well.
I think static typing is necessary when you need performance because all of the fast languages are statically typed.
I think a lot of these things are about organisational complexity and making sure new and average programmers don't screw up the software. It is about large companies trying to manage their organisation, it isn't about the complexity of the code itself.
There are a ridiculous amount of tech companies that have used dynamic languages to go from nothing to the biggest companies in the world and only switched to static languages well and truly after that occurred.
- cwyers 9y ago> vscode seems to figure out the types in javascript without any static typing. Doesn't it do this by treating Javascript as a statically-typed language (Typescript) and using type inference?
- 19873287234 9y agoNo it works without using typescript. I just figures it out through... I have never thought about it. I mean, var p = new Cat();. I am sure it can find the cat definition easy and read the properties and so on. It probably can't prove things 100% but it can guess very well at what things are.
- FLUX-YOU 9y ago>I just figures it out through... I have never thought about it. Are there not definitions written by someone or a tool that vscode looks at? That is what I saw using some npm packages with typescript: http://definitelytyped.org/ http://definitelytyped.org/
- cwyers 9y ago> I just figures it out through... I have never thought about it. https://github.com/Microsoft/TypeScript/wiki/JavaScript-Language-Service-in-Visual-Studio https://github.com/Microsoft/TypeScript/wiki/JavaScript-Lang... > Visual Studio 2017 provides a powerful JavaScript editing experience right out of the box. Powered by a TypeScript based language service, Visual Studio delivers richer IntelliSense, support for modern JavaScript features, and improved productivity features such as Go to Definition, refactoring, and more. It works off Typescript type annotations for packages and the Typescript compiler's type inference. VS Code's Javascript editing does not seem to be evidence for tooling around dynamic languages so much as it's evidence that if you have a lot of money and Anders Hejlsberg you can write a compiler for a statically typed language with type inference that looks like a specific dynamic language.
- DanRosenwasser 9y agoOur team (TypeScript) powers this experience.
- macspoofing 9y ago>vscode seems to figure out the types in javascript without any static typing. There are limits to type inference. And if you're going to rely on type inference to prevent runtime bugs you might as well double-down on static typing since you're giving up on some of the 'features' (insanity) of dynamic languages anyway. Dart 2.0 now mandates strict typing but will allow you syntactic shortcuts as long as the compiler can infer the type (if it can't, you get a compile-time error) - that's a great compromise. I wish more people would love Dart. It's such a great, well-designed, language. >Searching for strings isn't that much worse. There are very real limits with what you can do with 'strings'. And yes, it is that much worse. >When I was working in c# on the server and javascript on the client, I really hated having to go back into c#. I do not understand that view. You are an alien to me. C# is a beautiful language that fixes a lot of syntactic problems in Java. It is much more pleasurable to write C# code than JS code (outside of dinky 50 line programs). >I think static typing is necessary when you need performance because all of the fast languages are statically typed. That's not the only reason but it is one of them. JIT and AOT compilers can do more with strongly typed code. >There are a ridiculous amount of tech companies that have used dynamic languages to go from nothing to the biggest companies in the world and only switched to static languages well and truly after that occurred. Sure. PHP (pre-5) and JavaScript made a ton of money for a ton of people. Both languages were integral in the Web revolution. Doesn't change the fact that PHP was a terrible language and JavaScript is still a terrible language.
- valuearb 9y agoThe vast majority of development time is spent finding and fixing bugs. Small startups got huge often because they hit the sweet spot of features before anyone else, not because their code was high quality. Once they get large installed bases (and large valuations) they get religion about the value of more strict typing. The unknowable question is, would they have hit that sweet spot anyways by engineering their product more rigorously, and had less pain later? Or would it have impeded them in the exploratory phase of writing and rewriting their code until they hit that spot?
- matharmin 9y ago> vscode seems to figure out the types in javascript without any static typing. It is actually using TypeScript's engine for this. It uses TypeScript's type definitions where it is available (e.g. most popular libraries and built-ins), and some inference rules where it has to work with plain JavaScript. While this does give you decent auto-complete in a lot of cases (and still getting better), it's not quite as good as using TypeScript directly. > Searching for strings isn't that much worse. I'm busy with a large refactoring project, and TypeScript has been amazing for this. After restructuring code, you can just keep on fixing things until there's no more red. This is not just about reducing bugs - it removes almost any thinking/mental overhead required for the refactoring process. > Also, when it comes to web development, you cross into the client-side and suddenly you can't refactor. So you can only refactor the server-side and end up with a mismatch. TypeScript also works very well for client-side. Of course, if you change the API between the client and server, that's a different story.
- yawaramin 9y ago> There are a ridiculous amount of tech companies that have used dynamic languages to go from nothing to the biggest companies in the world and only switched to static languages well and truly after that occurred. This is a biased sample though. You're saying 'ridiculous number', but the truth is most startups (using static or dynamic languages) fail and we don't actually know if their language choice had much impact on their success or failure.