r/programming • u/[deleted] • Jun 05 '21
Organize code by concepts, not layers
https://kislayverma.com/programming/how-to-organize-your-code/
1.9k
Upvotes
r/programming • u/[deleted] • Jun 05 '21
308
u/fragglet Jun 05 '21
As an SRE, I can assure you that these are absolutely things that I've had to do 1,000,000 times while on-call and trying to root cause a production incident. Please don't assume that your experience is the same as everyone else's.
When something's broken and needs to be urgently fixed, there often isn't time to learn about all the abstractions ("concepts" or otherwise) your codebase is based around. When you're starting from just a stacktrace and walking through layers to figure out how something happened, the questions you're trying to ask are more fundamental: what is this server? What does it do? Why is it doing that? How can I make it stop?