Is there a way of objectively measuring the efficiency or quality of software or code design? I've been thinking about ways of measuring code, and, quite frankly, I can't think of truly objective, semi-universal ways of evaluating the quality or "strength" of code to say, "Yes, this is better than that based on X, Y, and Z metrics" that are popular or exist. I've looked at SonarQube, and although I think their metrics are important, I feel like there are more fundamental concepts at work than what they have now.

But, of course, it's often said that certain languages are better than others because they have stronger guarantees or abstractions: C++ > C with abstraction, and Haskell > C++ with typing and purity and a whole slew of other features. But I was wondering whether it would be possible to actually quantify how much better one is than the other.

Are there existing papers that talk about ways of objective comparing coding paradigms or languages based on objective metrics?



A few of the resources I've found while search have to do with more business-y metrics like cost of quality or coverage of unit tests over development time. Also, measuring by number of lines seems fishy and not truly crucial (imagine if we measured math proofs' qualities by how many pages of paper it takes to print!):


http://www.infosys.com/engineering-services/white-papers/Documents/comprehensive-metrics-model.pdf
http://www.compaid.com/caiinternet/ezine/Gack-Effectiveness.pdf
http://www.compaid.com/caiinternet/ezine/Gack-Efficiency.pdf


Apparently the list of top 10 papers are also not based on measuring the efficiency of design in code, but are more focused on specific areas:


http://blog.mendeley.com/highlighting-research/the-top-10-research-papers-in-computer-science-by-mendeley-readership/
The abstract conclusion is not really that "some languages are better than others" but that "some languages are better than others for some purposes". Different languages are somewhat like species in evolutionary biology. They have evolved to fill certain niches. There are many evolutionary niches. They have strengths and weaknesses in different areas. Sometimes these types of analysis can degenerate into what is known in stackexchange as "gorilla vs shark" debates.

The question seems to mix up certain distinct areas in CS study. Code quality is measured by defects and is more programmer and implementation related than language related. Defects can be high or low in any language. efficiency in CS is generally considered interchangeable with ("execution") complexity and measured with Big-O notation. There is also another notion of code/ programming complexity where some functionally equivalent implementations may have different levels of complexity in their programs. This is studied especially in OOP theory.

However recently there is some research along the lines you mentioned. There is a large database of programs with identical functions written in the Rosetta code database and some comparative/ objective/ scientific/ quantitative analysis has been done by researchers. See eg:


A Comparative Study of Programming Languages in Rosetta Code / Nanz, Furia
Code length measured in 14 languages / McLoon, Mathematica