A Question

August 9, 2006

Today has been a very frustrating day, and it’s only about half over. I have been frustrated by just about everything I do, everything I read, everything I think. I have my opinions, I hear other people’s, and I’ve no way of really making decisions about the merits of any of them. My opinions are based on my personal biases and experiences, and (hopefully) on some semblance of fact—something independently observable or verifiable. But so is the other guy’s opinion. If they’re in opposition, how does one choose? I’ve no real reason to believe that my opinion is any better than anyone else’s, except, perhaps, that it is my opinion—but that hardly seems like a very legitimate reason. This frustrates me.

Anyway, on to my question: When beginning a new project, how does one decide what language to use? As I’m sure you all know, I despise Java, and I now find myself on a project that—at least for the time being—is written in Java. I have, however, been given permission to port the prototype over to Python for comparison. Now I’m sure that Python will put the Java prototype to shame, but the conundrum is this: why not Ruby, or C#, or C++?

I look at a problem and pretty much always think that Python would provide a great solution; on the few occasions where Python’s garbage collection proves a problem, you can always write a C extension for that bit of code that needs the optimization. There is no silver bullet, but Python always looks pretty damn shiny to me. So why doesn’t everybody use it? Don’t get me wrong, I’m not fan-boying Python here; I love the language, but I do not believe it is perfect or the answer to all our problems. But it does always seem to be the answer to every problem I encounter. So I must be missing a piece of the puzzle. Unless of course, the fact is that Python, Ruby, C#, or what have you, are all pretty much equal, and it’s only a matter of personal taste…

Sometimes it seems that there are obvious deficiencies in a language, but when there aren’t, what tips the scales in favor of one language or another? Someone please straighten me out here. My head hurts.


One comment

  1. Why not Python? Well, sometimes it’s not just the right tool for the job. CPython has a number of serious implementation deficiencies.


    I talked more about them there.

    Specifically the “write everything in a slow way then optimise the hotspots” approach tends not to work in my experience. In a lot of software – especially desktop or high performance server work – there isn’t really a well defined set of hotspots that can be targetted. Rather a number of practices come together to make code that is just generically slow.

    For instance why are desktop Java apps such resource pigs (causing swapping, causing slowdown)? It’s not because they all feature one or two unoptimised hotspots that could be re-written in say C++ or C, it’s because Java encourages/requires a style of coding that uses a lot of resources:


    GC isn’t inherantly slow. Languages that lend themselves to constructs that can only be implemented inefficiently are what’s slow – eg every java object having a lock, every python object being reflective etc

    Hope this helps,

    -mike (TD)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: