Good Language Design

It says something about ProgrammingVsDesigning that while all programmers know at least one language, only a handful are ever capable of expressing what's good or bad in a language in a coherent fashion. Like all users everywhere, programmers use languages and are utterly incapable of designing one.

Programmers never even refer to the design of a language except in throwaway references like "good languages are designed by an individual with a vision while bad ones are created by committee", or handwaving like BondageAndDisciplineLanguage.

Some programmers have actually said that C++ is "better" because you can use a mix of "styles" and "choose" which paradigm you're going to use in different parts of your software. What this means is that C++ is badly designed since it contains the concepts of multiple different paradigms, and that anyone working in it will use it to produce badly-designed applications that are written using incoherent sets of concepts.

C++ can't even be said to be badly designed since it never has been. It's an evolved language, the product of random mutation of features and popular selection pressure. Which explains why its "design" is utter crap.

Why choose to use well-designed languages? For the same reason that users everywhere choose to use well-designed products, assuming they have a free choice and haven't already developed StockholmSyndrome? to a badly designed version.

What makes a good language design is not just minimizing the total number of concepts that occur in the language, nor even the unnatural concepts. A good language design is one that minimizes the total number of concepts in the language-user system. And that's important because assembler, on its own, has relatively few concepts.

For instance, goto is a simpler concept than the numerous concepts that replace it in a high level language (function call, return, hard return, exception). However, a programmer writing in assembly has to write more, in a much more disciplined manner, and has to develop higher-level concepts of the appropriate use of goto anyways.

A good language design is one that internally has the smallest number of concepts and externally supports the highest level concepts the programmer could use when writing in that language. Assembler can be well-designed so long as nobody expects programmers to use it for anything beyond simple functions. There is no usage pattern that makes C++ a well-designed language.

The number of concepts in Smalltalk is very small, and the few things that weren't built on those base concepts are broken or simply absent. The good thing is that the base concepts cover a large area, excluding notably namespaces / packages, security and HCI (MVC is crap). A direct consequence of this is that the number of vicious features in the base Smalltalk is small enough to be counted on one's fingers. Those which users will actually encounter can be counted with one hand.

How and why is a multiple-paradigm language inherently "worse" than a single-paradigm language? Although there might be a correlation, I must say that well-designed applications can be made in poorly-designed languages (and vice versa, of course). Isn't it up to the developers to make coherent use of language features?

And why is it that so many "pure" single-paradigm languages (like, all the functional languages) end up with a reputation as ToyLanguage? Of course, you bunch won't see these languages as ToyLanguage, but I'm talking about the "unenlightened" masses who know that "games are made in C++ because it's the fastest language".

Albeit questions more of MarketingOfLanguages? than LanguageDesign, I'd like you not to just rant on "impure" designs, but to prove why purity is a criterion and/or point out the specific faults with such designs. I'd also like to point to OccamsRazor (interpreted as a warning of oversimplification) - when is it warranted to start sacrificing purity for usable features? (as CeePlusPluss incremental evolution seems to have done from the start)

Oh my, it's a rant. -- SimonBrenner



In what follows the original author, probably RK, has got confused about some of those who are "discussing" this with him. To help clarify I've appended my initials to every line that is mine. Sorry for the clutter, no doubt this will be tidied sometime.


How and why is a multiple-paradigm language inherently "worse" than a single-paradigm language?

How and why is a screwhammer worse than a screwdriver and a hammer? If you don't understand such a fundamental axiom of design, you'll never be able to understand it. Yes, I COULD explain the blatantly obvious, but that would be a waste of time because you still wouldn't believe it.

Isn't it up to the developers to make coherent use of language features?

Obviously not. There's no such thing as "coherent" features anyways. There's coherent designs and features which belong to solely one coherent design versus others that belong to another incompatible but internally coherent design. For programmers to be able to know which features are "coherent" with each other, they would have to have an appreciation for design. And we already know from the existence of C++ that they do not.

And why is it that so many "pure" single-paradigm languages (like, all the functional languages) end up with a reputation as ToyLanguage?

I honestly couldn't care less. My job isn't to explain the mistakes of the past, it's to kick ass and roll heads.

Albeit questions more of MarketingOfLanguages? than LanguageDesign, I'd like you not to just rant on "impure" designs, but to prove why purity is a criterion and/or point out the specific faults with such designs.

If you're really serious about it then well-designed anything are:

What that means is that a well-designed language will be more quickly learned, more comprehensively understood, will cause fewer programmer errors, will have fewer language errors and will be easier to extend in future.

I'd also like to point to OccamsRazor (interpreted as a warning of oversimplification) - when is it warranted to start sacrificing purity for usable features?

The entire set of magic features (deviations from a pure design) must be small enough to be comprehensively explained in a single hour. If you've gone past this limit, then it's time for a redesign.


I'd like to point to quote by Albert Einstein -- "Make everything as simple as possible, but not simpler.".

How do you know that single paradigm language is NOT too simple (simpler)? If having purely functional language means user must go through hoop to describe object or state change then may be it's too simple, isn't it?

Having single paradigm may be too simple, may be a good language shoud have two or may be three paradigm and that would be considered simple language. -- AnonymousDonor


How does this train of thought apply to human languages?

With one or two exceptions, they're all evolved languages, so it doesn't apply.


EditHint Meta discussion: do we need a category for "language design"? We have a syntax category, but language design is about more than just syntax.


See also FormFollowsFunction, LanguagesFromDesignersPerspective, NonOrthogonalLanguageFeatures

JuneZeroFive


EditText of this page (last edited November 13, 2013) or FindPage with title or text search