DEV Community

Arpit Mohan
Arpit Mohan

Posted on • Originally published at

API versioning; how SLOs help teams; & tidying up your code

TL;DR style notes from articles I read today.

Introduction to API versioning best practices

  • Most companies modify path parameters when approaching API versioning. 
  • Google prefers a numbered versioning. Twilio uses a timestamp in the URL. Salesforce opts for vXX.X in the middle of the URL. Facebook goes for prepending the version to the endpoint path. Badoo opts for continuous versioning where features are added and endpoints stay the same. 
  • Header exchanges are a common alternative to path parameters. 
  • Another option is to keep a single unchanging URI with just one set of criteria for consumption. 
  • All new API versions should be backward compatible. There should be rich documentation for new versions to enable successful transition too.

Full post here, 7 mins read

SLOs are the API for your engineering team

  • SLOs (service level objectives) help you invest in your team's ability better to meet the agreed-upon goals.
  • SLOs help you push back when demands exceed your capacity to deliver.
  • SLOs ensure consistent & predictable delivery. 
  • SLOs enable better decisions based on real data without wasting time on debating.

Full post here, 9 mins read

Does this code spark joy? Tidying up your code bit by bit

  • Messy code can result in bugs, prolonged development time, or increased difficulty with onboarding new engineers.
  • Tidying means making purely structural changes to a confusing and messy section of code.
  • Use helper methods and differentiate between sections of code that are accomplishing different tasks.   
  • Ensure your tests pass at all times when making changes.

“Divide your program into methods that perform one identifiable task. Keep all of the operations in a method at the same level of abstraction.” - Kent Beck

Full post here, 5 mins read

Get these notes directly to your inbox every weekday by signing up for my newsletter, in.snippets(), here.

Top comments (1)

jlrxt profile image
Jose Luis Ramos T.

Me alegra leer algo diferente / lectura útil para los que empezamos en el desarrollo. Saludos.