4 ms·
Your tests would catch breaking changes as well. In many typescript codebases (angular4) strict null checks is disabled befits are really minuscule. I am now d
by Chyzwar 9y ago
Your tests would catch breaking changes as well. In many typescript codebases (angular4) strict null checks is disabled befits are really minuscule.
I am now doing an angular4 project and I do not feel any safer. If you want to have real static typing use Elm, Reason, BuckleScript.
I do not trust MS. Tooling is already bad on anything other than VS Code. TypeScript development is slowing down from 2017.
- badlucklottery 9y ago>Your tests would catch breaking changes as well. Absolutely. But it only tells me where the code failed, not necessarily where my structural assumptions first fell apart. So I then have to walk up the stack looking for that point. It's pretty mechanical to do but typescript does it for me. This also assumes you have solid test coverage which unfortunately isn't always true. Especially for code that is being refactored because it's becoming (or already is) unsustainable. >In many typescript codebases (angular4) strict null checks is disabled befits are really minuscule. I agree that --strictNullChecks is very useful if the codebase often assigns meaning to null/undefined but that's more of an overall design problem. I feel there's a lot of benefit outside of that but I'm generally all for explicitness in code so I might be biased. >I am now doing an angular4 project and I do not feel any safer. If it's greenfield development, you probably won't for now. The implicit type system is fresh in your mind and having to explicitly put it into code is just going to feel like it's slowing you down. I suspect the benefits will come later when someone who isn't intimately familiar is looking at it (could be a new team member, could be you after another project or a vacation). >If you want to have real static typing use Elm, Reason, BuckleScript. For sure. But the downside with these is the commitment required. Typescript is as low effort/commitment as you need it to be. And an experienced js dev can pick up the basics in an hour. >Tooling is already bad on anything other than VS Code. I've only really used it in webstorm (which also uses the typescript language service) and it's never been an issue.
- earcaraxe 9y agoLook at mister test driven development over here. Hey everyone this guy writes unit tests. I'm joking here but I think that a lot of people ignore basics like writing unit tests, and that statically typed languages will break a lot more quickly and predictably for people who are lazier, since it enforces structure. However, I agree with you. Also I think that the people who really push for static typing are the kinds of people who already would write unit tests.
- Chyzwar 9y agoWe do. Most of our projects have 80%+ unit test coverage and decent amount e2e/acceptance tests. The problem with TypeScript is that in most codebases you will need to disable useful type-checks. Without strict null checking, you will only catch trivial errors. Additionally, you will interface with a lot of JS code that do not provide typings.