7 ms·
> using an interchange format like protobufs allows for automatic client generation in several languages Maybe things have improved, and maybe I was using the
by sho 4y ago
> using an interchange format like protobufs allows for automatic client generation in several languages
Maybe things have improved, and maybe I was using the "wrong" languages, but when we tried this at a previous company the generated code was deemed so awful that we abandoned that idea almost on day 1. To this day I tend to believe the promise of "write once, generate anywhere!" to be mostly BS.
Not even picking on protobuf specifically here - last time I tried a REST generative approach (swagger?) the results were similarly unusable. The whole concept is a fantasy, unless things have staggeringly improved.
- davewritescode 4y agoI've had really good luck with gRPC + protobufs for generating solid client side code. Swagger + REST never seemed to deliver what it promised but then again, neither did SOAP + WSDL.
- sho 4y agoMind sharing what the client side languages were? Admittedly what I was using at the time was ruby, hardly a priority for the google team I imagine.
- J_tt 4y agoWe’re actually finding good success with GraphQL codegen, specifically for a Go backend and Apollo + TypeScript frontend. Out of all the options for generating typesafe interfaces this seems the most flexible and generates usable code.
- closeparen 4y agoWhat do you mean “awful”? You’re not meant to read it. We don’t even materialize it into our repos - the build system generates it at compile time. When you go-to-definition in there it’s a little weird, but it works.