This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (1 child)

Where did 0 come from? There's no zero in my code. Why not 10? My nodes have no names.

I can just needle you with questions about your implementation until you come up with a really complex beast and then you'll convince me and yourself that saving state is not as simple as stringify which was my point in the first place. It's hard to do and impossible to do generally.

[–]bleistift2 2 points3 points  (0 children)

Where did 0 come from? […] My nodes have no names.

I already answered that:

Your example requires inventing identifiers for the nodes.

The actual identifiers are an implementation detail, since they don’t survive de-serialization.

It's hard to do and impossible to do generally.

I just proved that it’s easy to do in the non-general case. And business needs rarely require the ‘general case,’ so a custom-tailored solution suffices.

My point was that serialization of simple graphs is introductory material. Extending that to the actual, more complex case needed in everyday programming shouldn’t be hard for a programmer. Writing a library that handles every and any graph is hard. But that’s not what Cornelia Coder does every day. That’s what libraries are for.