Does Anybody Use New Programming Language Features?

05.16.2011 |

If we can figure out which new features get used, maybe we can figure out why some bomb.

Organizations that publish computer programming languages, such as Java, often issue updates with new features that promise to make a programmer’s life easier. But it’s hard to tell if anyone actually uses the features, much less whether they actually live up to their billing. Now a team of researchers is trying to shed some light on the process. Singling out the highly-publicized Java generics feature released in 2004, the research team has found that less than half of Java programmers are using the feature – and even fewer are taking full advantage of its capabilities.

The research team, made up of computer scientists from NC State, Georgia Tech and Microsoft Research, pored through approximately 500 million lines of open-source code, written by 532 programmers working on 20 different projects. In a draft paper being presented May 21 at the Working Conference on Mining Software Repositories, the researchers say they found fewer than half of the programmers used the Java generics feature, and that the feature was used on fewer than half of the open-source projects.

Here’s some background, in case you’re not a software whiz. Software languages have specific features, or commands, that are typed in as shorthand for programmers. For example, a feature may allow a programmer to type in a single line of code, instead of five. This saves time, and limits the possibility of the programmer accidentally typing in a bad line of code – reducing how frequently programs crash.

Periodically, the companies that publish these languages will issue updates that include new tools and features. The updates are intended to make the language more user-friendly for programmers – and cost the publishing company a fair amount of money. And it can be time-consuming for the programmers too, since they have to familiarize themselves with the new features. As a result, it’s important for the features to be worthwhile.

But why do some features catch on, and not others? And how can you tell which are which?

That’s what the research team is trying to figure out. They opted to look at Java generics as a case study because: it garnered a lot of attention in the programming community when it came out; and because Java is one of the most widely used programming languages in the world.

In addition to the fact that many (if not most) Java users don’t use the generics feature, the researchers also found that the feature didn’t appear to make the programming process more efficient.

However, at this point, they still don’t know whether the fault for that lies with the product, the programmers, or some combination of the two. In other words, are better tools and training materials needed for the feature? Or is the feature itself flawed?

Ultimately, the researchers hope to answer that question not only for Java generics, but for new language features in general. If they can identify the characteristics that make new features successful, language developers can act accordingly. And hopefully all future language updates will actually be useful.


10 Responses to “Does Anybody Use New Programming Language Features?”

  1. DirtExplosive says:

    Wow, uhm I gotta say this is a little more than short sighted on the target Java versions and intended audience for some of these projects.

    Ant, Commons Collections, Log4j, Maven, and Xerces all have intended usages that I know are designed to be pre Java 1.5 compatible. So a full 25% of the survey’s project list are being used as some sort of filler.

    The reason generics are not in these projects is that the intended audience does not support generics. So, how can this survey count at a minimum these 5 projects as “failures to implementing Generics”, when “DO NOT USE GENERICS” is a design goal?


  2. Chris Parnin says:

    Actually, Common Collections and Maven3, where one of the larger adopters of generics. It is interesting that 3 projects did not find the feature compelling enough to change their design goal.

  3. [...] this article: The Abstract :: North Carolina State University :: Does Anybody … Categories: Programming 0 Comments Tags: features-, life-easier-, new-features, often-issue, [...]

  4. neo says:

    If I were to do this research, I would look at the code programmers submit in competitions like Google Codejam or Topcoder. And, I am sure I would have found that more programmers use Generics.

  5. aretae says:

    I teach Java to programmers in (large) companies for a living. Short response… most Java programmers don’t understand the language well enough to use interfaces, much less write their own generics.

  6. Mike Samuel says:

    Java is a widely used language so its users are specialized into application developers and library developers. Java provides some features meant to be used by everyone, and some targeted at a small group of library developers (e.g. type parameter variance was never expected to be understood by everyone right away) that allow them to provide powerful robust libraries to the much larger group of application developers.

    The appropriate metric to measure is not the number of projects or developers who use features, but the deployed applications that are enabled or simplified by those features.

  7. James says:

    “Organizations that publish computer programming languages, such as Java, often issue updates with new features that promise to make a programmer’s life easier.”

    Haha. Java, really? Compared to any other currently-maintained language I’ve used in the past decade (C#, F#, Python, Ruby, Javascript, Scala, Clojure, etc.), Java is absolutely glacial at adding new features.

    I think what’s going on here is that all the programmers who are interested in using new features have already left it for other languages that actually *do* issue frequent language updates. Certainly, if it was important to you not to have to make a cast every time you accessed a collection, you would not have stuck with Java for the 8+ years that it took to gain this feature! Java is a filter: it only traps people who are OK working in a low-level language that rarely changes.

  8. JDS says:

    neo: You’ll probably find that people in programming competitions are more likely to use Ruby, or Go, or any number of new ‘cooler’ languages and features. That’s a biased sample and not necessarily representative of the development community as a whole.

  9. I don’t remember the last time I saw a bit of java code that wasn’t using generics. I’m sure there are still people out there who don’t know how to use them but I think it would be a small minority.

  10. Emerson Murphy-Hill says:

    Neo — methodology depends on what research question you’re asking. In your proposed study, the results would characterize what coders do in a competition. We wanted to characterize what developers do in more realistic settings.

Leave a Reply