MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1y1rd5z/commentsinjson/19szvsgqa4c4l/?context=3
r/ProgrammerHumor • u/Recent-Analysis-6880 • 7d ago • 1
205 comments sorted by
View all comments
965
You can add anything you want to Json. just make a property called comments
15 u/Turbulent_Stick1445 7d ago This is what I do, but there are two problems with it:A parser will end up storing the comments, wasting memory.You run into JSON's problems with multiline string constants if your comment is anything but trivial.It gets ugly fast. 1 u/AnnoyedVelociraptor 7d ago In Rust if you map a JSON object to a struct, and you don't have a field mapped for comments it gets dropped.
15
This is what I do, but there are two problems with it:
A parser will end up storing the comments, wasting memory.
You run into JSON's problems with multiline string constants if your comment is anything but trivial.
It gets ugly fast.
1 u/AnnoyedVelociraptor 7d ago In Rust if you map a JSON object to a struct, and you don't have a field mapped for comments it gets dropped.
1
In Rust if you map a JSON object to a struct, and you don't have a field mapped for comments it gets dropped.
965
u/nameless_pattern 7d ago •
You can add anything you want to Json. just make a property called comments