13 ms·
To me as someone who recently got into Flutter to make a side-project (mobile game) the most glaring problem isn't the lack of ecosystem or little UI issues the
by tekkk 4y ago
To me as someone who recently got into Flutter to make a side-project (mobile game) the most glaring problem isn't the lack of ecosystem or little UI issues the author mentions but the language itself. You had a green field to make the best programming language for creating UIs and you made Dart? Like what.
I don't have particular issue with the heavy OOP paradigm but the fact you have to write so much boilerplate feeling code (Center here, Container there) you'd imagine you could have simplified it a lot more. The documentation itself also seems like it could be improved. And some little things here and there, like the constructor syntax. I dislike semicolons as well, to me they're just busy work.
Idk, you'd think an org like Google had the resources and the talent to make something truly amazing. Guess it just shows money can't buy everything. The tooling however is quite amazing. Being able to make cross-platform apps so simply is pretty awesome (React native was a pain in the butt the last time I tried it).
- wiseowise 4y agoThey didn’t create Dart for UI. It was dead and they shoehorned it into Flutter.
- spankalee 4y agoConsidering that Dart was made to run in browsers, they did in fact. The APIs the OP are complaining about are Flutter's not Dart's. Flutter tried to do a vdom-like thing that also included styling on top of regular function call syntax and it is... what it is.
- satvikpendem 4y agoThe style of writing the UI code takes some time to get used to, but the composability is really nice. For example, if I want to center something, I use Center and it works as I predicted. If I want to change the opacity of something, I don't need to find the opacity property of a particular widget, I can just...use Opacity, and it'll work for everything. This style is a way to have (extreme) composition over inheritance, which apparently was very useful for the framework authors who mentioned that they didn't need to keep reimplementing opacity for example for every single widget.
- kajecounterhack 4y agoTo be fair it’s not a bad choice for UI: supporting both AOT and JIT speeds up the dev loop and allows compiled performance + hot reloading in dev, which is good for UI development.
- gedy 4y agoYeah it was an attempt to fix JS before JS improved a lot in recent years, and before TS took off.
- satvikpendem 4y agoThey've answered why Dart many times. It's a language that fits their needs, since it has JIT, AOT, compilation to JS and now WASM. Back then there weren't many languages that could do all that, and even today there aren't many. Kotlin (and other JVM languages) and TypeScript (and other compile-to-JS-only languages) are already out since they are not AOT, only JIT even now. More importantly, it was a Google language that they could mold for their own needs, not so possible if it's an outside language like TypeScript. For example, early on, they asked the Dart team to create an AOT compiler since Apple does not allow JITted code apparently (not sure how React Native gets around this then), or maybe it didn't back then, and the Dart team was able to do it successfully for the Flutter team. Try asking the TypeScript team to do the same, it's next to impossible. For what it's worth, Dart 3+ introduces more functional parts like records, patterns, and exhaustive pattern matching so you can use it in a functional style if you want once that ships. There is also fpdart, for full functional support, and for brevity of code, since Dart has the ability to generate code via macros (with build_runner), you can also use packages like functional_widget, flutter_hooks etc to achieve a very functional code style as well, React-like. This is a great podcast/video episode on how Flutter came to be, from the early days to now, and how it used JS in the beginning but it didn't serve their needs, as well as how it used to be more imperative until a declarative React-like model was then made. https://www.youtube.com/watch?v=xqGAC5QCYuQ https://www.youtube.com/watch?v=xqGAC5QCYuQ
- nicoburns 4y ago> since Apple does not allow JITted code apparently (not sure how React Native gets around this then) With React Native you have two options. Use Apple's own JavaScriptCore engine which has special JIT permissions, or use Meta's Hermes engine which runs as a bytecode interpreter. In either case you can always drop down to native code (Swift/Objective-C (iOS), Kotlin/Java (android), or C/C++ (any platform)) which can be used for anything compute heavy.
- olliej 4y agoNo, the ability to JIT is not per framework (I'm unsure how that would work?), it's per process. Using JSC doesn't give you a JIT - now the JSC interpreter is very fast, so it's possible claims that they "need JIT" are incorrect (back when I worked on JSC it was a common belief from people that the JITs were magic fairy dust, and so would come in to anything with a data-less assumption that a JIT was needed), it's also possible that "react native" is using wkwebview in which case the content would be running in a separate web content process with a jit.
- zerr 4y ago> so much boilerplate feeling code (Center here, Container there) That's Flutter, the framework. I like Dart and I wish some conventional imperative Qt/Delphi-like GUI toolkit was available for it.
- chairhairair 4y agoYou can use Flutter as an imperative framework. Just ignore widgets (the reactive top layer of Flutter) and use the underlying imperative elements directly.
- zerr 4y agoWell, I'd say the main value proposition of Qt/Delphi/wxWidgets/WinForms/etc... is a rich set of widgets/controls including its event handling and layout mechanisms. Is such stuff available in the imperative impl of Flutter?
- sorokod 4y agoCenter here, Container there Is that really determined by Dart and not by how Flutter chooses to do things?
- satvikpendem 4y agoNo you're right, it's Flutter, they are misconstruing Dart and Flutter.
- sorokod 4y agoTrue, just have a look at Stack Overflow questions tagged Dart, very few (being extra cautious here) are not flutter question. https://stackoverflow.com/questions/tagged/dart https://stackoverflow.com/questions/tagged/dart
- satvikpendem 4y agoTo be fair, looking at Kotlin would likely yield similar results, being mainly used for Android.
- strongpigeon 4y agoI’m not sure why the Dart hate honestly. It’s a pretty solid language in my opinion and I like the direction they’re taking (non-nullable, record, pattern matching). The ecosystem is weak for sure, but that’s not a gripe on the language itself. I’m curious what do you dislike about it apart from semi-colons and the constructor syntax (which seem fine to me?).
- themerone 4y agoIt gets the hate because it comes from Google and it was originally marketed as a JavaScript replacement. Additionally, the first unoptimized compiler resulted in "hello world" having a gargantuan amount of JavaScript code. That left the language with a hard to shake stigma.
- satvikpendem 4y agoTo be fair, around a decade ago, Chrome wanted to add a Dart VM (Dartium) to which many vehemently protested, and I agree it would have been a bad move to have a browser essentially have its own language rather than JS, forcing other browsers to adopt it. From there though, we got a much better cross browser standards-based solution in the form of WASM, which is even more powerful since languages other than Dart could be used. This controversy is where I first saw the Dart hate, but it has grown into a nice language since, especially with Dart 3+ which introduces, records, patterns, and exhaustive pattern matching.
- strongpigeon 4y agoOh yeah I do remember that. I can see how some of that stigma lingers.
- dsabanin 4y agoExactly, after JVM world I'm especially loving reified generics. Being able to access type information on generics at runtime is very helpful. Plus developer experience for working with DartVM and Flutter is crazy good.
- tekkk 4y ago
- IshKebab 4y agoI think you give Dart too little credit. Consider the other popular languages of today - Python, JavaScript, C++. Dart is far nicer than those. I'd say it is nicer than Go too. I'm not sure what you mean about boilerplate. The way you create UIs in Dart is one of the main draws of Flutter. Would you rather Android's XML? Or QWidget? The language design is not an issue with Flutter. Flutter's issues are mainly ecosystem size and performance.
- MrDresden 4y agoDeclarative UI has arrived on Android via Jetpack Compose. So there is no need to create new UI in XML anymore. The abiliy to share the codebase between platforms is much bigger draw rather then the way that the UI is written.
- never_inline 4y ago> (Center here, Container there) Usually, it's a sign that you refactor something to a separate StatelessWidget or at least a function. If you're coming from web dev, you will be used to having all this container, padding, center, column code in CSS. Now you have it in UI. But on the flip side, this has its flexibility. You can usually refactor the styling part out of the actual widget if you want. For me the big problems with flutter are state management and platform interop. Yet it's nicer than most other options for developing UI.
- eddieroger 4y ago> Idk, you'd think an org like Google had the resources and the talent to make something truly amazing One would think that, which is why I struggle to believe Google is really invested in Flutter's success. They keep it alive and talk about it, but I wonder how much they actually care about it.
- deleted 4y ago[deleted]