7 ms·
And this is a good thing. I would love to see something like a proper C# instead of a hacky TypeScript. It would be so much more productive. JavaScript is a co
by garganzol 3y ago
And this is a good thing. I would love to see something like a proper C# instead of a hacky TypeScript. It would be so much more productive.
JavaScript is a cool dynamically-typed language though. C# is on another side of the spectrum: it is super cool by being fully strongly-typed. But TypeScript is something in the middle and this uncertainty gives pains.
- oaiey 3y agoBut that is the niche of TypeScript. It supports a dynamic typed language by enabling some but not all benefits of typed languages.
- chris37879 3y agoI find that Dart rides that middle line much nicer than typescript does, at least for now. As of Dart 3, you can now have sound null safety, and sound type safety for 100% of your code, if you want. The recent addition of records also makes working with some of javascripts methods with multiple return types better, as that is one of the things dart is still missing, union types. Though, I tend to prefer dart over typescript just because of not having to deal with the node ecosystem at all.
- deleted 3y ago[deleted]
- m_0x 3y agoToo bad Dart is only used in Flutter.
- chris37879 3y agoThat’s your choice, I suppose. I use it for everything from flutter to CLI to Cloud Functions to WebUi to daemons in tiny containers.
- garganzol 3y agoAny way to use Dart with React in a .jsx way? It looks like Dart has exclusive support for Flutter, and that's it.
- deleted 3y ago[deleted]
- revskill 3y agoMan, the context of question, is how to use Dart in a Typescript/React application (because of popularity of ReactJS ecosystem, of course).
- m_0x 3y ago> That’s your choice, I suppose. Not really. For personal projects or if you're a freelancer sure. Once you work in a company/startup you can't go and implement things in whatever you like. It's way easier to convince any manager that Dart/Flutter is a good choice for a mobile app because of the tech advantages than in anything else because of the pool of available developers.
- latchkey 3y agoDo you use Dart for anything other than Flutter though? I'm a huge fan of Dart, but I don't see it getting much server usage. Like, could I deploy a Dart CloudFlare worker?
- chris37879 3y agoyes, cloud flare even has a guide on their docs if you go to the Workers > Platform > Languages section. Also, dart 3 is previewing wasm support, and could be used through a wasm worker.
- bioemerl 3y agoHonestly typescript is fine, just give me: Standard library that isn't worthless - no more npm package spam. Type knowledge in the runtime. It doesn't have to be typed, just make it so I don't have to do crazy checks on properties before casting to a class. Imports without webpack.
- crgwbr 3y agoGive io-ts a try for the runtime type checking. We’ve used it in prod for a few years now and it’s pretty solid.
- amitport 3y ago> "just make it so I don't have to do crazy checks on properties before casting to a class." You do have 'instanceof' at runtime, so unless you mean some other type of 'class', casting to a class is really a non-issue (and you don't really 'cast'... since dynamic typing and all). If you mean some more advanced concept (e.g., structural type runtime checking), think how you would do it in statically typed languages (is it really better?).
- bioemerl 3y agoInstance of doesn't work sometimes and you have to write explicit property checks. I forget the details because I'm by no means a typescript expert, but I remember being very frustrated by the fact I couldn't just use instance of.