It's easier to understand if you try to classify your code in two categories: business logic and infrastructure logic.
business logic
infrastructure logic
Business logic, as other people commented, is the logic that is defined by the business.
Infrastructure logic is the logic that makes your app work.
Ideally, you want to separate both logics as much as possible.
Some classes should ideally read like "if the customer buys 2 products or more, apply discount. If not, don't apply discount".
Others will read like "if the HTTP response from the remote API is not 201, wait x seconds and retry".
One code defines what your users want the application to do. The other code is needed to make your program work.
Obviously, the line sometimes is a bit blury, but you get the idea.
This is the clearest example for me. Thanks for explaining it like this.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
It's easier to understand if you try to classify your code in two categories:
business logic
andinfrastructure logic
.Business logic, as other people commented, is the logic that is defined by the business.
Infrastructure logic is the logic that makes your app work.
Ideally, you want to separate both logics as much as possible.
Some classes should ideally read like "if the customer buys 2 products or more, apply discount. If not, don't apply discount".
Others will read like "if the HTTP response from the remote API is not 201, wait x seconds and retry".
One code defines what your users want the application to do. The other code is needed to make your program work.
Obviously, the line sometimes is a bit blury, but you get the idea.
This is the clearest example for me. Thanks for explaining it like this.