GFlisch / Arc4u.Guidance.Doc

Other
5 stars 1 forks source link

Having to maintain unused code & dependencies - generated by Guidance (YAGNI) #108

Open janschmidmaier50 opened 1 year ago

janschmidmaier50 commented 1 year ago

We should only use / implement things that we really need. For example, we should not have DAPR or GRPC in the project, if we are not going to use and therefore need it.

Concerns

  1. If there is code that is not being needed (YAGNI), the developers will not be aware of that code.
  2. If there is code that is not being needed (YAGNI), the developers might not understand / be interested what the code does.

But the most important concern is security and dependencies. We will have libraries within our project, which are not needed. So what's wrong about this? Well this will need more resources like filestorage, RAM etc. Although this is probably just peanuts, a lot of those topics might be a topic (just think of cloud providers getting payed for that). There might also be side effects using a library not being used. Maybe there is a logmessage when a not needed library is loaded or something else - the project team will not be aware of that. Or even worse, maybe the not needed library is registering services and suddenly there is logic running, that the team is not aware of.

At last but not least: Imagine a not needed library has a vulnerability. Now the project team has to update the library and deploy this update. This will take time, resources and organization, although there would no reason at all, if we would have used only what we need.

For example: My current project does not need

There might be other components as well, like Hangfire.

To sum it up: The dev should be able to choose what is needed, when creating things (projects, services etc.) to reduce complexity and dependencies, but also to minimize risks (security, misunderstandies, side-effects etc) of unused code and libraries.

Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away. Antoine de Saint-Exupery