←back to thread

428 points ahamez | 2 comments | | HN request time: 0.514s | source
Show context
pixl97 ◴[] No.45008158[source]
While the author doesn't seem to like version based APIs very much, I always recommend baking them in from the very start of your application.

You cannot predict the future and chances are there will be some breaking change forced upon you by someone or something out of your control.

replies(7): >>45008436 #>>45008763 #>>45009169 #>>45009423 #>>45009623 #>>45010511 #>>45010673 #
1. gitremote ◴[] No.45009423[source]
I don't think the author meant they don't include /v1 in the endpoint in the beginning. The point is that you should do everything to avoid having a /v2, because you would have to maintain two versions for every bug fix, which means making the same code change in two places or having extra conditional logic multiplied against any existing or new conditional logic. The code bases that support multiple versions look like spaghetti code, and it usually means that /v1 was not designed with future compatibility in mind.
replies(1): >>45026641 #
2. account42 ◴[] No.45026641[source]
If you really care about maintaining v1 long-term you'd re-implement it as a small shim above v2.