5 ms·
We thought maintaining two platforms was too much, so we got React Native. Now we have three to maintain.
by dep_b 6y ago
We thought maintaining two platforms was too much, so we got React Native.
Now we have three to maintain.
- ex3ndr 6y agoNo problem, you write this code once and reuse everywhere and you fixing bugs for all apps instead of hacking all by yourself for each platform. After coding for more than 10 years RN approach is so much better than native one.
- dep_b 6y agoI tried to work with React Native and while there are many things that especially iOS development could learn from the developer experience apart from the fact that it's a platform-on-platform (with the associated problems the poster I initial replied to, I just can't get over the fact I'm working with Javascript and everything related to it. I have built native interfaces that would interface C# code, that was slightly less pleasant as a developer experience while I would get a 100% native experience for the user and a better programming language in return. So what you gain in getting a singular code base for at least your logic and data parts you lose because you're chasing bugs that would never happen if you would have used a better programming language. The average native project I've seen had 5-15 dependencies. The average React Native project thousands and thousands of them.
- ex3ndr 6y agoOur app is much better written in RN than the one i built in native code. RN doesn't have native bugs - they are worked around unlike pure native development when you have to live with them. Have you tried to customize UINavigationController to run on every version of iOS? Almost all projects i have seen eventually replaced it altogether with a custom implementation. Typescript IS better programming language and much more powerful than, say swift. I can't see whats so special about swift comparing to typescript. I was coding for 5 years on swift and know what it is. Tests are much easier, typesystem is much more powerful and flexible. Compilation times are instant comparing to native. Please, don't rant on JS ecosystem and "dependencies". To build native app you download 30GB xcode, clang and god know how many different libraries and runtimes. JS just not install them globally and 90% of deps are for development only. Our app have 700kb of compiled JS. I have NEVER ever able to fit my kotlin/swift app to 700kb of compiled binary (excluding libraries).
- dep_b 6y agoCan’t remember the last time I had problems with UINavigationController besides the introduction of large titles but I can imagine you need to roll your own sometimes. > Typescript IS better programming language and much more powerful than, say swift. Nobody would use Typescript if it wasn’t the least bad way to deal with Javascript. > Tests are much easier Good because you’re going to need to write a shit ton just to verify everything that is verified for free by the compiler in Swift. > typesystem is much more powerful In what way? > and flexible. ...because it’s not that strongly typed > Compilation times are instant comparing to native. Objective-C was much faster too, because it moved a whole class of bugs to runtime instead of compile time > don't rant on JS ecosystem and "dependencies" We could just as well shut down HN if you’re not even legally allowed to rant on the bat shit crazy JS dependency trees anymore. > To build native app you download 30GB xcode, clang and god know how many different libraries and runtimes. Actually it’s a relatively small application with a shit ton of simulators shipped with it. So apart from the dramatically inflated download size (like that was even needed given it’s real size) you probably already knew this yourself. But nothing better than a whataboutism to cover up an inconvenient truth. —————— I actually got suckered into a point by point rebuttal where I already know where RN shines compared to native dev: Reactive as it’s basic pattern and hot UI reloads. Nobody would use Typescript if it wasn’t for JS compatibility. Python and Erlang are similarly weak typed, easy to write tests for and way more mature than JavaScript based language will ever be.
- ex3ndr 6y agoThis is so sad that i wasted time explaining something while you don't even know that typescript is statically typed language. That's the whole reasoning behind typescript. It is more powerful because it flexible because it's typesystem is turing complete and you can describe literally anything in it. Everything is strongly typed. It is powerful because you can express anything unlike swift/java/kotlin where you are forced for some subset of what can do in typescript. For example, good luck enforcing string variable to specific values only. Good luck working with two classes that have same fields but don't have common interface with them. It is the fact - you can do much less in this languages than in TS. Test also is the easiest thing to do in ts: i am coding for 20+ years and jest is simplest solution for tests ever. You just can't compare this to a shitshow of native testing (one is xcode because of xcode, another is android well because it is android). I don't understand how python or erlang relate to discussion of ts on rn. You advising to write ios apps in erlang? While you wasn't rational, i still tried to calculate how much i need to install to build anything with plain clang. I got docker with ubuntu 20.20, base image is 78MB. Executed: 'run apt-get update && apt-get install -y clang python3' now image is 700MB. And i still don't have llvm, debuggers and anything i need. The docker image of golang alpine is 350MB after downloading. Alpine itself is 5MB. So how small is small?
- tjkandala 6y agoI'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.
- dep_b 6y agoJavaScript 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.
- tjkandala 6y agoThat 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.
- ex3ndr 6y agoJeeez, 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.