Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

go development surely affects your taste a lot. This is to me one of the greatest benefit of this language : realizing how much better your code becomes when you spend 90% of your time thinking about the problem and 10% on which language feature you're going to use.


Conversely, for me, trying to write anything in Go is an exercise in frustration: "this could have been so much easier if I could only use X".

The sheer amount of code generators for Go is also a huge red flag.


I just wish go had better json support.

I love the language, but I always end up going back to nodejs for API development because of how ridiculously easy it is to implement json based http APIs.


I'm curious, what is wrong with json support in Go?


I intensely dislike the need to define a rigid type to serialize / deserialize.

And go's libraries and syntax for dealing with dynamic json are pretty painful.


>I intensely dislike the need to define a rigid type to serialize / deserialize.

You can deserialize to a map, without having to define rigid types upfront. But for me, it's more painful to use, because instead of writing something simple like "person.Address.City" with "rigid types", I have to retrieve values by key and cast them to target types.

But pretty much all JSON I have dealt with had an implicit schema, so I see no problem with defining a schema using Go's type system. For me, it's a plus, and defining a type takes, like, 30 seconds? There's also the handy json.RawMessage which you can use to skip certain parts, or defer parsing to a later time.

>And go's libraries and syntax for dealing with dynamic json are pretty painful.

I don't remember having to deal with "dynamic JSON" in an API, can you give an example?


The problem with the typed interfaces are the many cases where the JSON isn't strongly structured, so you end up jumping through all sorts of hoops to make it work, or using a sub-par API like you mentioned, and casting everywhere.

Maybe it's just unavoidable with strong typing, I've had pleasant experiences with C# dynamics with JSON data, but nothing is as easy to me as "let thing = JSON.parse(stringstuff)" and then being able to just do "thing.?someprop" for consumption.

Sure, it only takes 30 secs to add a new type, but the issue is that it has cascading effects. Then build and deploy, etc... whereas with Node, I can just do runtime checks and fail softly.

Sorry, I don't mean to resurrect the old strong vs dynamic typing debate, they each have their use - but for REST APIs specifically I find JSON + dynamic types to be a lot more effective.


Java strikes a sweet spot here.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: