Can’t this be accomplished with JavaScript? Assuming your interested in clean code and best practices.
“Coupled with good unit tests”
Can’t you also write unit tests in JavaScript?
“if the type checker does not complain, you can be very confident the code you wrote is working and will work for a vast majority of the cases.”
This is a false sense of security. “Compiling” without errors just tells me I did not do something dumb like assign a string to an int. Is this really the main issue devs have? From what I have seen no… Devs usually need to chase down and understand the code regardless of type checking.
Thanks for your perspective!
I disagree. Working towards a successful "compile" isn't much different than TDD. The number of runtime errors I run into is significantly lower with TS than it ever was without which gives a very real sense of security.
You do need to understand the code but without types it can be very difficult to track down all the places that need to be fixed when you need to change your data model. Types are more important for refactoring than writing IMO
1 - Work-arounds for interoperability with non typescript / legacy third party dependencies. (issue: ugly, non consistent code)
2 - Turn off strict type checking due to third party component compatibility. (issue: isn't the purpose of typescript type checking?)
3 - Is type checking really needed for most applications? (assuming some flavor of CRUD with the occasional special sauce). (issue: seems a bit academic unless your working on a webapp for the mars rover)
This is coming from someone who programmed in java, .net, strongly typed languages for years and then feels like javascript is being held back with typescript. I love programming in vanilla javascript using frameworks (in this order) vuejs, reactjs, and charge extra to work on angular.
1 is almost a non issue. Most libraries have decent types and TS has features for adding types yourself in your project.
2 - I've never had to disable strict mode to get a library working. Worst case you can use things like `any` as an escape hatch out of TS but it is usually tucked away in a black box that is nicely typed. Do you have examples?
3 - Correctness is important for most professional software not just billion dollar NASA projects. Runtime errors cause crashes which wrecks UX.