Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Codable #36

Open
s4cha opened this issue Sep 28, 2017 · 4 comments
Open

Codable #36

s4cha opened this issue Sep 28, 2017 · 4 comments

Comments

@s4cha
Copy link
Member

s4cha commented Sep 28, 2017

TODO

Look for all differences with codable and list them.

Codable

  • 1 parsing fails all fails
  • Fine grained error handling
  • Need 1 custom parsing need to write all encodable method
  • Default parsing matching existing keys
  • No type inference (apart from dates)
  • Yields a new object
  • Quite verbose

Arrow

  • Best effort parsing, ignoring fails
  • No error handling (seldom used when getting data from a webservice)
  • No default parsing
  • Type inference out of the box (sy string identifier to an int for example)
  • Can parse and fill an existing object
  • Custom date parsing on a case per case basis
  • Very concise syntax

Having compared Arrow with Codable in a big iOS App, I still believe there's an advantage using Arrow.

@maxkonovalov I would love to know your feelings on Codable vs Arrow :)

@maxkonovalov
Copy link
Member

Hey @s4cha!
Arrow has a big advantage when your project is based on the Arrow+then+ws combo :)
I haven't given a try to Codable yet, but definitely will do.
The best way to compare the two would be seeing side-by-side code listings from some real project.

@s4cha
Copy link
Member Author

s4cha commented Sep 28, 2017

@maxkonovalov agreed! I've started trying Codable out but as much as I want to use the native solution I still prefer Arrow somehow. I must not be very objective though :)
Your answer brings me to something cool that we can do, support Codable on ws!
At first sight it would kinda look like duplicating whatever we have for ArrowParsable with Codable.
I guess it would make ws more attractive for users, since they would not have to use Arrow if they don't want to :)

@n13
Copy link

n13 commented Jun 26, 2019

@s4cha I believe if ws supported Codable, then it could be very powerful

I have not used Codable but at first look it seems like it is both wonderful when it works, and horrible when it doesn't.

I do a lot of debugging networking calls (real life = bad documentation) and Arrow looks a lot better than Codable for that.

@s4cha
Copy link
Member Author

s4cha commented Sep 24, 2024

@n13 This is a very late answer, but this has been done in Networking the ws successor :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants