Writing clever code is likely to cause you a maintenance nightmare later. Here's why...
There's always another bug. It's a fact of life in any discipline that requires writing code. There is nothing wrong with a piece of code getting more complex. Especially as it expands to meet the need, but it's what you start out with that's important.
Debugging is twice as hard as writing the code in the first place. So, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
So let's think about that for a moment. Let's think about in the context of web development.
That's true, frameworks play a big part in how we do web development. We still end up writing code to build our web app/site, though.
It's that code that we are talking about. We have to assume the framework code we are using is bug free. Or, we will debug it by using it - we'll get to that.
The point here is: as you begin to write the code you need, it's easy to be clever. And you can be even more clever when you refine your code further.
This situation is framework agnostic. It's more to do with how individual developers write code. That means the choices you make as you write, are linked to how difficult you code will be to debug.
Unit testing is a big deal. And it does make a lot of sense. Frameworks are unit tested by the creators (usually). Any bugs get reported and squished by people using said framework.
Imagine how hard that would be, if the framework contained masses of clever code.
Writing code that conforms with simplicity is hard when the brief is complex. But that's why we are developers. We develop solutions for difficult problems.
Our code doesn't need to get so clever (complex) that debugging becomes impossible. We have programmatic building blocks to help. Classes, functions etc. make sure our code answers the question.
While I'm here, I'll throw another Kernighan quote into the mix:
Controlling complexity is the essence of computer programming.
Exactly. That's what I'm saying. When we write web code it may not be programming as such, not in the strictest sense. But the principles still apply. Keep it clean, keep it simple, let it evolve.
It might sound old school to talk about debugging. But even if you only ever write code and test in the browser, you'll still be trying to squish bugs. That's debugging. It's when stuff doesn't work as expected.
Writing code cleverly is not efficient. It makes said code harder to work with debugging and maintenance. Aim for elegant simplicity instead. Or at least write code that achieves it's purpose through efficiency, not cleverness.