5 ms·
After years of working in Typescript I've been doing a Dart project for the last 6 months or so. Overall it's a great language but one of the clunky aspects is
by cageface 3y ago
After years of working in Typescript I've been doing a Dart project for the last 6 months or so. Overall it's a great language but one of the clunky aspects is the use of code generation for so many things. If this can reduce or even eliminate that it will be a big step forward for devX.
- paulddraper 3y agoThat's a Google-ism for sure. (Go, Dart/Flutter, Angular, Bazel)
- capital_guy 3y agoWhat kind of idiomatic code generation is there in Go?
- mdasen 3y agoI'm curious what aspect of the code generation you find clunky. When I used Dart, my issue with the code generation was that it didn't "just happen". With C#, anything that's being generated just happens without any involvement from me and it happens basically instantly. With Dart, I was left running their build_runner manually. Plus common things like json_serializable then require you to add methods to wire up the generated methods (partly because you can't have a factory constructors outside of the class definition, but I don't know why they don't just wire up toJson() as an extension method). I guess I'm trying to figure out if you just dislike having generated files (where you can see the code) or if you dislike how Dart does it (where it's a bit of a clunky process).
- cageface 3y agoIt works well enough. It's a bit of a hassle to set up and you have to always run the file watcher and add the `part "blah.g.dart"` imports. I wouldn't say it's held me back but I'd be happier if the language itself was flexible enough to eliminate the need for this. I'd also be defining my own macros if it was easier to do.
- Alifatisk 3y ago> one of the clunky aspects is the use of code generation Yeah, I’ve been trying to stay away from it but it feels inevitable! I do not want to deal with code generation.
- cageface 3y agoIt's not a big deal in practice but it would be nice if it wasn't necessary.