0

I need to decide, which approach to use in our project. I personally stick to the "Spec first" approach (or "Design first" approach). It means, that we first design an API specification, then approve it all together, then code the backend.

But I know, that half of developers prefer the "Code first" approach, when you first code the backend, and then generate API docs automatically.

I have tried both of the approaches, and I prefer the first one. But maybe I miss something important? Or maybe I do not know how to cook the second approach properly?

  • first of all, this is a request for opinion, so it likely will be closed. Second, design doc != api docs. The latter can (and should, in my opinion) be auto-generated. But you can't automate the design phase. – Sergio Tulentsev Mar 01 '23 at 17:38
  • Additionally, are you the person making the decision? You can just decide. If you're not in a position to enforce your opinion, why ask this question? :) – Sergio Tulentsev Mar 01 '23 at 17:44
  • Sometimes your choice has technical limitations. For instance, if you use Microprofile GraphQL, which uses a "code first" approach, sure you can write specification and after that code manually, but you will have consistency problems. But if you do not have technical limitations and you have good tools to generate code by specification then API first is the better approach (in my opinion) because you will have better quality specification and implementation agnostic specification that you can implement on different programming languages. – nik0x1 Mar 14 '23 at 23:46

0 Answers0