Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
skybrian
· 3y ago · 0 comments
Could you use the Java implementation of protocol buffers from Kotlin?
Comments
[–]
joe_fishfish
3y ago
You absolutely can. You can also use Square’s excellent Wire library.
[–]
MarkMarine
3y ago
You can but you’re going to have ? EVERYWHERE, which does drive the search for a native implementation that doesn’t make you deal with null everywhere
[–]
billjings
3y ago
Is there another way you're supposed to represent optionals in Kotlin?
[–]
MarkMarine
3y ago
No, but it makes the code a mess because you’re handling optionals for every protobuf field deref. So you’ve got error handling all over the place. It looks like go’s error handling.