5 ms·
I'm not sure I fully agree it'll match the conciseness of Python. Go will be more verbose, for sure. If you start having to Marshal/Unmarshal JSON, it'll get p
by TheSwordsman 11y ago
I'm not sure I fully agree it'll match the conciseness of Python. Go will be more verbose, for sure.
If you start having to Marshal/Unmarshal JSON, it'll get pretty annoying pretty quick depending on the JSON format.
- nkozyra 11y agoGo's JSON marshaling can be heavy if you tie it to a strict struct versus, say, an interface. You can make it light, but yes, sometimes some reflection is necessary to utilize that data. For most web applications, JSON in or out is of a known schema, so this generally impacts other servers moreso than web applications.
- TheSwordsman 11y agoOh absolutely. I guess I was trying to call out that, depending on the API you are supporting, it can get hairy. If you are designing it from scratch, when starting the Go project, you can structure your JSON in a way that's easy to work with. If you're coming in to something that was easy to use in a language like Python, it may not be that easy in Go.
- nkozyra 11y agoI guess my point is it will be more concise than Java, certainly closer to Python.
- stephenboyd 11y agoAnd if you have to marshal/unmarshal XML, it gets worse. Go's XML library is buggy and its documentation recommends using JSON instead.