Hacker News new | ask | show | jobs
by beaumartinez 5453 days ago
> Elegant code is written by good programmers—not the language.

But some languages make writing elegant code easier than others (compare C to Python, for example).

1 comments

For some task-specific definition of elegance. For me, elegance is not just about how terse the syntax is, but how well it solves the problem at hand and responds to changes around it. For me, some problems require a performant solution as well, and the elegant option is the one that does this without requiring a bunch of rewriting or adding hard to discover dependencies.

I can write some terse AND elegant list comprehension code in Python that takes lines and lines of crappy looping in Java, but I can also write some seriously terse code to centralize business logic via a web service with automatic transaction and security management and have it perform an order of magnitude faster than a similar implementation in Ruby or Python (JEE 6). To me, that is elegant.

Likewise, I can do some elegantly maintainable things with .NET generics that I can't do with Java's lame erasure based implementation.

Of course, you could always just takes Einstein's opinion :) "If you are out to describe the truth, leave elegance to the tailor."