News for hackers. Stuff that matters.
Re:Flutter looks good, but is painful by jazoom on Monday August 05, 2019 @04:18AM (#20612270)
>Adding Flutter or any other UI library that draws everything from scratch is a bad idea.

Some would say re-writing the same app 5 times (Windows, macOS, Linux, iOS, Android) and maintaining 5 codebases is a bad idea.

Re:Flutter looks good, but is painful by Cthulhu_ on Monday August 05, 2019 @05:03AM (#20612503)
IMO it really depends. There's a lot of big companies that have more than enough resources to be able to pay multiple dev teams to build and maintain apps across operating systems.

From a few years ago, Twitter and Facebook were famous examples. They pushed so hard to try and build their apps using web technology but kept running into performance issues (thanks to infinite scrolling). After spending fuck knows how much they finally admitted that maybe native components are better.

But this is Facebook, who have so much resources they can afford to build their own version of PHP three times over. I just don't understand why they put so much effort into trying to fit a square peg into a round hole instead of just going with native development.

But, I'm not an insider, I don't know the thought processes behind it. Long story short, IMO people overestimate how complex it is to build multiple native apps in parallel.

Re:Flutter looks good, but is painful by iainmerrick on Monday August 05, 2019 @05:17AM (#20612560)
people overestimate how complex it is to build multiple native apps in parallel.

I agree, although there are now more platforms to deal with than back in the days when it was just Mac and Windows: add iOS, Android, desktop web, mobile web.

I think it also helps when it's easy to share code between platforms, which again, used to be easier when you were just targeting the desktop (just use C or C++).

Now it's a bit harder because there are no great languages that span all platforms easily without a bit of hacking. Most languages are managed and memory-safe now; that's a good thing, but it makes them more heavyweight and less portable. They generally want to drag in their own frameworks (e.g. Flutter, React Native) rather than letting you put your own UI layer on top.

Re:Flutter looks good, but is painful by pjmlp on Monday August 05, 2019 @08:36AM (#20613615)
I remember the days of Apple II, TSR-80, Commodore 64, Commodore 128, ZX Spectrum, ZX Spectrum 128K, ZX Spectrum 128K +2A, ZX Spectrum 128K +3A, Atari, Atari ST, Amiga 500, Amiga 600, Amiga 1200, PC CGA, PC EGA, PC VGA, PC PS2,.....

Platform fragmentation exists since ever.

Re:Flutter looks good, but is painful by iainmerrick on Monday August 05, 2019 @09:21AM (#20613950)
You’re right, of course! It’s amazing to think how many 8-bit and 16-bit games got ported to a whole bunch of different computers.

I was thinking mainly of the 90s and early 2000s, I guess, and for desktop apps where the main platform of interest was Windows, followed by a long tail of Mac, X-Windows, BeOS, etc... All those platforms could “easily” (i.e. with effort, but no rocket science required) be handled by a single C/C++ codebase with platform-specific #ifdefs.

I think the equivalent for today’s platforms would have to be Javascript. Unlike the C/C++ approach, you lose direct access to platform features.

Re:Flutter looks good, but is painful by SkyPuncher on Monday August 05, 2019 @11:56AM (#20615132)
> I just don't understand why they put so much effort into trying to fit a square peg into a round hole instead of just going with native development.

I think in the case of something like Facebook, the sheer complexity of their product drives a need for a singular code base. It would slow their engineering organization to a halt to ensure feature parity with largely seperate code bases.

Re:Flutter looks good, but is painful by menckenjr on Tuesday August 06, 2019 @11:54AM (#20626293)
This is only true if you're working with multiple completely separate teams each working in a silo to develop their own product and then post hoc some manager decides they have to have the same feature set. If they do it the right way around, specifying the common feature set comes first and then the dev teams do the app architecture on their separate platforms. As the features are developed and change requests inevitably arrive, the same sequence applies and you have an orderly process and the same app on two or more platforms without having to graft a third party dependency octopus onto your codebase.
Re:Flutter looks good, but is painful by iaml on Monday August 05, 2019 @10:12AM (#20614354)
> performance issues (thanks to infinite scrolling)

This problem is already solved by virtualized lists available in any decent framework. Why people don't use it is beyond me.

Re:Flutter looks good, but is painful by amw-zero on Tuesday August 06, 2019 @05:08AM (#20623525)
It’s not built into any frontend web framework by default that I know of. It’s the default approach on Android on iOS.
Re:Flutter looks good, but is painful by iaml on Tuesday August 06, 2019 @07:28PM (#20630688)
It's not built-in, but plugins exist for react, angular, vue; svelte even has a first-party one.
Re:Flutter looks good, but is painful by dgellow on Monday August 05, 2019 @09:21AM (#20613944)
It depends what you mean by “re-writing the same app”. In general you can have the core features written in C++, thus available everywhere, then write a platform specific layer on top of this. That’s a quite common approach, and if done correctly (that’s not a trivial task though) allow you to target any platform without too much effort. But yes, you still have to maintain a bunch of stuff for each platform:

- implementation of the platform specific layer, supporting all the quirks of the target platform

- testing setup

- build system (some platforms have a lot of weird details to take in account)

The cost-benefit can be ok or terrible depending on the project. But for example for games, where you will draw your own UI anyway, that’s very common, and as far as I know that’s also what Microsoft is doing for their Office applications: common core in C++, then platform specific C#/Java/Objectice-C UIs.

Re:Flutter looks good, but is painful by rkangel on Monday August 05, 2019 @10:37AM (#20614547)
The expectation level for UIs on mobile devices has been set very high. There is a lot of detail to get right in order to deliver the experience that people expect. That UI specific work is very time consuming.

It doesn't really matter what else is going on in your app, if that work can be done more efficiently to produce a more consistent result, then that's the decision you make.

Re:Flutter looks good, but is painful by raydev on Monday August 05, 2019 @01:28PM (#20616108)
> work can be done more efficiently to produce a more consistent result

Often with frameworks like React Native or Flutter, it means inconsistent UX bugs on each platform. Why do you think Facebook and Instagram and Airbnb abandoned RN in all their primary interfaces?

The "more efficient" implementation might lead to consistency across platforms, but people are pretty tied to the phones they have. Things like dropped frames, slow scrolling, UI locks, all have a subtle effect on the user whether they can point it out or not, and you're more likely to have those problems by diving in to these frameworks without understanding the underlying platforms.

This isn't argument to share no code whatsoever. But so many people who immediately turn to these frameworks either want to ship something at the expense of UX/design, their app is so small that it doesn't matter, or they have no idea what they're getting into.

Re:Flutter looks good, but is painful by jeieo029 on Monday August 05, 2019 @04:10PM (#20618357)
That reads a bit like “we know what people expect from a UI but it’s hard.”

If we know so much about what they expect, why is it still hard?

I wonder if all the trend chasing is really just making busy work and getting in the way of truly standardized and dumb simple building of software.

Re:Flutter looks good, but is painful by pjmlp on Monday August 05, 2019 @04:55AM (#20612464)
Only when one doesn't use a solution like having the common logic in a portable language like C++, with bindings to native UI elements.

A solution used by plenty of commercial desktop software as we moved from Assembly as main application language for desktop apps during the 16 bit days.

Re:Flutter looks good, but is painful by TeMPOraL on Monday August 05, 2019 @05:21AM (#20612577)
Agreed. Mixing business logic and UI works in simple applications, prototypes, or applications intended to ever work with one platform and UI paradigm. Outside of that, you're supposed to keep your "business logic" and UI separate (isn't this exactly why people invented MVC?).

Maintaining "5 different native UI applications" should involve one codebase with the whole internal logic, and 5 separate UI layers mediating between that logic and the platform it's being run on (including UI). It should not involve rewriting the same thing 5 times.

Re:Flutter looks good, but is painful by nicoburns on Monday August 05, 2019 @05:26AM (#20612600)
A lot of mobile apps are almost entirely UI...
Re:Flutter looks good, but is painful by pjmlp on Monday August 05, 2019 @06:54AM (#20613003)
An UI without logic is an useless app.
Re:Flutter looks good, but is painful by solarexplorer on Monday August 05, 2019 @08:43AM (#20613670)
Often you can offload the business logic to the backend. That way you don’t have to implement it multiple times for each platform and you can change it “immediately” even if users don’t update their apps.
Re:Flutter looks good, but is painful by pjmlp on Monday August 05, 2019 @10:10AM (#20614332)
In such cases that same backend can send an XML (or JSON if you will) DSL payload that generates such UIs on the fly using the native widgets.

Pretty easy to create such framework in something like C++ or having a scripting language that drives the native UI widgets, something like JavaScript.

Re:Flutter looks good, but is painful by mrmonkeyman on Tuesday August 06, 2019 @01:22PM (#20627346)
The 90s called, they want their UI engineer back.

UI these days is often more complex than the underlying logic itself. App logic became, to me, even secondary. Most of those issues are solved problems (databases, sql, rest, xml, json) and are mindnumbingly stupid and boring to implement. Save data record.. query data record.. validate data record, yeah, yeah, really complex.

A good fancy UI however... good luck.

Re:Flutter looks good, but is painful by amw-zero on Tuesday August 06, 2019 @05:10AM (#20623537)
You don’t want to write the predominate amount of app logic in C++. I’ve been there. The portability isn’t worth it.
Re:Flutter looks good, but is painful by rvanmil on Monday August 05, 2019 @04:35AM (#20612362)
It’s great that there are a lot of cross platform solutions today. On the other hand it’s also the reason why we put up with shit apps like Slack’s desktop and mobile clients. As a macOS and iOS user I’m sad because both platforms have a far superior native UI, but at the same time as a developer I’m glad I can quickly build things for multiple platforms because there is no way my customers would pay for separate native implementations.
Re:Flutter looks good, but is painful by pcr910303 on Monday August 05, 2019 @04:29AM (#20612320)
> Some would say re-writing the same app 5 times (Windows, macOS, Linux, iOS, Android) and maintaining 5 codebases is a bad idea.

Yeah, that's true. I'm looking forwards to React Native (AFAIK it uses the native JS engine + native toolkits) and libui.

I'm also hoping for declarative UI frameworks like SwiftUI so that the underlying framework/runtime can generate the appropriate UI for the exact target platform.

Re:Flutter looks good, but is painful by krzat on Monday August 05, 2019 @05:09AM (#20612524)
> underlying framework/runtime can generate the appropriate UI for the exact target platform

This may seem like a good idea, but it's not. What you will get is a leaky, lowest common denominator API that will break on each new OS version.

Re:Flutter looks good, but is painful by saagarjha on Monday August 05, 2019 @12:05PM (#20615202)
I don't understand how you got to this conclusion.
Re:Flutter looks good, but is painful by krzat on Monday August 05, 2019 @12:28PM (#20615438)
I worked on Xamarin app and saw how things worked there. I also think that it's a logical conclusion from these conditions:

1. You want to support N native platforms. 2. Each of these platforms has it's own way of doing this, bugs, etc. 3. Each of these platforms is being actively developed. 4. There are differences between those platforms. One doesn't have guassian blur, the other one doesn't have right-to-left languages.

Re:Flutter looks good, but is painful by s_y_n_t_a_x on Monday August 05, 2019 @01:06PM (#20615827)
RN is more flexible. And you can always contribute or build your own native extension to use.
Re:Flutter looks good, but is painful by alex_suzuki on Monday August 05, 2019 @06:41AM (#20612931)
Well put.
Re:Flutter looks good, but is painful by turrini on Monday August 05, 2019 @10:33AM (#20614512)
Not true.

I'm working with C++/Qt/QML/Javascript. No need to maintain 5 codebases.

Just a single codebase compiles to at least 9 platforms: Linux, Windows, macOS, iOS, Android, *BSD, Raspberry, QNX and WebAssembly.

Re:Flutter looks good, but is painful by Spivak on Monday August 05, 2019 @10:40AM (#20614567)
Right, but QT apps are QT apps -- they're not really native on any platform which is the same problem you run into with Flutter an Electron.

If you want an app that has platform semantics on every major platform then you need separate code bases. If you want an app that has the same semantics on every platform then you go with a cross-platform toolkit.

Re:Flutter looks good, but is painful by jazoom on Monday August 05, 2019 @04:27PM (#20618552)
> Not true

What's not true? You just agreed with my statement. ¯\_(ツ)_/¯

Re:Flutter looks good, but is painful by turrini on Thursday August 08, 2019 @08:31AM (#20643881)
You said a need to "rewrite". That is simply not true. With C++/Qt I've only need to compile without changing a single line of code in any platform.
Re:Flutter looks good, but is painful by jazoom on Thursday August 08, 2019 @02:35PM (#20647251)
So you are arguing that no one "would say re-writing the same app 5 times and maintaining 5 codebases is a bad idea."?

That was my statement. You are saying it's not true. All the upvotes suggest some would say that. Therefore my statement is true.

I'm not sure why you're so confused here. This isn't at all applicable to what you are saying. You are talking about writing an app once and having one code base, which is exactly the opposite of what I was talking about. You have constructed a straw man and called it not true.

Re:Flutter looks good, but is painful by namelosw on Monday August 05, 2019 @08:16AM (#20613466)
> draws everything from scratch is a bad idea. > re-writing the same app 5 times (Windows, macOS, Linux, iOS, Android) and maintaining 5 codebases is a bad idea.

So probably React Native's approach (the approach itself, not React Native) is a really good idea, where you can:

1. Sharing code if you don't like re-writing n times. 2. Not sharing code if you want to have different native stuff for different platforms. 3. Mix 1 and 2 at any percentage as you wish. Typically reuse all the business logic, and separate view components.

Re:Flutter looks good, but is painful by amw-zero on Tuesday August 06, 2019 @05:03AM (#20623500)
I do get that, but one is bad for developers and the other is bad for users. It’s up to you to decide which is more important for your project. Most projects I’ve worked on, the user experience was more important to the business, in which case native apps are better.
Re:Flutter looks good, but is painful by meerita on Monday August 05, 2019 @05:11AM (#20612536)
I assume you also do custom code for each platform inside Flutter as we do to respect iOS and Android guidelines. Some things are different and need separate code. This is a pain too. I had much better experience coding only for the platform than using Flutter.
Re:Flutter looks good, but is painful by Asooka on Monday August 05, 2019 @05:02AM (#20612502)
There is always Qt and wxWidgets. Compared to e.g. electron for cross platform UI they are super tiny.
Re:Flutter looks good, but is painful by dgellow on Monday August 05, 2019 @09:24AM (#20613967)
Qt is a really good solution, but I personally always failed to build something that works with it. I find their documentation and tools really difficult to grasp.
Re:Flutter looks good, but is painful by s_y_n_t_a_x on Monday August 05, 2019 @11:40AM (#20615010)
React Native. Handles everything in your list. Experimentally Linux (via Qt).
Re:Flutter looks good, but is painful by amw-zero on Tuesday August 06, 2019 @05:12AM (#20623549)
Except you end up needing platform specific code with React Native anyway. Cross-platform toolkits don’t actually work in practice.
Re:Flutter looks good, but is painful by jrumbut on Tuesday August 06, 2019 @02:42PM (#20628155)
I don't understand the goal of 0% platform specific code (on a lower power device where UX is very important) or even further being able to make a whole app without having to learn about the platform, being aware of its conventions and limitations.

I've never finished a React Native app without native code. I've done a few now and I've come to believe it's not worth even trying to avoid it and sometimes worthwhile to look for places where a little native module can yield performance or UI wins. React Native is the glue or orchestration and it is, to me, extremely good glue.

I haven't seen many people beyond the tutorial level suggest otherwise. It provides a common structure (which is enormously useful), and some quick consistency wins for simple stuff like your About Us screen.