5 ms·
I'm currently 5 months into developing a mobile app for a startup with flutter and my experience so far is very underwhelming. Flutter as a framework is not th
by reader_mode 6y ago
I'm currently 5 months into developing a mobile app for a startup with flutter and my experience so far is very underwhelming.
Flutter as a framework is not the worst but far from best, it's very OO while trying to use reacts vdom model which just wants to be functional.
The biggest limitation of the platform is Dart - it's a horrible language that should have died once TS and ES6 became mature enough. And I've used dart back when it was supposed to be a JS killer shipped with browsers, used dartium to build a MVP for an app using Angular Dart durgin the betas.
Back then Dart was miles ahead in terms of tooling and JS the language didn't even have async/await - so I was singing it's praises. But the language stagnated and it's fundamentals with a nominal type system and a closed object model make the language so inflexible and full of boilerplate it's incredible. It's very much like Java (the language, without the powerful ecosystem) and people prefer Kotlin for frontend for a reason. C# is similar but they figured out that they need to build a lot of things in to the language to reduce the boilerplate so they are adding stuff like Records and pattern matching.
If you look at state management patterns in flutter there's probably 5-10 competing approaches all lacking in their own way and all severely hampered by how unexpressive dart is. Or how you deal with serialisation/immutability/etc.
- xvilka 6y agoWould have been be nice if they provided a way to use Kotlin Native as a language for Flutter instead. Not a JVM Kotlin of course, because it's too slow for the native mobile apps. Or, even better, Rust. That would be very impressive.
- Hixie 6y agoIf you prefer Kotlin you may find https://developer.android.com/jetpack/compose https://developer.android.com/jetpack/compose more to your tastes.
- xvilka 6y agoIt looks like Android-only, while Flutter is cross-platform.
- PhilippGille 6y agoI guess this is the relevant link: https://www.jetbrains.com/lp/compose/ https://www.jetbrains.com/lp/compose/
- codethief 6y agoCould any Android dev veterans chime in and comment on JetPack? This is the first time I'm hearing about it and I'm not sure I like it. It looks like a weird blend of HTML, CSS and JavaScript event handlers and I'm starting to wonder: Why not use web technologies from the get-go then and make use of the lessons learnt there? This reminds me, I'm getting the impression that with every new UI framework that gets released, we're just recycling ideas learnt on the web and re-living its paradigm shifts: 1. First, in the early days of the web, we defined UIs declaratively but mixed structure and looks (`<h1><font face="Comic Sans MS">Hello, world!</font></h1>`). 2. Then we separated content structure (HTML) and styles (CSS) (or even XML and XSLT) 3. Later on we added dynamics and discovered event handlers (JS) 4. Then we realized we could use JS for everything (content, styles, dynamics) and imperatively create & manipulate UIs by manipulating the DOM (document.createElement, jQuery, d3). 5. Finally it dawned on us: That's not a good idea, either, because 1) we're mixing business logic and styling and 2) the DOM is global state. So we switched back to the now classic separation of using HTML for content, CSS for styles and JS for dynamics. But this time we try to keep individual components (their state, their DOM and their business logic) neatly encapsulated (React, Angular, Web Components).
- kllrnohj 6y ago> Could any Android dev veterans chime in and comment on JetPack? Small nit but Jetpack is the name of the entire suite of libraries that Google offers for Android. The thing formally known as "support lib", a name that stopped making sense when it had random useful stuff not just compat stuff. You're talking about Compose here (or Jetpack Compose).
- codethief 6y agoOh right, I meant Compose. Thanks!
- The_rationalist 6y agoThe step 6 is to integrate graalVM into web browsers in order to allow seamless interoperability between any language (e.g Kotlin) and any other language, especially javascript and the web apis. Unfortunately because of harmful politics from mozilla pushing the NIH webassembly, it's not going to happen before a proponent come (maybe Microsoft someday)
- oscargrouch 6y agoI'm doing something that while not the same thing, it let you control the web infrastructure with native languages. The first SDK is in Swift. But im sure that with enough work a Rust Sdk could be created as most of the core functionality is exposed as a C interface. The product i'm finishing is more of a answer to the question of if there's something between the browsers and mobile application platforms that could also work in a more distributed fashion.
- The_rationalist 6y agoSo what about working on integrating graalVM into chromium so that e.g Kotlin can interoperrate with javascript and the web apis? That would be the best solution and support for swift could be added as graalvm supports llvm.
- oscargrouch 6y agoIf you can create a binary that links with a C api, its possible. The access to DOM apis are going over the C, so its just a matter of wrapping all up in the target language. Im using the Chrome multi-process architecture, but instead of a renderer process what gets called is a application executable that binds to Webkit and acts as the renderer process do to Chrome now. So this gives the application much more control over the client rendering, hooking over every event WebKit triggers, something that is not even possible with Javascript now. So its much more powerful. You also have a "service" process which runs as a service, that is actually the one that receive every request and can launch the application process or do something else. The requests are over GRPC, so the service process serve not only the UI requests for routes but also the RPC method calls to the API it defined according to what the app does. The API for both are in Swift, but the core runtime and system is on C++ and in a multi-process architecture, so any native app that can compile into a standalone binary and interface with a C api can also use the facilities. The applications and resource distributions are over torrent so anyone can serve the application without any intermediaries or shipping on servers. If a app want to talk to the cloud, its just a matter of doing so when processing the routes or the RPC method calls, but it can work offline or eventually online/offline given its design. I've heard Kotlin can produce standalone binaries, so that means its possible (and no WebASM shenanigans with direct access to Webkit and with the real native boost) Unfortunately i cannot ship with another SDK right now because i'm doing too much already, but i intend to create interfaces for other languages once things are more stable, and people understand better what is it's place in the game. But is more a application and window manager as Chrome is more-less and less as Electron or Flutter, where it wraps a standalone app. With this design together with the RPC api's exposed by each application, you end forming a local network of apps, where they can work with each-other. And with the Api's working as a social contract, you can replace the application to serve the same things without losing everything (effectively real data ownership) But my goal is that you can just call "./pacman" and the thing pops, even being managed by a core process as in chrome. The user dont need to deal or know anything about it.
- The_rationalist 6y agoYou really don't know what you're talking about, do you? Kotlin jvm is significantly faster than kotlin native. Also both kotlin native and Kotlin jvm are multiple time faster than dart. Indeed Kotlin is a better language than dart. Rust is obviously a missfit for frontend programming, nobody wants to loose productivity on low level issues such as memory management.
- raze4daze 6y agoJVM Kotlin (or Java) is more than fine. Rust sounds absolutely dreadful for front end. Let’s not go down that path.
- leppr 6y agoThat corresponds exactly to my experience when I tried it a few years ago. Very disappointing to learn nothing changed on that front. The "just works" aspect of Flutter is what attracted me to it initially, and it took me a few weeks before realizing React-Native, as much of a clusterf*ck as it was, was still a more pleasant development experience.
- netdur 6y agoSorry but you don't know what you are talking about, try to use Dart as Dart, not as what you think Dart is... You have a mind block.
- reader_mode 6y agoAs what exactly ? Look at libraries like built_value and built_collection. That level of boilerplate and code generation is only seen in Java land, even there there's better stuff because the metaprogramming is better with stronger reflection capabilities. Dart is a worst of all worlds - languagee designed by VM engineers in a Java shop