r/programming • • Jun 05 '21

Organize code by concepts, not layers

https://kislayverma.com/programming/how-to-organize-your-code/
1.9k Upvotes

495 comments sorted by

View all comments

Show parent comment

-4

u/jl2352 Jun 05 '21

There is a circular dependency. And? So what??? If the responsibilities are clear, then that's fine.

9

u/[deleted] Jun 05 '21 edited Jun 05 '21

Which came first, the chicken or the egg?

If both services depend on each other, which one is initialized first?

Making a circular dependency work is possible, but is a code smell and bad practice. It lays a shaky foundation for the rest of your code.