Comment by mike_hearn
2 years ago
That's not a TypeScript issue. I've encountered the same problem of not testing things properly in other languages. There's a definite mindset amongst some programmers that if it compiles and the unit tests pass, then it must work. I think a lot of less experienced devs have read too many blog posts on PL theory/testing and don't realize how many bugs are just not going to get caught by such techniques. You really do have to see something work with your own eyes and hammer it for a while by hand to know it's of a decent quality.
The fear of OOP is a problem though. I've encountered some really bad TypeScript/JS codebases that were just piles of top level functions for everything. The meme that OOP is bad is really damaging.
What’s wrong with top-level functions (as opposed to methods)? Is there a meaningful difference between foo(bar) and bar.foo()?
Same reasons JS has modules that don't export everything, and for the same reason that React reinvented OOP under a different syntax with function components. Encapsulation, API design, runtimes and IDEs all work a lot better if the tools are aware of the link between the data and the code that's manipulating it.