Hacker News new | ask | show | jobs
by mikece 2938 days ago
There are several aspects of Flutter that are compelling. The two which I find the most interesting are speed of development and the platform independence when designing the app.

Speed of development: I've seen Flutter development referred to as a "double hot reloading" dev paradigm: UI and app logic. Hot-reloading the UI on design changes isn't new (React Native, NativeScript, and even Xamarin can do this) but the team at Google made a purpose-built debugging compiler for Flutter which separates state management from the app logic so if you're working on code deep into an app and need to fix something in the logic, the executing code is reloaded while the app's state and UI remain where they are so you don't have to start over from the launch screen, log in, start your transaction/order/process..... This process cycle -- launch, login, start an order, get to the state of an order to test the logic I just altered -- used to consume five to ten minutes per iteration when I was doing Xamarin work. Being able to edit and re-run the application logic without losing state and starting over is HUGE!

Platform independence: the UI for Flutter apps doesn't rely on the native OS widgets of iOS or Android (or Fuchsia!) but a C++ layer that bundles and ships with the app in question. It's akin to building a business app in game template where you can custom-define everything about the UI and any widgets you want to use... a lot of work but they will look and act the same on iOS and Android (and Fuchsia) and presumably run fast. This is a massive difference from Xamarin where cross-platform apps end up using the platform-native widgets which is known to result in non-trivial amounts of "if (Platform_Android) {...} else if (Platform_iOS) {...}" or just going the more sure-fire way of not entering Xamarin-debug-hell: make the UI for your app using the platform-specific Xamarin-tooling and move as much code to the share logic layers which don't need to be changed between Android and iOS.

The final thing I'll say about Flutter: I told a colleague who thinks that C++ is the ideal cross-platform mobile language about Flutter. Two weeks later he came back, told me he made a demo app with it, then decompiled the resulting IPA and APK files to inspect the assembly code and he concluded that it was essentially the same as if the app had been written in C++ from the get-go. I'll take his word for it since I lack the skills to verify that for myself but it certainly speaks well for the performance potential of Flutter!

1 comments

> This is a massive difference from Xamarin where cross-platform apps end up using the platform-native widgets which is known to result in non-trivial amounts of "if (Platform_Android) {...} else if (Platform_iOS) {...}"

Is your Xamarin experience using Xamarin.Forms? It sounds like Forms allows for more cross-platform gui code reuse. I'm doing a lot of investigation into Xamarin because I'm learning C# this summer for an internship and I love the language.

Xamarin.Forms provides an abstracted UI definition of common controls across platforms. This makes design faster since you can simply specify a Button or a Picker without knowing or caring that the actual implementations on iOS are UIButton or UIPickerView (eg: UIDatePicker) or that on Android they are android.widget.Button or android.app.DatePickerDialog. All UIs defined in Xamarin are rendered with OS-native widgets.