For most apps I've built which deal with CRUD operations, I end up two very similar UI pages: one for the creation of the object, one for updating it.
An example would be StackExchange's UI for creating a question and the UI for editing a question (but very similar, but slightly different).
How can we minimize duplication of UI code in this situation?
(I mostly program for the web with React but I am also interested in generic advice.)
Clarification: I have used strategies to minimize code duplication in the backend/db layer (e. g. using ORMs, UPSERT statements) which let me share the data plumbing code between add and update operations.
However, in most projects I've worked on, the frontend code for add and update screens was duplicated.