What makes a programming language expressive




















Improve this question. SilentGhost k 61 61 gold badges silver badges bronze badges. Ok, thanks for the responses. Seems it's a slippery word! I will avoid using it and stick to those I'm sure I understand. I'm as surprised as the OP.

It's strange how confidently people use the word in technical literature as if it has an exact meaning. Add a comment. Active Oldest Votes. Two factors that make for expressiveness: intuitively readable constructs lack of boilerplate code Compare this expressive Groovy, with the less expressive Java eqivalent: 3. Improve this answer. What do you mean by "precision" in your two examples? What does Groovy assume which Java makes you specificy?

Note: the use of an int loop variable in Java is an artifact of Java; it is essentially meaningless and not any more "precise" than Groovy's 3. Technically speaking, Groovy assumes you are writing to the standard output, whereas Java forces you to explicitly state this. But I think the OP's point was misstated as I initially had your reaction. Upon further reflection, I think the point is not that the core functionality behind the code is less precise, but the how is less precise.

In Groovy, we don't know how the looping is performed behind the scenes. Whereas the loop is not behind the scenes in Java at all. Hence, expressiveness.

This can be a good thing. It makes programming more fun, and it can lead to better code. But it can also lead to more idiosyncratic code. A large programming language like Perl allows developers to carve out language subsets that hardly overlap. A team member has to learn not only the parts of the language he understands and wants to use, but also all the parts that his colleagues might use.

And those parts that he might accidentally use. While Perl has maximal syntax, Lisp has minimal syntax. But Lisp is also very expressive, albeit in a different way. Lisp makes it very easy to extend the language via macros. While Perl is a big language, Lisp is an extensible language. This can also lead to each programmer practically having their own language.

With great expressiveness comes great responsibility. However, this potential advantage is all for nothing if you fail to achieve a consistent coding style, or fall prey to naming smells. After all, in the long term an application code base rather than a library will become large whatever language you are using. Languages with constrained coding styles make it easier to write maintainable code, at the cost of more code to maintain.

When you need help thinking through software maintenance, contact Peter Hilton for training in How to write maintainable code. Language expressiveness versus code maintainability How different programming languages lead to different software maintenance challenges - 13 August code maintenance unsplash-logo Crystal Kwok Some programming languages, such as Scala and Perl, aim to be as expressive as possible, giving you maximum flexibility in how you write your code.

Smaller code is more maintainable The most effective way to write maintainable code is to write less of it. Non-standard annotations harder to learn Java developers have a long history of reducing repetitive lines of code, by introducing annotation-based libraries such as Project Lombok. Cross language styles require double the background Multi-paradigm languages such as Scala offer the best of two worlds - object-oriented programming and functional programming.

Team-specific approach wins You need a team-specific coding style to achieve consistent maintainable code. Conclusion Languages that let you write the most concise code have the potential to be most maintainable, because brevity is a big advantage.

Previous article: Start-up ideas are still cheap Next article: Three causes of unmaintainable code. Above all, this graph says how expressive the programmers working in those languages have been. Only few people writing JavaScript code are able to deal with its expressiveness. I think if you look at the bottom whisker the 10th percentile , you might be able to get a decent feel for what the top users of a given language are doing. For instance, how do you define the semantics of expressiveness?

For my money, expressive would mean easy to code something which is easy to understand, reusable and fast. For instance, if I want to code something fast, which is easy to express, then I will often use perl or python.

Curiously those languages have a downside, which is they are difficult to read after the fact, if you want them to be efficient, despite being easy to express a concept. Every highly-efficient program I have written has been in C. Whilst describing any functional programming language like ML or Haskell as expressive?

If you have a huge brain and can describe things in that way, sure. But then no one else can understand it. OO brings expressiveness and control. Perhaps instead you should look into why developers commit in this way and in this volume, and what projects they relate to? John, thanks a lot for reading and commenting! I struggled to come up with a good term to describe this — expressiveness was the best of a bad set. So what exactly does this metric tell you? I could imagine it being pretty interesting to look at this kind of statistic across developers or organizations to see what you could learn about how they develop.

Do they use small, granular commits or large ones? Does it change when the process for pushing code is painful? I know and use several of the languages there and I think that Javascript might be a bit of an outlier. I wonder if this is because many projects include pre-packaged libraries like jQuery in their source code.

Whenever they update a library it makes a huge impact on their delta. Also, many web-focused projects minify their Javascript which can wreck havoc on an automated analysis tool. While I do think this is an interesting metric, I wonder how valuable expressiveness is in recommending a language.

Neither Clojure nor Coffeescript will get your foot in the door in my area. Expressiveness is just one measure, as you say. Also have to think about how much code is auto generated. In C ORM and web service references generate lots of code that would inflate these numbers.

Perhaps rosettacode would be a better place to look given that these are problems where the same exact problem is being solved by each language? Having casually studied that site though, it seems like your results would match well to me.

In that case, this would be more of a measurement of expressiveness of programmers than of programming languages. The IQR is a way to look at the width of the core distribution without being overly affected by outliers. The difference between the 10th and 90th percentiles would be another slightly less robust way to do the same thing.

I also noticed the higher ranking of relatively unpopular languages. Third-tier languages, on the other hand, are absolutely subject to your point. Vala was used by 87 developers, but there are some that are an order of magnitude lower: REBOL was used by 5 developers, Augeas by 8, eC by 9, etc.

The thing is, Capers Jones and the SPR has for years comparitively ranked languages by the number of SLOCs required per average unit of functionality, as an indicator of productivity. This all used to be common knowledge.

It became very clear that at a given skill level, VB. Then again, back in the day, real programmers also knew how to write and evaluate their own sorting algorithms and understood the value of metrics like Cyclomatic Complexity.

I commented this elsewhere, but I think pairwise comparisons reveal the limitations of this method. If you take very similar languages, they should have similar scores if this method works. But I doubt it—are Scheme and Racket highly different in expressiveness?

Another raised eyebrow is the rather significant difference between Python and Ruby. Why do they appear so different in your presentation? Another artifact: Emacs Lisp almost certainly has a low LOC per commit ratio because it is heavily used for hacking Emacs, which leads to lots of little helper functions. My general thought is: this list jives with my preconceptions in most cases, but seems very very noisy.

And you obviously nailed the fact that DSLs are special cases. Any thoughts? Can you provide any evidence that your assumption is correct? Sounds like a Straw Man hypotheses to me. That was basically the hypothesis going in: can we measure things this way? The results seem to bear out that it broadly works.

This reminds me of those quarterly poles that declare C as the most popular programming language based on the number of C-related web searches. Programming languages are tools and you use the right one for the job. I used it for 25 years until I retired. Perhaps the most successful vendor today is Dyalog, Ltd. Gradually it died out — most of the finance folks use Mathematica, R or Matlab now. There is also a slightly earlier variant called J then came K! It is suited more for mathematical and statistical programming.

Check out the wiki. I downloaded and tried NARS It is sort of neat. It starts off with a clear WS and above it, there is a string of the APL character set plus some that are new to me. Point the cursor at one and click on it. You do get an introductory Copyright message with instructions on how to suppress it.

At least normalize the commits by the size of the project. You may be observing that certain languages are used for different size projects. If only I were still in academia and had more time to devote! I see many social and behavioral signals affecting commit size, but not expressiveness of the language. Language communities have different cultures. So might value small commits, while other language communities might have a habbit of only commiting ever so often. Or, of committing small commits to a local feature branch and them merging the feature in one huge commit into the public repository!

Another example are behavioral signals causes by different best practices across language communities.



0コメント

  • 1000 / 1000