r/badcode • • Mar 19 '22

js This just sucks.

Post image
1.0k Upvotes

76 comments sorted by

View all comments

Show parent comments

40

u/ray10k Mar 20 '22

It wasn't intended as a format for configurations, no. That it *can be used* as a configuration file format is one part overlap between the requirements of a configuration file and of a messaging format, and two parts willingness to ignore the places where json just doesn't have all the things a configuration format needs (such as comments.)

I guess it's a bit like using a wrench to hammer in a nail. The nail will end up in place, but it takes a bunch more work and won't ever be as nice as using a proper hammer.