re: Will Typescript Make Your Software Bug Free? VIEW POST

FULL DISCUSSION
 

A type system like Typescript isn't a magic bullet, any more than BDD or TDD, but it can catch issues you'd miss otherwise.

My experience is more with Flow than Typescript, but I've found that adding explicit types to my Javascript means I have to think more about the type of any arguments I pass to a function or method, and means it's clearer how something will behave. It's also useful for React components in particular to specify what the props passed to the component are using Flow types.

Along similar lines, in the last few years I've begun using type hints more in PHP (both parameter and return types), and enabling strict mode, and it's caught a fair few bugs that would have slipped through otherwise.

As an application gets bigger, it's been my experience that defining explicit types and enforcing them becomes more and more useful, because you can then guarantee you aren't going to get any weird errors due to treating something as the wrong type.

 

A type system like Typescript isn't a magic bullet, any more than BDD or TDD, but it can catch issues you'd miss otherwise.

As you said, there will be never a magic bullet.

I should try typing for Python soon.

code of conduct - report abuse