An elegant solution is small, simple, clear. Elegant solutions tend to not bite you back whenever some small detail of the environment around it changes, and tend to outline patterns that can be reused.
Or they even are a reuse themselves: noticing a pattern and applying a classic solution from the literature ("hey, this calls for a priority queue") or a library ("let's not reinvent XML parsing!") often ends up in more elegant code than ad hoc solutions.
A clever solution is often also small but usually not simple: they may require exploiting some accidental but not essential property of the system, they may involve solving an architectural problem by peeking through an abstraction, etc.
That's why the words "clever hack" often go together. They are often very context sensitive and end up being fragile. Lua's "NaN trick" is a great example: it was a smart way to pack values that worked great... until computers went 64-bit.
Reading elegant code makes you think "this solves the problem and is very clear to understand". Reading clever code makes you think "oh, the person who wrote this must be very smart!". Hence clever often has a greater "wow factor" than elegant, unfortunately.
That is not to say that clever isn't sometimes needed. E.g. the solution I recently came up with to make LuaJIT support ARM64 stack pointers in lightuserdata is what I'd call clever ("flip bit 46 if bit 47 is set!") but it's definitely not elegant.
OTOH, going full declarative in Kong schemas was an design choice driven by CS fundamentals that proved fruitful: when we introduced declarative config in Kong 1.1, I was able to compose our existing schemas, tack a YAML parser in front (I know) and ta-da! declarative config.
I'm proud of this one: people were impressed at how quickly the feature turned out. I was literally asked if I had spent long nights on it, but I didn't: it materialized quickly because it was a fruit of compositionality.
Sometimes it's hard to justify a design with "trust me, it will make things cleaner later on", especially when it blocks so many "clever" additions ("but we could fix so many special use-cases by adding a Turing-complete escape hatch!") but it pays to resist the temptation.
Server run by the main developers of the project It is not focused on any particular niche interest - everyone is welcome as long as you follow our code of conduct!