Hacker News new | past | comments | ask | show | jobs | submit login

The problem with magic serializers is that they tend to be brittle in practice. This is because the assumptions they make don't work across languages.

For example, if you use a magic serializer, your properties might have to follow a different capitalization format than what's normal for your language.

Recently, I ported some Java code to C#. It was written with a magic JSON serializer. When I got to test my port, nothing worked! It turns out that Java's serializer used lowercase names in JSON, but my serializer used uppercase names! The magic, unfortunately, didn't work, because assumptions that were valid in Java did not carry over to C#.

I think it's best to think of magic serializers as rapid prototyping tools that work well when both ends are the same languages. Thus, while might be useful for Dart to include one very simple quick-and-dirty serializer to JSON, any production code of merit will most likely outgrow it.




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: