You are gonna have to maintain that code
Complexity can't be avoided. But we should strive to minimize it.
One thing that's fascinating about software is how easy it is to change or add to it. I'm not referring to the principle of "easy to change" but rather code in itself. Code is super easy to change.
Think of other fields where you don't have the "soft" part e.g. construction. It's not just hard to change something that's done but also while you’re doing it. Which is why it requires the waterfall approach where you plan everything out from beginning to end before you start.
I think because software is so easy to change we sometimes underestimate the complexity that builds up over time.
When you think of yourself as a product engineer, a question you should always ask yourself: "What's the simplest thing that could work? If I removed any requirements or loosened any constraints, how much of a simpler solution could I come up with?"
If you realize by removing 20% of the requirements, the problem becomes 60% simpler, you should probably do that.
This isn't always the case of course! But it's good to keep in mind. Every time you're presented with a problem, focus on understanding the problem. Don't always think about solving the problem but rather thinking from a "simplicity-first" perspective.
Even if you're far away from solving the full problem, it's ok. At least thinking "What can I do here to improve the situation (towards solving the full problem) with little complexity as possible?" is a good habit to have.
At least you can compare the "optimal" solution with alternatives. Then evaluate customer value delivered vs complexity added.