If I have a list of products and I need the total price of those products. Where is better to calculate the total sum, back end or front end?

  1. Front end React
  2. Back end PHP
  3. Table that shows Invoices list
  • 1
    Better for what? In which context? Zillions or products or 1-3 item shopping cart? What kind of frontend? – Mat Dec 7 '17 at 8:31
  • I didn't mention that I have a form and user will send this data. It's just a table that shows invoices list. – Anna Adamchuk Dec 7 '17 at 15:08

All business logic must be done on the backend. On some cases you can replicate on front end (for quick feedback to the user) but never as the source of truth.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.