←back to thread

83 points zardinality | 1 comments | | HN request time: 0.001s | source
Show context
pengaru ◴[] No.42195597[source]
There's a mountain of grpc-centric python code at $dayjob and it's been miserable to live with. Maybe it's less awful in c/c++, or at least confers some decent performance there. In python it's hot garbage.
replies(5): >>42195747 #>>42196231 #>>42196568 #>>42196845 #>>42197041 #
cherryteastain ◴[] No.42196568[source]
C++ generated code from protobuf/grpc is pretty awful in my experience.
replies(1): >>42196915 #
bluGill ◴[] No.42196915[source]
Do you need to look at that generated code though? I haven't used gRPC yet (some poor historical decisions mean I can't use it in my production code so I'm not in a hurry - architecture is rethinking those decisions in hopes that we can start using it so ask me in 5 years what I think). My experience with other generated code is that it is not readable but you never read it so who cares - instead you just trust the interface which is easy enough (or is terrible and not fixable)
replies(1): >>42197608 #
cherryteastain ◴[] No.42197608[source]
I meant the interfaces are horrible. As you said, as long as it has a good interface and good performance, I wouldn't mind.

For example, here's the official tutorial for using the async callback interfaces in gRPC: https://grpc.io/docs/languages/cpp/callback/

It encourages you to write code with practices that are quite universally considered bad in modern C++ due to a very high chance of introducing memory bugs, such as allocating objects with new and expecting them to clean themselves up via delete this;. Idiomatic modern C++ would be using smart pointers, or go a completely different route with co-routines and no heap-allocated objects.

replies(1): >>42197686 #
1. bluGill ◴[] No.42197686[source]
ouch. I'm temped to look up the protocol and build my own grpc implementation from scratch. Generated code isn't that hard to create, but it is something I'd expect to be able to just use someone else's version instead of writing (and supporting) myself.