by Alifatisk on 1/12/2025, 2:31:15 PM
Here's the cons from my experience.
Dart does not cross-compile, it's still an issue to this day and there haven't been any plans to fix that yet from what I can tell. https://github.com/dart-lang/sdk/issues/28617
Another slight issue I've found is the error message it spits out is kinda unhelpful most of the time, but that issue also applies to Flutter. The stacktrace is like 100 lines with only the five first rows is helpful, the rest is internal code.
Dart lacks a repl (there is this package called Interactive but it's a hacky solution).
One last thing I do not enjoy about Dart is that even if the code compiles, you are not guaranteed that the massive refactor you did is "sound", that will say, errors can popup during runtime, so you have to write tests for every part. This is such a bummer because in Java, if I do a large refactor and the linter, ide and compiler is happy, then you will likely be rest assured that the program will run fine (JavaFX is a exception).
Dart is a language meant for ui development, nothing else. The team doesn't seem interested in splitting up the language from the Flutter framework. There have been tons of work from the community to provide tools for standalone application / backend development (see Shoelace and Serverpod).
The pros is a beautiful, expressive language with awesome DX. Good range of packages available and easy to meta-program with, it's not on the Ruby level but with "extensions" you can do lots of fun stuff. Dart deserves more love than what it currently gets.
I have been working with flutter and have come to really like Dart. I'm primarily a Java dev and to me Dart feels like a lighter Java with better dev experience. I am considering using it in other areas - command line projects, webapps - basically places I would have used Java, Python or Go. What are pros/cons people have found in using Dart outside of the flutter ecosystem?