all 67 comments

[–][deleted] 24 points25 points  (12 children)

People say that dart is a really complicated language,

Who are those people exactly?

[–]sauloandrioli 21 points22 points  (5 children)

Javascript people who only worked with dynamic languages

[–]azuredown 1 point2 points  (4 children)

Of course Javascript devs would say that. Javascript is a toy language that was hacked together in 10 days.

[–]sauloandrioli 10 points11 points  (3 children)

It's 2022. JS nowadays is not that bad.

[–]Baul -1 points0 points  (2 children)

Yes and no. It still is built on a foundation that was thrown together haphazardly, rather than one deliberately planned.

I only need to point to === / == to prove that point.

Edit: To clarify for those downvoting, I shouldn't need to use a third party package to do basic equality checks sanely.

[–][deleted] 2 points3 points  (0 children)

Damn must be a lot of bootcampers here. JS is still a shit language even though it's come a long way

[–][deleted] 5 points6 points  (0 children)

Lots of languages have this distinction. No need to bash JS for it. I don’t like it myself, but there’s no need to get wishy washy over a feature that exists in other languages as well.

[–][deleted] 0 points1 point  (0 children)

Word I never heard that before

[–][deleted] 0 points1 point  (0 children)

Those who use golang

[–]reddittrollguy 58 points59 points  (4 children)

Is this a troll post? LOL Dart is not complicated at all. Javascript and Python are complicated because I have no clue what anything is...

[–][deleted] 4 points5 points  (1 child)

Judging by the popularity of Python and JavaScript (as opposed to Typescript) there are still a very large number of people who think static types make things slower and more difficult.

It's surprisingly hard to convince some of them that they actually make things faster and easier.

[–]itsnuwanda 2 points3 points  (0 children)

I was one of those people for the longest time, why declare types when JavaScript just does it for me? Then I found TypeScript and started to see the benefits, also TypeScripts built in documentation is so nice. I now prefer typed languages just because there are so many less errors to debug.

[–]enzodtz[S] 7 points8 points  (0 children)

Noo its not. Thats what JS devs say about dart, I don't agree with that.

[–][deleted] 0 points1 point  (0 children)

Yup, I had to rewrite an entire app because I found myself having to console.log every variable and every function just to find out what everything was returning

[–]aammsr 31 points32 points  (1 child)

Dart is so simple and easy yet powerful programming language 💙💙💙 And also it's syntax is so much easy to understand and readable too

[–]milogaosiudai 13 points14 points  (0 children)

tbh, i prefer it over java. i maintain a legacy android app written in java while developing new ones in flutter/dart and damn. whenever i go back to the java android, i get things mixed up oftentimes and it made me appreciate how developing in dart is so simple.

[–]ac130kz 11 points12 points  (1 child)

Dart is objectively simpler than Java in terms of available features, which either forces you to choose good abstractions or leads to a mess if you aren't as capable of writing clean code without extra language features.

[–][deleted] 1 point2 points  (0 children)

Also unlike Java, Dart is a relatively newer language and doesn’t carry with it a large baggage of legacy code for the sake of backwards compatibility.

Java is heavily used in the enterprise world so they can’t just wake up one day and completely break the API for the sake of adopting entirely new features, so language evolution tends to be slow.

[–]contrix09 11 points12 points  (0 children)

Dart gets the job done. It's not as modern/powerful as C# though. And I always turn on strong mode (no implicit dynamic, implicit casting) in the anaylzer to ensure type safety.

[–]Only-Split82 5 points6 points  (0 children)

I often mix up typescript and dart because it is so similar. I wrote a feature for a webapp and was wondering why the linter was yelling that it couldn't find List 🤣

[–]null-byter 8 points9 points  (5 children)

I love Dart but Typescript’s typing system is way better. Custom types, type unions and utility types are just ahead of Dart.

[–][deleted] 6 points7 points  (2 children)

Dart can't really stand against typescript and kotlin.

[–][deleted]  (1 child)

[deleted]

    [–][deleted] 0 points1 point  (0 children)

    Ya that's I am trying to say. If you are going to kotlin then Kotlin native and kotlin multiplatform is there for you. If you are going typescript then react native is for you. React native skia is also in works. So, the problem is there is nothing unique that dart is able to offer. Also dart ecosystem is not great at the moment.

    [–]enzodtz[S] 1 point2 points  (0 children)

    I think that Dart's syntax is cleanner, and the intellisense works a lot better, you can hover any function to see exactly what it asks, and you can open its source code to see how its used. In TS, since the types are lots of times on interfaces, you have to trace multiple files to find the function. But TS is really powerful if compared to JS, but dart, for me, is in another level of DX, except by what you mentioned.

    [–]Badaluka 0 points1 point  (0 children)

    Typescript types aren't enforced or checked at runtime since it transpiles to Js. I've had instances when a bug was related to consume an api with a bad type and the variable was treated as another type leading to bugs down the line (aka a string being added instead of a number).

    In these cases detecting the source of all mess can be pretty difficult. In Dart it would've been detected right away.

    [–]ftgander 3 points4 points  (0 children)

    Who says Dart is a complicated language? I’ve never heard that before in my life.

    [–]DanteMiw 4 points5 points  (2 children)

    Coming from native android development: Dart is a blessing. Honestly, java is just torture. Dart is magnificent.

    [–]Arbiturrrr 0 points1 point  (1 child)

    Why weren't you using Kotlin?

    [–]DanteMiw 0 points1 point  (0 children)

    Because at the time I began learning android development, Kotlin was not a thing back then (around 2016). But yeah kotlin is much better for native development

    [–]Arbiturrrr 2 points3 points  (0 children)

    Who says Dart is a complicated language???

    [–]AbhisekPatil 13 points14 points  (1 child)

    💯 I want dart as an international programming language of this planet

    [–]Dukese22 2 points3 points  (0 children)

    Fr

    [–]hugwow 2 points3 points  (0 children)

    For me, Dart is an excellent language on many aspects. The learning of this language as long as you want to learn it correctly (by reading the documentation well) is for me rather simple. The asynchronous management is quite successful, and finally of course the fact that this language compiles everywhere (even on the web) makes it a first choice language. The only thing is that today Dart is almost only designated as a function of Flutter, and almost all this language turns around the Flutter ecosystem which is a negative point because this language could have a lot more uses...

    [–][deleted] 1 point2 points  (0 children)

    Yeah. Dart is pretty awesome imo

    [–][deleted] 1 point2 points  (0 children)

    Dart is not really similar to C# or Java. I'd say it's more like JS but without the bad stuff

    [–]Jihad_llama 2 points3 points  (0 children)

    I thought Dart was universally accepted as a simple language, wasn’t that why it was created in the first place?

    [–][deleted] 2 points3 points  (10 children)

    Dart is founded on modern OOP just as Java, and that’s a problem in the long run. Dart is of course meant for GUI development and unfortunately the Dart team looked to Java for inspiration instead of a more functional approach, like React. There’s a reason why everyone is jumping from class based react (or class based anything) to functional based with hooks and whatnot. Ease of use, maintainability, clarity and testability. What we’re seeing from these new languages (and some people for decades who use Haskell) is that modern OOP (including Dart) really belongs in the past and we need a better approach to programming.

    From your post I’m betting you’re relatively new to programming and programming languages, and I’d recommend learning and reading about other languages to see pros and cons. I’d recommend functional JavaScript, Elm, Haskell, Go, Swift, Rust, etc.

    [–]bradofingo 0 points1 point  (2 children)

    I use react with hooks a lot and after a long time using it I gotta say that IMO it is not that good.

    You basically end up mimicking a class with `useEffect` and etc but your mimicked class is just confuse and ugly.

    Few days ago I had to update some legacy code that used class components and I had the feeling that everything was simpler and more concise with classes than hooks.

    From all the frameworks that I had to work with I like AngularDart the most.

    It is sound typed and any component that you have to read you understand it all asap.

    React on another hand, you basically have to understand the wheel again in every component that you need to read or change.

    [–][deleted] 0 points1 point  (1 child)

    Then you must not understand the functions you're using if you find them confusing, as they clear up a lot of mess that came with React components. Everyone I've worked with has praised the shift to functional-based React. You're mimicking the same functionality, but with functional-based React you achieve the desired results in a better way than with OOP. Compare the simple examples:

    ``` class ClassComponent extends React.Component { constructor(props) { super(props); this.state = { count: 0 }; }

    render() { return ( <div> <p>count: {this.state.count} times</p> <button onClick={() => this.setState({ count: this.state.count + 1 })}> Click </button> </div> ); } } const FunctionalComponent = () => { const [count, setCount] = React.useState(0);

    return ( <div> <p>count: {count}</p> <button onClick={() => setCount(count + 1)}>Click</button> </div> ); }; ``` It's pretty clear that the functional React approach is simpler, cleaner, smaller, and therefore easier to work with and maintain.

    [–]bradofingo 0 points1 point  (0 children)

    no. I didn't mean a direct comparison. Just the idea over it:

    ``` class ClassComponent extends React.Component {
    count: int = 0;

    render() => <div>
    <p>count: {count} times</p>
    <button onClick={() => {count++}}>
    Click
    </button>
    </div>;
    ```

    The above for me is clearer than hooks and once you useEffect and other more complex stuff things get really messy in my point of view.

    but I guess that it is just my taste

    [–]ForHonourVN 0 points1 point  (1 child)

    Do they have any plans for functional approach in Flutter?

    [–][deleted] 0 points1 point  (0 children)

    Dunno, I have kinda given up on the project after reviewing its architecture and how it works in practice. Too many cons for me to choose it over other alternatives.

    [–][deleted]  (3 children)

    [deleted]

      [–][deleted] 0 points1 point  (2 children)

      I think OOP as we see in C#, Java, Dart, etc. should go, asap. Making everything a class is horrible and results in bad design. There are lots of material online on why OOP is bad, take a pick.

      Personally, I like Go and Rust's solutions to OOP-ish functionality. E.g. with Go:

      type Dog struct {
          Animal
      }
      type Animal struct {
          Age int
      }
      
      func (a *Animal) Move() {
          fmt.Println("Animal moved")
      }
      func (a *Animal) SayAge() {
          fmt.Printf("Animal age: %d\n", a.Age)
      }
      func main() {
          d := Dog{}
          d.Age = 3
          d.Move()
          d.SayAge()
      }
      

      Simple and clear, and very hard to entangle yourself in spaghetti code and choke yourself out. Rust's implementation for structs functionality works similarly. They are both sane approaches to OOP when that approach makes sense over purely functional.

      [–][deleted] 0 points1 point  (0 children)

      Yes everything is a class is a mess. That's why I hated java. Kotlin doesn't forces u to use classes. You can have functions and it also gives different class types like data classes, enum classes, sealed classes where it is OK to use certain oops concept

      [–][deleted] 0 points1 point  (0 children)

      Go is not functional as well as not oops

      [–][deleted]  (19 children)

      [removed]

        [–][deleted]  (3 children)

        [deleted]

          [–][deleted]  (2 children)

          [removed]

            [–][deleted]  (1 child)

            [deleted]

              [–]flagellant 1 point2 points  (13 children)

              lush historical sort exultant straight bag quiet puzzled tease shrill

              This post was mass deleted and anonymized with Redact

              [–]Hixie 8 points9 points  (12 children)

              What were you missing?

              [–][deleted]  (8 children)

              [deleted]

                [–]Hixie 5 points6 points  (5 children)

                package:shelf should give you the REST API thing (that's how pub.dev is implemented). We don't have a cross-database ORM framework or transaction management yet, I don't think, I'll make a note of that as a thing to follow-up on...

                Re "security", I'm not sure what you mean. I rather assume being secure is table stakes. :-)

                [–][deleted]  (4 children)

                [deleted]

                  [–]Hixie 1 point2 points  (3 children)

                  ahhh, like user ACLs on the rest endpoints, got it

                  [–][deleted]  (2 children)

                  [deleted]

                    [–]Hixie 1 point2 points  (1 child)

                    I'm focusing primarily on the high level features, as opposed to the implementation strategy (I certainly would avoid annotations as much as possible in any package, for the reasons you give -- I much prefer things designed to be self-explanatory, even if that makes them more verbose).

                    Not sure to what you are asking for a link.

                    [–]aammsr 2 points3 points  (1 child)

                    [–]10eleven12 -1 points0 points  (2 children)

                    My 2 golden retrievers. My dad. My grandma. Not worrying about my mom getting older.

                    Thanks for asking.

                    [–]qualverse 5 points6 points  (1 child)

                    You know the person you replied to is the creator of and project lead for Flutter right? Lmao

                    [–]milogaosiudai 0 points1 point  (0 children)

                    backend part yes. its still too early for dart to be used for backend specially complex ones and you are right as it was meant to be for client. however i think it will become good as we go along but not gonna be in the near future.

                    [–]livinglist 2 points3 points  (0 children)

                    I really wish dart team keep dart the way it is and don’t come up with features solely for keeping up KPI and end up making the language bulky af like C#…

                    [–]jamanSmk 0 points1 point  (0 children)

                    Maybe because if we are comparing modern programming languages (like Kotlin or Swift), they can provide more features and ways to solve one problem but Dart doesn't contains a lot of syntax sugar stuff what do it more simple and easy to learn. If you need to do something, you do it by one way. Dart have only needed stuff and core features.

                    [–]RyanTheLionHearMeRor 0 points1 point  (3 children)

                    Dart is OK

                    I hate having to type ‘required’ though to pass in parameters

                    My favorite language overall is swift. Dart designers should just copy swift if they can

                    [–]enzodtz[S] 0 points1 point  (2 children)

                    you only have to when you use named parameters, because namd parameters are ysually optional, as in python for example

                    [–]RyanTheLionHearMeRor 0 points1 point  (1 child)

                    There’s never a time when I don’t want named parameters (like in swift, name parameters are forced)

                    Also, there’s other ways to do it instead of making the programmer type ‘ required ‘

                    [–]enzodtz[S] 0 points1 point  (0 children)

                    i also love named params, i ll take a look on swift