Hacker Newsnew | past | comments | ask | show | jobs | submit | fsaintjacques's commentslogin

If only go had lambdas, functional interfaces and record classes...


I highly recommend anyone to read Google's [AIP](https://google.aip.dev/). There's even a grpc schema linter for it. Put more focus on the resource data design than nitpicking on transport details. I would consider the best lessons to be:

- Optional but supported user defined identifiers, it's so frustrating to work with API that passes you back an identifier.

- String identifier (names) for resources, with some kind of type namespacing, i.e. the prefix in the author's document - Consistent set of fields (create_time, update_time, annotations, ...)

- Avoid dynamic map (this is a JSON self-inflicted wound)


Second this. Reading this while working at google made me better design. Some that stand out to me are.

Resource Oriented Design: https://google.aip.dev/121

Declarative Friendly APIs: https://google.aip.dev/128

Declarative friendly makes writing scripts, pipelines so much better because of idempotency. It also pairs very naturally with resource Oriented design.

Long Running Operations: https://google.aip.dev/151

LROs are applicable to any request that runs longer than a second or a couple of seconds. Having a unified interface can be very powerful for implementing offline task workers and pipelines.

Filtering: https://google.aip.dev/160

This one is probably controversial as it's makes implementing basic filtering quite a bit harder. I haven't quite seen the issues it's supposed to solve play out in practice but it's interesting nonetheless.


JSON parsing is a minefield, especially in cross-platforms scenarios (language and/or library). You won't encounter those problems on toy project or simple CRUD applications. For example, as soon as you deal with (u)int64 where values are greater than 2^53, a simple round-trip to javascript can wreak silent havoc.

See http://seriot.ch/projects/parsing_json.html

Protobuf support for google's first-class citizen languages is usually very good, i.e. C++, Java, Python and Go. For other languages, it depends on each implementation.


Though you're not wrong, in what common cases are integers larger than 2^53 required?


Timestamps in nanoseconds is one.


That's not common, JS's built in Date doesn't even support nanoseconds.


I guess it depends in which domain you work? In system programming, "clock_gettime" gives you nanoseconds. If you work with GPS timestamps, you have nanoseconds.

Could it be that JS's Date doesn't support nanoseconds because it cannot represent them, which is the issue we are talking about here?

Don't get me wrong, I understand this is not something that everyone uses every day, but to me it's a pretty straightforward example that can happen in a wide range of situations. It certainly happened to me/colleagues several times in several companies.


Nice article


If the application is in go, you can likely embed litestream.


glibc already does dynamic dispatch for the memcpy family of functions.


Optable | Montreal and Remote | Golang, React, Crypto | Full-Time | https://www.optable.co

Optable is building a decentralized data management and connectivity platform designed for online advertising. Our goal is to enable advertisers to leverage publisher's first-party data in a world where third-party cookies and globally shared identifiers will disappear. We operate private instances of our software on behalf of our customers. We use modern, secure multiparty computation and cryptographic techniques to allow matching of data while protecting privacy. We are looking for full-stack engineers who are comfortable working on complex backend features but won't shy away from front-end development. We are also looking for a cryptography engineer to help us build cryptography software and protocols.

Please apply by writing to careers -at- optable.co and mention hackernews.

https://www.optable.co/jobs/software-eng-full-stack-dev https://www.optable.co/jobs/cryptography-engineer


It sure does.


Let me introduce you to the underworld of affiliate marketing https://www.investopedia.com/terms/a/affiliate-fraud.asp

There's always money to be made if you can generate significant legitimate traffic to a given destination.


Not zero copy, requires deserialization.


Because it would be a trivial indicator that you're in incognito mode.


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

Search: