As far as I know, developers enjoy working with React Native and strongly believe in the potential of Flutter, a young but a very promising tool. What do you think about them? Are they better than, for example, Xamarin and PhoneGap? What do you like more - React Native or Flutter? Why?
Hi,
I would opt for Flutter over React Native, but thatās only because Iāve tried to build a prototype in the latter. The result? Well, you really end up with 3 codebases when you use React Native (especially if you have a complicated application). One code base is JavaScript for the React Native code. Another is for native iOS plugins to handle what couldnāt be done in RN. Then thereās the codebase for native Android plugins that couldnāt be done in RN. You also have lots of āIf current OS is iOS, then do this. Otherwise, do thatā code. Yes, youāll have a panoply of if/else structures just because one platform has a particular control or way of doing things that doesnāt exist on the other.
Want to save your sanity? Write native apps. (Or perhaps try Flutterā¦might be good after all. Havenāt tried that one yet.)
Best of luck,
Richard
Last I came across a blog post on āMulti-OS Engineā (https://multi-os-engine.org) ā¦ Maybe give that a try?
Thank you for sharing your experience!
I asked on Twitter what people thought, and I wanted to share a few responses here for posterity:
https://twitter.com/rrubin/status/1050363052686757888
https://twitter.com/krzyzanowskim/status/1050363501288534017
https://twitter.com/botros__fadi/status/1050370223021481984
https://twitter.com/botros__fadi/status/1050370504064946176
https://twitter.com/Wassmerica/status/1050384425295458305
https://twitter.com/LinguaBrowse/status/1050727822703173633
I hope that helps - and thanks to everyone who contributed their advice!
Thank you very much, itās great to have a lot of opinions from developers!
Maybe this may interest you:
airbnb dropped react native
and some intelligent thoughts about native vs react:
This question is the most valuable question for software development at the moment. All the languages are rapidly changing to fullfill this question from the industry: please let us write one codebaseā¦
At my work we work with native code bases for android(java), iOS(objC&Swift) and some windows apps in C#. And we have javascript solutions like canvas, and react native with svgs and animations.
Both is possible. I prefer native code bases myself but sometimes it saves looots of time to develop something in a javascript solution like react en flux.
I saw some writings on the RWsite about writing in Kotlin and Swift. Thats something I want to dive into. Then you have native apps with similar code base structures and phrasing. Plus the optimal performance of the devices.
Iāve been writing software a long time ('83). Been doing Apple since '86.
In that time, Iāve seen one hell of a lot of cross-platform frameworks come and go.
These days, I choose to write Native iOS. in Swift. Using Appleās built-in frameworks.
React Native is a free lunch. Businessmen like it, because they believe they can hire cheap, shoddy JavaScript programmers, and come out with results ājust as goodā as iOS Swift Native, or Android Java Native.
Did you ever run into old-time Linux CLI jockeys that swore that X11 was going to ārevolutionize Linux as a desktop operating system,ā because it was ājust as goodā as native Apple Mac OS or Windows?
Soā¦howās that working out?
Sadly, T.A.N.S.T.A.A.F.L. I am forced to roll up my sleeves and āGo Native,ā so to speak. I have become VERY disappointed in a lot of todayās āfree lunches.ā Iāve always been very āclose to the hardwareā (came from Assembly and driver stuff), so I just plain old like it.
With one exception: I have seen some pretty good stuff done with Ionic (JavaScript). Iāve also seen some real dross done in it. It has a particular workflow and architecture that it addresses.
Theres a lot of negativity on this board towards React-native which is frankly not totally warranted.
There are a number of super successful and complex applications on the app store that are in fact written in react-native ( Uber eats, wix, Smarkets, taskrabbit ).
Some notes based on my own personal experience writing software with the framework, 6 years native iOS and 1.5 years on react-native.
The good.
- Donāt just code in vanilla JS, use a type system either flow (good) or typescript (better).
- The state management and diffāing mechanics of react lead to functional coding practices which creates highly deterministic code, I have grown to really enjoy redux and its something that would be quite difficult to reproduce in native code at least entirely.
- The react layout system is pretty great, super easy to use and read.
- Performance is good enough.
- You really donāt have to go near the native codebases, though its really useful if you know both platforms.
The bad
- Navigation is a mess, there are a couple of decent approaches ( react-navigation, react-native-navigation ) but no real consensus.
- Performance is awful if you are doing something complex or something gesture driven, you can get close to native otherwise.
- Doesnāt give the same compile time certainty as swift or kotlin, unless you are super strict with your opt-in typing system.
Its still miles better than phonegap and you donāt have the same platform edge cases to handle like xamarin. Its also proven in the wild and many companies happily ship with it everyday.
Flutter solves some of the performance hurdles of react-native ( no bridge ) so complex animations are a lot more fluid and you can do threaded actions through isolates, dart is also typed. However its largely unproven in the wild and doesnāt have the same developer support behind it.
I have successfully used Xamarin Forms on four different commercial apps and the capabilities required of each subsequent app are higher than the previous.
Iāve achieved multi platform with almost one code base (up to 95% re-use), things like push notifications need platform specific answers.
Having said that, the launch time feels longer than what I would like, so Iāve been tempted recently to look at other options.
React Native looked exciting, but I just jolt back from any technology that says you canāt just modify an entry in a list and for it to redraw (binding) instead you have to embrace reactive and mutate the list etcā¦ no thanks, this should be easy.
Flutter, this excited me, but I canāt embrace a technology that isnāt multi threaded, Plus I wasnāt clear whether Dart was transpired or not, but with such a small footprint it would achieve my quick load times.
I simply donāt have time to learn native fully on IOS and Android.
Iām stuck eith Xanarin for the foreseeable, but you know what, thatās not a bad place to beā¦ Microsoft are heavily supporting the technology so itās only going to get better (until the drop it )
The other angle to consider, customers donāt give a crap. Ultimately make a fantastic app and people will embrace the app regardless of what itās written in. Xamarin really is very productive and capable.
For an example of the most recent Xamarin app Iāve worked on is [Https://www.getvehiclesmart.com](http://Vehicle Smart)
The apps Iāve worked on include storage (SQLite, preferences), gps, push notifications, background service, custom renderers, dependency injection, lambda functions, threadingā¦ the list really does go on.
The more I think about it, the more I realise Iām using the right technology stack.
Thereās also the option of writing a Mac and Windows UWP app with it
Thank you for these articles!
Yeahā¦ Iām not really being fair, here.
I always get cranky when people get hung up on tools as being āmagic bullets.ā
The simple fact of the matter is, is that if you want to get good results, you hire good people.
Good people can be a really good native programmer, expert on the UIKit, or they could be a really good JavaScript programmer, expert with React Native. Each will give you an excellent result, given a problem domain to which the given skillset is best-suited.
And good programmers; regardless of their specialty, seldom come cheap.
It does get a little bothersome when you get āmy only tool is a hammer, so all problems are nailsā approaches.
Most hybrid systems will give very satisfactory results, when paired with a client-server system. The apps can be big, and you canāt get too fancy with UX, but, given good design and a good UX designer (pretty important -sometimes the engineer is good at it, but more often, youāll need to hire someone else), you can get very good results.
In these cases, you can get a lot of bang for your buck, as you can often get multiple-platform deployments for one (mostly) codebase. Donāt skimp on the programmer, but youāll get a decent Android app and a decent iOS app, suitable for simultaneous release.
They are maybe not so good for things like games, applications with intense UX, or intense communications requirements (like fancy WiFi/Bluetooth stuff). I just spent a couple weeks writing up a really nice spinner button, and thereās no way that could have been written in anything but native, or in a game engine (which would have been overkill, as these are going to be map markers). Iāve also written WiFi device control frameworks, and that needed not just native, but Objective-C native (for a static fat framework).
You get what you pay for. There just aināt no such thing as a free lunch.
Be careful listening to hype. Google āthe Dunning-Kruger Effectā to find out why a person can honestly believe themselves to be far more apt than they really are.
Thanks for the comment!
Iām new to software development, < 1 year. But from everything Iāve seen, the closest thing youāll get to cross platform is to learn C++.
I know that doesnāt address the OPās question about a framework that does all the magic for you, where it basically works like one massive adapter pattern providing one API in the place of the different APIs of all the platforms you wish to deploy to.
Even learning a low level language doesnāt solve the problems folks have addressed in this thread. Each platform has idiosyncrasies that call for different code. There will be different ways of handling user input and display. With C++ you still need to know how to use the various persistence technologies which are unique on each platform. Etcā¦
I think that the dream for a cross platform magic bullet will always be a matter of degrees and compromises. Exactly HOW cross platform do you want it to be? What I mean is, when you push for cross platform, do you want one code base that will run on EVERY platform? Android, iOS, web, macOS, Windows etcā¦ Or do you just want to cross two platforms? Just the mobile platforms?
If you narrow the degree of what you call cross platform to just the Apple ecosystem, you still see technologies that are imperfect compromises. I would argue that Auto Layout is a kind of cross platform technology. It allows you to build one app that runs and displays data on a wide variety of devices. And even that isnāt a magic bullet, and it was built by Apple itself to solve a narrow set of problems.
So, if the company that owns a given platform canāt perfect a āwrite once, deploy everywhereā technology for something simple like front end UI stuff, how am I to believe thereās a framework out there that will let me compile full apps for very different hardware? Oh, and the framework is free and open source-ish, you say?
There is also Haxe.
The Cross-platform Toolkit
Haxe is an open source toolkit based on a modern, high level, strictly typed programming language, a cross-compiler, a complete cross-platform standard library and ways to access each platformās native capabilities.
If we talk about the performance basis then definitely my answer would be flutter also in terms of compatibility app features, and engineering cost. However, React Native is good when it comes to finding software developers, cheap cost shortcode, and also having a small size of project.