Disclaimer, I make most of my living working in Java and this blog is written in Python. Elliotte Rusty Harold writes after seeing Python 3 come out with little care for backwards compatibility:

Unless we're willing to make the hard choices and abandon the legacy as Python has, Java is doomed to the fate of C++ and Cobol: a tool for programmers with long white beards who grew up with the language and have learned all its arcana by gradual accretion and who spend their lives maintaining code written a decade or more ago.

Meanwhile a new generation of programmers will abandon Java in favor of more nimble modern languages like Python just as we abandoned C++ in our youth in favor of Java.

There are still an awful lot of systems written in Java that will need to be maintained; there is also a great deal of business logic in freeware and payware libraries that are used to ease the burden on development. I don't see that changing soon. I do agree it is frustrating to work in a language and see its limitations and clunkiness day after day after day.

A good rant none the less.
I needed a simple logarithmic based tag cloud where the frequency of the tags was weighted logarithmically. This means that lower frequency tags get dampened down into the same font size and higher frequency tags are popped out in a tag cloud.

def tag_weight(x):
    if x==None or x==0:
         x = 1
    return weight * math.log(x, math.e)

It is pretty simple. It protects against a None or 0 as putting either of those into the log function would result in a ValueError.

The 'weight' variable can be fixed or calculated and is a means to add a formula to the log output to make the tag cloud look good to a human eye when displayed on the page. I use the output of the tag_weight() function in the style attribute of li with with font-size and em.
Logarithmic tag cloud using Python. (more)
Cam Riley: South Sea Republic. Freedom, liberty, equity and an Australian Republic.