Runcible Blog

Sick of Java

The other day while killing time at a book store I paged through "The Python Cookbook" and felt so refreshed to read such elegant and simple code. I'm really impressed with Python. Within a couple days of learning Python, I had written a multithreaded application with configuration files, logging, and other nifty things (it was just an exercise though). It's too bad we're not using Python for anything at work.

I'm already getting tired of Java, mostly because I think it's overrated. Java seems infested with marketing dweebs with fetishes for acronyms, buzzwords, and XML files. I'm tired of using such ugly, counterintuitive interfaces (NetBeans, Eclipse, etc.) to do even rudimentary things in Java. "Java people" are in denial that the language they love is still slow and bloated after 10 years and still looks crummy on OS X.

I think that if a language basically requires you to use a big, fancy IDE to develop with it, you've got a problem. And specifying each JAR file you need to use on the command line when you run a class gets old quickly.

Here's a very unscientific comparison between Java and Python. I wanted to know how much resources Java takes when it's not doing anything. Here's the shortest bit of code I know to have Java sleep for 10 seconds:

public class JavaSleep {
    public static void main(String [] args) {
        System.out.println("Sleeping...");
	    try {   
                Thread.sleep(10000);
	    } catch (InterruptedException ex) {
	    }
    }
}

pretty needlessly verbose.
Here's how to do it in Python:

from time import sleep
print "Sleeping..."
sleep(10)

Ahhh...that's more like it!

And here are the results from top:

PID COMMAND      %CPU   TIME   #TH #PRTS #MREGS RPRVT  RSHRD  RSIZE  VSIZE

955 python       0.0%  0:00.14   1    12    37   816K   376K  1.44M  27.5M
956 java         0.7%  0:00.43   9   150   110  23.8M  12.4M  8.32M   235M

The JVM uses 9 threads, many megabytes of RAM, and more CPU time just to sit there sleeping. To be fair, Python isn't known for its speed or its memory footprint either.

Anyway, that wasn't much of a comparison, but my complaint still holds. It seems like Java and its IDE's encourage programmers to be lazy and unsure of themselves. Type-ahead editing is nice but very easily abused. I've seen it in action: you start typing something, hit period, wait 10 seconds for a long menu of methods to pop up, and find the right one. "Java people" will say, "It makes me more productive!", but I'd argue that if someone experienced with Java still relies on code completion for every task, there's probably something wrong with Java (and the programmer).

That's my Java vs. Python rant.


Today's Observations

  • I think there's a cult living down the street from here. The house/church on the corner is called "The Lighthouse Baptist Church". I know that only because some of the residents canvassed the neighborhood with their propaganda.
    I don't think I've ever seen adults around their house, but I always see a bunch of idyllic, somewhat Aryan kids who look like transplants from 1953 playing in the yard or standing around outside. And the weird thing is that the kids look happy. There must be something fishy going on...
  • While eating lunch at Papa Gino's today, a man in his fifties with his three little kids strategically chose the seat where he could stare at two hot high-school girls sitting in the next booth. I noticed his forbidden, devilish glances between bites of pizza.
  • I walked to the ATM to deposit my check, and it felt great! (the walk; not the deposit) A few more brisk walks like that and I'll be ready for the marathon, for sure!
  • A house on Haverhill Street has a sign on the lawn: "room for rent/share a 2 bedroom house/seeking female roommate/Call Eddie". I laughed to myself but then thought, "what a great idea!"


Secret Mission

I'm on a secret government mission that I can't talk about until tomorrow. Stay tuned.


Farewell, Camry

The other day while I was at work, my Toyota Camry was towed away to that great dump in the sky. It lasted nearly 20,000 miles in little more than a year with me.

Godspeed, good buddy!

the bumper



21 is no fun

They only want you when you're 17.

When you're 21, you're no fun.