views:

78

answers:

2

I often see people commenting that what they want is a simple language, with a simple specification and not too many excess features, odd rules and multiple ways of doing things. I've never understood this except when the opposite is taken to the extreme. Isn't a more meaningful measure of language complexity the complexity of the code needed to do common programming tasks? For example, if a language has a huge specification, a lot of different abstractions and complexity management tools and tons of features for library writers, it might be regarded as a complicated language. However, if those features are useful and allow code to be written that is terser, more straightforward, more readable, less syntactically noisy and DRYer than other languages, and allows libraries with simpler, more user-friendly APIs to be written, doesn't that count towards the simplicity of the language in a practical sense?

As a concrete example (please treat this only as an example and don't let this question evolve into a flamewar about delegates), let's use delegates. Of course, noone really needs delegates. They can be emulated with more general features like classes/interfaces or function pointers. They also add bloat to the language specification. However, they allow code written in the language to be terser, more straightforward and less syntactically noisy, in other words simpler, than if delegates are Greenspunned using other language features. Shouldn't that count as a net simplicity win?

+1  A: 

Well every language that is "turing complete" can do anything you can do with another turing complete language (allmost all of them are).

Perl has been designed alledgedly to allow short programs to be written, with special purpose variables that implictly get declared. I never got the hang of it.

C# also has a lot of syntactic magic (Linq and all that) but somehow they did a better job. It feels and reads consistent across the board. As for delegates: you don't want to count how many single method interfaces there are in the standard Java libraries. Being able to attach callbacks one method at a time is something that people want to do in the end, and it reduces code complexity by making it a first class concept in the language.

So yes, syntax sugar helps. But it should be carefully designed.

jdv
The thing about Perl is that there's a fine line between providing another choice of abstractions to remove superfluous boilerplate where the existing abstractions don't map well to the task at hand (making code simpler) and ad-hoc, special case hacks to save a little typing here and there (often making code dense and cryptic and therefore more complex).
dsimcha
A: 

Why the votes to close? Yes, this is subjective, but it's a thoughtful question about language design tradeoffs, ...

I read the question as, "Is a more complicated language actually simpler, because it allows simple applications"?

See also DWIM, especially the last line:

"DWIM is often suggested in jest as a desired feature for a complex program; it is also occasionally described as the single instruction the ideal computer would have."

... not a stupid "pissing match" type question.

People are voting to close this as "Not a real question" (not as "Subjective and Argumentative").

See also the FAQ, which says,

"Avoid asking questions that are subjective, argumentative, or require extended discussion. This is not a discussion board, this is a place for questions that can be answered! "

ChrisW