First off, let me preface my argument with these:
- Dart is in the middle-upper section of most loved / dreaded language in stackoverflow survey.
- Dart is not an all-purpose language. The main programming domain which dart tackles is mobile app development, but for the sake of argument, I’ll try to separate flutter and dart.
Without further ado, let’s get into the article
Recently I read an article explaining that dart is a terrible language. I disagree. During the time I’ve been using dart, it’s really good at doing what it’s doing and fairly bad at other areas. Let’s first explore the advantages of dart compared to other languages:
newkeyword for class instantiation
Since dart is a frontend-heavy language dealing with classes, the removal of the
newkeyword is really refreshing since we don’t need to add
newevery time we instantiate a new widget.
- Named arguments saves our eyes
My only qualms with it is the
requiredkeyword not being the default behavior, which forces me to use the keyword in a lot of places.
- It is similar to typescript
Typescript being the language that ranks 4th on Stackoverflow's most loved language list and one of the most used languages for web and mobile development makes it easier for Dart to gain popularity due to its similarity with typescript. Some similar features are revolving around its dynamically typed language, the usage of
constkeyword to declare variables (in dart
constare similar), the syntax of callback and arrow function, etc.
- It have no good competition … at least until Kotlin Multiplatform
React native is popular for its slow performance, Progressive web apps are getting progressively worse, js frameworks like ionic multiplatform never gets the hype, the list goes on. I have heard about kotlin multiplatform and kotlin compose getting some attention but for the foreseeable future, dart remains the best choice for multiplatform AOT language.
- Its beautiful formatter & debugging support, Good ecosystem in general
Dart have one of the best development tool for mobile development, period. Its debugging tool and the ability to add breakpoint midway, to see the live reload happening so quickly, etc. Also, Dart formatter which the previous article criticized is actually good. You need to put trailing commas for separate arguments to be in a different line.
I would argue that it’s a really nice feature, being able to either clump the widget by not using trailing commas or separating the lines by using it. Though, I guess you can make an argument out of this
All being said, dart is not an insane language. Some of the itch points that the aforementioned article said is true such as:
- Adding an underscore for private method is a questionable feature. This makes it harder (for me at least) to separate the private/public method since I’m used to looking for the
- Reflection is basically nonexistent in dart. Please, if anything, make the reflection better for easier testing purposes google. 💌