10 ms·
The moto of Dart is to make the life easier for developers. I think that moto doesn't fit Dart at all, I use Dart and I have to make some workarounds that I ju
by adrianlmm 12y ago
The moto of Dart is to make the life easier for developers.
I think that moto doesn't fit Dart at all, I use Dart and I have to make some workarounds that I just shouldn't be doing, but I have to because the language doesn't have the functionality that other languajes already have. The problem I see is that the Dart language developers never put them self in the shoes of the developer using their languaje.
In this case, I would be easy for them to add JSON serialization to objects, you know, but they didn't, why? polictics, apathy, whatever, but not technical problems.
So, my self, had to adapt to programming in Dart, so I every class must have a toJSON and fromJSON methods where I manually put the values to a map and then I use convert.JSON. But, I now I gave up using classes and now I just use Maps, just to write less code and is already the type Dart suppor for JSON serialization.
- dragonwriter 12y ago> The moto of Dart is to make the life easier for developers. The word your looking for is "motto". > I think that moto doesn't fit Dart at all, I use Dart and I have to make some workarounds that I just shouldn't be doing, but I have to because the language doesn't have the functionality that other languajes already have. Newer languages that are comparatively young are usually going to have a less complete ecosystem and its a tradeoff between this and the unique features/approach they offer initially as the ecosystem matures. > In this case, I would be easy for them to add JSON serialization to objects, you know, but they didn't, why? Perhaps because they would have had to not do something else to get Dart released on the same timeline to do it. Lots of things are easy considered in isolation, but there are always opportunity costs, especially if you try to do every easy thing before you release anything.
- adrianlmm 12y agoAre you part of the Dart team?
- dragonwriter 12y agoNo.
- adrianlmm 12y agoThen I get the impression you are defending Dart just by inertia and not because you understand the problem, it is very common to see that in fanboys.
- dragonwriter 12y ago> Then I get the impression you are defending Dart just by inertia and not because you understand the problem I understand the complaint being made. And I explicitly note that there is a real trade-off. OTOH, I also recognize that there are real reasons why new languages don't spring into existence with complete language-native ecosystems on par with the most mature ecosystems in existence. > it is very common to see that in fanboys. I'm hardly a Dart fanboy. I think its a nice language that I'd rather work with than, say, JavaScript, and I like that someone is actually interested in challenging the assumption that JavaScript must be the one true language of the web, even if only as the common compilation target. But I don't have a real need for it, and its probably not even in the top 10 languages I'd use right now for a real project (though not having built-in JSON deserialization to user-defined classes isn't among the reasons why. Writing a converter to a custom type from the things it does deserialize JavaScript into isn't particularly challenging.)
- adrianlmm 12y agoThen the fact you don't face the same problem that we do, doesn't mean that the problem doesn't exists.
- DCKing 12y ago> I think that moto doesn't fit Dart at all, I use Dart and I have to make some workarounds that I just shouldn't be doing, but I have to because the language doesn't have the functionality that other languajes already have. Could that be explained because of not used to type safe languages? Type safe languages have a well-known clunkiness to dynamic type creation as well as other things. You get correctness in return, which is often worth it. It is also precisely the point of Dart's type system. > In this case, I would be easy for them to add JSON serialization to objects, you know, but they didn't, why? polictics, apathy, whatever, but not technical problems. This assertion is simply false. Adding arbitrary object creation support to a mostly statically typed language is not trivial at all [1]. What's more is that adding it will only give the guise of type safety when it's really not there. [1]: See Jackson's source code, a popular Java (de)serialization library: https://github.com/FasterXML/jackson-core https://github.com/FasterXML/jackson-core
- adrianlmm 12y ago>Could that be explained because of not used to type safe languages? Is not about type safe, Dart can be used as both, a type safe lenguage and as a dynamic lenguage, demanding to cover a certain part of of what a type safe language has it is reasonable, now, if the package was to big for Dart designers they should have made Dart a dynamic language only. > This assertion is simply false. Is not that false, anyone can do a JSON to bject parser, the problem I see is that they would need to include mirrors as default to give such functonality, but when exported to JavaScript mirrors would make the exported file to be huge, so I see this as a way to mitigate the desing problems Dart it self has. As I said, they need to put first in the user shoes and see what is convenient to them and then work in the desing, but I get the impression that they desingned Dart to be fast, it doesn't matter if some desitions affect the developers, the priority is make it fast and not handy for developers.
- DCKing 12y ago> Is not about type safe, Dart can be used as both, a type safe lenguage and as a dynamic lenguage, demanding to cover a certain part of of what a type safe language has it is reasonable, now, if the package was to big for Dart designers they should have made Dart a dynamic language only. If the goal is not to make it type safe, then there is really no objection to just use the built-in Map+List JSON parser, is there? > I see this as a way to mitigate the desing problems Dart it self has. How could a language a language possess both classes and not spend a lot of complexity trying to shoehorn JSON objects to fill the data in those classes? This is not a problem of Dart, this is a problem of class-based object orientation. It baffles me that people expect it to arbitrarily map JSON to those classes when the associated complexity is well-known.