Skip to main content

Get it: people prefer statically typed languages

Posted by fabriziogiudici on September 5, 2011 at 9:45 AM PDT

I'm an advocate of statically typed language since... the origin of times. You may agree or disagree. But this Tiobe graph clearly speaks to me:

 

The peak of dynamically typed languages happened right in the years in which a lot of rumor was made about Ruby & friends going to conquer the world. Now it's clear that the world is still for Java and C#, or C and C++ if you like the old style. In the foreseeable future it will be perhaps Scala, more likely something else, but statically typed.

Related Topics >>

Comments

*sigh* Did you bother to check what TIOBE is ...

*sigh*

Did you bother to check what TIOBE is (http://www.tiobe.com/index.php/content/paperinfo/tpci/tpci_definition.htm)? You might as well conclude that static typed languages are so hard to use that they end up on top of TIOBE.

Languages are tools. Using the right tool for the right job makes all the difference ..

"You might as well conclude that static typed languages ...

"You might as well conclude that static typed languages are so hard to use that they end up on top of TIOBE."

Sure. In fact dynamic typed languages are so easy that tons of people use them but they absolutely don't mention them in blog posts, articles, conferences. They're a trade secret.

*hm* Blog posts, arctlces and conferences, eh? Here is to ...

*hm*

Blog posts, arctlces and conferences, eh? Here is to the lazy ones ..

===

Ratings

The ratings are calculated by counting hits of the most popular search engines. The search query that is used is

+"<language> programming"

This search query is executed for the top 7 websites of Alexa that meet the following conditions:

  • The entry page of the site contains a search facility
  • The result of querying the site contains an indication of the number of page hits

Based on these criteria currently the following search engines are used:

  • Google: 32%
  • Blogger: 32%
  • Wikipedia: 16%
  • YouTube: 10%
  • Yahoo!: 3%
  • Bing: 3%
  • Baidu: 3%

The number of hits determines the ratings of a language. The counted hits are normalized for each search engine for the first 50 languages. In other words, the first 50 languages together have a score of 100%. Let's define "hits50(SE)" as the sum of the number of hits for the first 50 languages for search engine SE and "hits(PL,SE)" as the number of hits for programming language PL for search engine SE. Possible false positives for a query are already filtered out in the definition of "hits(PL,SE)". This is done by using a manually determined confidence factor per query. A query such as "Basic programming" also returns pages that contain "Improve your basic programming skills in Java". The first 100 pages per search engine are checked for possible false positives and this is used to define the confidence factor. If this factor is 90%, then only 90% of the hits are used for "hits(PL,SE)". An overview of the confidence factor can be found in the groupings table below.

The ratings are calculated with the following formula:

((hits(PL,SE1)/hits50(SE1) + ... + hits(PL,SEn)/hits50(SEn))/n

where n is the number of search engines used.

At this point you should have supposed that I have entirely ...

At this point you should have supposed that I have entirely read the details (actually, lots of time ago, since this is not my first blog post about Tiobe), so you're saying nothing new. Actually, everybody knows that Tiobe works like that. One can discuss how accurate the Tiobe algorithm is - and I'm open to the discussion - and possibly declare that Tiobe is not meaningful. But clearly it relies upon contents like the ones I mentioned: the more a language is mentioned on the web, the more popular it is. There's not much to add.

&quot;But clearly it relies upon contents like the ones I ...

"But clearly it relies upon contents like the ones I mentioned"

It clearly doesn't. If you bother reading: it relies on search requests - not on contents. And it doesn't tell you anything about the 'why' of the search.

&quot;If you bother reading: it relies on search requests - ...

"If you bother reading: it relies on search requests - not on contents."

As I understand it from your post (yes, I bothered reading ;) it relies on the number of hits for a search request that searches for the contents containing the 'required words' for a language.

"And it doesn't tell you anything about the 'why' of the search."

As I understand it, the search command (i.e. the 'required words') for language XXX is +"XXX programming" and the 'why' of the search would be that Tiobe is trying to get the number of hits for this search command, i.e. for this language. Where and how am I (or Fabrizio) wrong in this?

Various answers. First, I agree that the preference is a ...

Various answers.

First, I agree that the preference is a mixture of "passive" habit and "active" choice. Let's add another component: market share. People with no specific passion or preference might be more or less interested in moving to either side according to the market trends. I've recently seen webapps when the customer put a constraint about using JQuery, so... And I think that most of the growth of ObjC is leaded by the iPhone / iPad success, rather than by a specific choice (in fact, ObjC exists since a long time but it has been always irrelevant before the iPhone).

We all agree on the existence of these "forces", while we disagree on the relative strenghts. I think that currently it's impossible to give a realistic and concrete answer to the question "which is the dominant force in the choice". In fact, I didn't raise the argument in this post. What I'd like to do is at least to do some pruning based on facts. Indipendently of the forces behind, the graph shows that statically is preferred over dynamically. A few years ago people predicted the trend was inverting, and this was a wrong prediction. Nothing else to say - this was my only assertion in this post.

Second: is JS included? Yes, it is - look at the Tiobe page where they describe how data are computed. Of course, we can discuss whether Tiobe is accurate. I don't know. I'd take with a very coarse confidence the measures about single languages, while I think aggregations such as static vs dynamic are reasonable, as they are an average.

Third: I know masters of JS that love JS because it's dynamic. In particular agilists love dynamic languages and many pick JS because, as opinali said, it's pervasive on clients. I agree that a measure of its actual likeness will be provided by the popularity on the server side. I must say I've seen people starting to use JS on the server several years ago, so it's not a new thing, and so far it has been irrelevant. Now there are some news in the scenario (new frameworks, the cloud, etc...) that might change things. But if I don't see it, I don't believe in it.

Hi Fabrizio, Do you prefer left hand drive or right hand ...

Hi Fabrizio,

Do you prefer left hand drive or right hand drive? I ask because what I see in this graphic is an education system has taught us to prefer statically typed languages. If one had been educated to prefer dynamic languages, the TOBIE index would reflect that bias. In a statistical sense, using the TOBIE index to say given free choice, we'd choose statically typed languages is jumping to a conclusion that just isn't there. What it is saying is that we prefer to do as we've been taught. If we could setup a regression, I bet the answer would be quite different. In fact it might even be 50/50. It is a shame that the education system is injecting this bias as it's teaching us to closing our minds to alternatives. Good thing that a good number of developers have rejected the status quo. It's that spirit that helps move us forward. I guess this conclusion doesn't apply to driving ;-) And, I guess it supports your claim that developers prefer statically typed languages.

Regards, Kirk

ps I for one, don't really care if the language is statically typed or not. I see goodness in both.

The dominance of static languages is not new - it's always ...

The dominance of static languages is not new - it's always been like that! - but some dynamically-typed languages, like Lisp, Scheme and Smalltalk (and others from these families) have sometimes been quite popular in CS courses. Thee's also way too many people (me for one...) who cut their teeth in stuff like BASIC dialects or Assembly, which are not even strongly-typed. Well these things are mostly old-timer's, I agree that in the last 15-20 years most developers have learned programming in formal academic courses and using a language like C or Java. Still I don't see a strong causality.

It's more likely that static-typed languages have been strongly favored by performance, and by imposition from popular platforms/SDKs. (Relatively) efficient execution of dynamic languages is a very recent thing, despite pioneer stuff like Self; and it still comes with a big "work in progress" flag. Platforms/SDKs/frameworks that allow a programmer to do all work in his favourite dynlang are also a rare thing. Most of the time, what you really get is a reasonable framework that covers some important domains like web development, but require you to step outside and write some ugly C code (or import a library that somebody else wrote for you - in ugly C code) for tons of extra needs. Wake me up when all your CPAN modules or Ruby gems can be built without gcc because your dynlang is fast enough to support a "pure" implementation of any library, then we talk like grown men... ;-)

There are no full-blown platforms that expose dynamic-typed APIs. I think webOS was an exception (Javascript), but so far it's dead. Apple's Cocoa/iOS/etc. are based in Objective-C which has late binding, but that's just a little bit of dynamic icing (late-bound messages) on top of a big cake written in C. So, as far as I can see the dominance of static-typed languages will continue for decades to come.

Is Javascript included in this graph? Its way more than Ruby.

Is Javascript included in this graph? Its way more than Ruby.

Javascript is a unique case because it has no competition ...

Javascript is a unique case because it has no competition (or at least, no realistic competition - one that runs in most browsers without plugins). Javascript is adopted despite being dynamically-typed, not because of that. And with modern technonology that generate the JS code for us, such as GWT, an increasing numbe of developers are breaking free of the ordeal of writing sophisticated, large-scale code bases in a language that sucks ass for that (and I don't mean just the typing, it has many other problems, for one thing numeric support is lame beyond belief).

Javascript's real test will be out-of-browser things such as Node.js, but my predicion is that this fad will not last long.