views:

107

answers:

5

It seems to me that some languages are generally being conceived as more beautiful than others. This seems to apply to all programming paradigms. Are there any abstract/paradigm-spanning characteristics which makes programmers consider a language as beautiful?

Edit: If you think that there is no consensus then please don't hesitate to state your own views

+4  A: 

There aren't any universal rules for beauty. Beauty is in the eye of the beholder - everyone has their own idea of beauty.

Personally I like languages that allow you to write code that is concise but not cryptic. It expresses what I am thinking with no extra cruft or magic arcane syntax.

Mark Byers
+1 My thoughts exactly
delnan
+2  A: 

I think it needs to be somewhat similar to a natural language. Reason: the human brain seems to be wired so learning natural languages is easy. See also Nativism, and specially Chomsky. Those are a bit extreme views, but there is most likely some truth to it.

Thomas Mueller
About nobody considers COBOL or VB or Applescript or Inform beautiful. Quite the contrary, they are usually hated - for understandable reasons.
delnan
It's not about using the actual words, but the concepts. Would you consider SQL, Ruby, Python bad examples as well?
Thomas Mueller
+6  A: 

What I consider beautiful is conceptual minimalism or more precisely an orthogonal set of few general language primitives ...

as opposed to many less powerful features needed to describe almost the same thing, while permanently having to consider special cases.

Haskell for example is basically just some syntax around three primitives with an incredibly small type system (just values, generics, constructors, typeclasses) that covers everything in such a powerful way that maybe no other common language can achieve. The notion of a again value covers everything - data, functions, objects (as a collection of values), ...

Classic VB on the other side has even more than five ways of looping built-in. There is made a difference between values and functions, plain data and objects, ... And the whole almost without any possibility of writing generic code.

Dario
Well, if N features can be unified into one (e.g. functions are first-class values, methods are just functions, everything is an object, etc), that's good. But the "lispy" way aka "give me a few primitives and a macro system, I'll build the rest myself" has risks. Either you end up with bolts, or you spend all your time working around something that wouldn't be there in the first place if you started your own language.
delnan
+3  A: 

There is a general trend in software towards languages and language features that are more declarative. At the moment most languages are all about the how, not about the what. A for loop indicates exactly how you want the code to behave, but it doesn't indicate what you want to happen.

To me a beautiful language is one that allows me to be declarative while not taking away the ability to optimize. The more expressive you can be in code, the better.

Jaco Pretorius
+3  A: 

Here's my list:

  1. Being as concise as possible while still being readable.
  2. Having as few special cases an odd rules that you "just have to know" as possible.
  3. Making the correct, safe way the most obvious, least verbose and most readable way.
  4. Making it easy to solve problems at a very generic level. This partly goes hand-in-hand with (2). If you have to consider special cases everywhere then your "generic" solutions aren't very generic.
  5. Making it possible to create abstractions that are efficient enough to be used everywhere, not just in code that doesn't need to be fast.
  6. Avoiding treating builtin types as "special" as much as possible. If builtin types can do it, then user defined types should be able to do it.
dsimcha