18

As far as I understand, deserialization is turning a stream of bytes into an object.

Parsing is kinda the same, usually turning a string into some data structure.

Is parsing a type of deserialization? Can you consider them synonymous?

daremkd
  • 8,244
  • 6
  • 40
  • 66
  • You can *parse an INI file and set runtime flags* without *deserialising* it into a data structure... It's a pretty minute distinction though. – deceze Mar 30 '16 at 11:06

1 Answers1

18

Parsing is the more general term.

Deserialization is commonly used in the context of object oriented languages. The result of deserialization is an object while the result of parsing can be any type of data.

Even in the context of object creation, parsing is more general. If for example you create an object and only part of the data required by the constructor is parsed from a file while the rest of the data is provided as user input, I wouldn't call it deserialization.

Frank Puffer
  • 8,135
  • 2
  • 20
  • 45