Should elegance be the paramount standard with regard to coding?

no. people fuss over this shit all the time and the answer is pretty clear:

just like if you design a plane so elegantly and completely such that it operates much better than any plane in existence now, but costs a billion dollars to manufacture, the result is the same as if you hadn’t designed it at all: nobody gets off the ground

you should always strive to write the “best” code according to all criteria (readable, short, elegant, intuitive, performant, secure, portable, etc) and you can only begin to correctly favor one of these disciplines over the other once you have a very clear idea of what kind of software you’re writing

for example

if i’m writing code intended to execute in user space, in a language that uses a runtime which provides the same interface across all platforms (python or go or something), i would favor writing short, legible code above all else. clever “elegant” tricks that squeeze out a few drops of performance in return for destroying any chance that someone else could read my code and know wtf is going on is stupid. i’m also writing babby code with fisher-price tools so its not like my code was going to be super performant to begin with

if i’m writing kernel code, i still need to keep my code legible but performance obviously becomes an issue, since a small gain/optimization in performance could affect every program running in user space, instead of it just affecting one single program as in the previous case. you can get fancy & showboat here, because people reading kernel code are usually more capable than people reading user space code

if i’m writing crypto code* everything goes out the window except for security and performance. crypto code is wildly unreadable because of the billion and a half unintuitive things that need to go on to prevent shit like timing or side-channel attacks from breaking your cryptography

if you are, in fact, not writing software at all but designing hardware, you favor, uhhh, “clever” solutions to problems. clever is not the same thing as elegant. this is the most complicated thing to do, comparatively, so the process is a lot different and hard to explain especially for a moron like me. clever solutions are ones that make you laugh when you realize how they work