What do you mean by the expressiveness of a programming language?

前端 未结 11 1937
眼角桃花
眼角桃花 2021-01-31 07:56

I see a lot of the word \'expressiveness\' when people want to stress one language is better than the other. But I don\'t see exactly what they mean by it.

  • Is it
11条回答
  •  你的背包
    2021-01-31 08:10

    Personally, I feel that the "expressiveness" of a language really comes down to how clearly the language constructs can "express" the developer's intentions.

    For example, I feel that C# (especially LINQ via C# 3+) is becoming much more expressive. This LINQ statement is a great example:

    var results = collection.Where(item => item > 5);
    

    Without knowing the details of the language or the implementation being used, the developer intent is (in my opinion) very clear in the above statement.

    I do not think that the verboseness of the language is equal to its expressiveness, however, there is some correlation in place. If a language requires a lot of code in order to express an abstraction, it is less expressive. These are two related, but different, concepts.

    The same is true with power - although here a language's features (ie: power) must be complete enough to express the abstraction clearly. Without this, expressiveness will suffer. That being said, a language can be very "powerful" in terms of features, but not necessarily be expressive, if the feature set is difficult to understand.

提交回复
热议问题