this post was submitted on 06 Feb 2025
1031 points (100.0% liked)

Programmer Humor

27977 readers
1152 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] bleistift2@sopuli.xyz 21 points 10 months ago (1 children)
location /old_api {
  redirect /new_api
}

(can’t be bothered to check the syntax).

[–] CosmicTurtle0@lemmy.dbzer0.com 18 points 10 months ago (2 children)

If you have a major version change, it means that old API calls will break against the new API, assuming they are accurately following semver.

[–] bleistift2@sopuli.xyz 16 points 10 months ago

You’re absolutely right. In my mind “feature parity” got garbled into “backwards compatibility”.

[–] Longpork3@lemmy.nz 1 points 10 months ago (1 children)

A translation layer could be used, no? Check api version, translate any v1 specific calls into their v2 counterparts, then submit the v2 request?

[–] CosmicTurtle0@lemmy.dbzer0.com 2 points 10 months ago (1 children)

This isn't really efficient because when v2 gets updated now you have to update the translation layer as well.

Any improvements you made in v2 would likely not translate.

Essentially the best way is to provide users with an incentive to switch. Perhaps a new feature or more requests.

[–] Pieisawesome@lemmy.dbzer0.com 1 points 10 months ago

Publish v3, then add a translation layer for v2 to v3