Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'm curious about the nature of your bugs. Are they the type of bugs that would be prevented by using TypeScript or knowing more about JavaScript, or were they bugs of your dependencies?

I ask because I'm looking to make a "native" app, and I'm debating between Swift and TypeScript + React Native. I haven't experienced many bugs from JS/TS, but that's because I try to avoid huge dependency graphs in my web apps. It would be concerning if React Native's dependencies were buggy enough to have to chase down multiple bugs per project.



JavaScript is very weakly typed. You can send an object to a function that expects an integer as an argument for example. Also there is no real standard library for a lot of things while Java, .net and Cocoa had them for decades.

This means there are many libraries just for date and calendar in JS that are really popular while everybody in Cocoa usually uses the ones already shipped with the OS because they work. This is why you see relatively few external dependencies on native apps.

Typescript fixes JS by adding types to the language but the runtime really doesn’t support them, so they’re kind of faked and built upon a leaky abstraction on top of JS.

This means there’s a larger possibility of runtime bugs where Swift and Kotlin offer a more secure type system, even compared to C++ and Java.


That makes sense. I'm usually secure with TypeScript because I try to use the strictest compiler settings, and try to use libraries with high coverage and/or written with TypeScript. Sounds like there are just too many libraries to audit for quality when using React Native.

Thanks for the information, I think I'll go with Swift.


Jeeez, i had zero issues with 3rd party libraries because of JS. 90% of a time it is iOS changed it's behavior or yet another bug on android.


Which exactly confirms what I said about having to maintain 3 platforms instead of 2. And React itself is also far from a stable target.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: