Books as a success indicator

Some people think they can measure somehow the success of languages with book sales (or here): "C# is gaining on Java, python is gaining on perl [...]" (2005). But perhaps it's just measuring the focus of a publisher and they don't print books people want. When looking at the JavaOne bestsellers, it's clear that others do print interesting Java books people buy. From the top ten listing there is only one O'Reilly book (3 from Addison Wesley, 4 from Prentice Hall and 2 from Manning).

"In terms of computer languages, PHP (up 16%) continues its strong growth. C# (up 2.5% over last year) was the only other programming language whose growth was in positive territory. By contrast, sales of books on Java (down 10%), Visual Basic (down 23%), C/C++ (down 4%), Perl (down 14%), Python (down 9%), and Javascript (down 12%) were all lower than they were in the same period a year ago." (Q1/2007)

So what O'Reilly really says is that they have interesting books for PHP and C#, but less interesting books for Java, Javascript and Python.

Cleaning up

I have to do some cleaning of my open source projects (cintoo, Gabriel, Radeox). For there are other rights holders and trademark owners, for some there are old repositories I have no access to. With me leaving my last employer some things have changed and now I have to clean up the mess 😉 Sorry for keeping you waiting, I'll do my best to consolidate all stuff into Reposita when the rights have been cleared.

ELSE IF are nested IFs

I've been adding more metrics to Meaxure, lately the DCOND metric. DCOND is the deepness of condition nesting, currently only implemented for IFs, but not for switch or the ternary operator. Deeply nested IF statements are most often a source for bugs because of their complexity.

When I've run the first test, DCOND was very high for some classes. I took a look and wondered when I only found some ELSE-IF constructs, but no nested IF statements. For example:

if (a) {
       a
} else if (b) {
       b
} else if (c) {
       c
} else {
       d
}

Naturally one would assume the flow has a DCOND of one, because there is only one level of condition nesting. But the ELSE-IF construct is just short for:

if (a) {
       a
} else {
       if (b) {
               b
       } else {
               if (c) {
                       c
               } else {
                       d
               }
       }
}

This clearly shows that the block has a DCOND of 3 because the IFs depend on the one before. After trying for some hours to reimplement the DCOND metric to show 1 for the first case, I came to the conclusion this is no bug and DCOND should be 3. What a relief, no code needs to be written.

Metrics and Google Guice

I'm currently working on some code measurement software, as a plugin for Reposita. As a test object I use Google Guice. The measurement tool called Meaxure not only calculates metrics but checks licenses and checking Google Guice it has found 86 times the Apache 2 Licenese and one unknown license. Taking a deeper look reveals that crazy OutOfScopeException.java in Guice has no license at all 😉