News for hackers. Stuff that matters.

19873287234

Re:Diminishing returns of static typing on Monday October 02, 2017 @12:17PM (#15385085)
No 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.
Re:Diminishing returns of static typing on Monday October 02, 2017 @12:06PM (#15384956)
I really don't think it does that. Most refactoring is not like that. It is about changing things at a deeper level than just the type.

I don't think they enhance code readability - I think they make it worse. I never look at the type when I am reading code, it just gets in the way.

Re:Diminishing returns of static typing on Monday October 02, 2017 @12:04PM (#15384923)
At a place I worked at once, it was "use Microsoft for everything". So yeah.
Re:Diminishing returns of static typing on Monday October 02, 2017 @12:03PM (#15384910)
The thing about magical refactoring though is that it often isn't a good idea. You usually don't just change the name of something, but you change it conceptually. If you just let the ide go and change the name everywhere, you create bugs because you never actually went and made sure the old code was updated for the new concept, rather than just the name.
Re:Diminishing returns of static typing on Monday October 02, 2017 @12:00PM (#15384868)
>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.