Posts Tagged ‘java’

Write once

Tuesday, June 5th, 2007

Apparently, in the world of development, Java is a giant joke. It’s a giant in several ways. It’s easy to start learning and using, but in order to really know it, you have to spend immense amounts of time learning just the standard library alone. Add to that all of the extra classes that you’ll undoubtedly come across, and you have one massive language.

It’s also gigantic because it really wasn’t written with efficiency in mind. I mean, char is two bytes and none of the primitives are unsigned. It’s a pain the butt to translate C code over to Java because of this, especially when there are bits to be shifted. Essentially, the way around this is to treat each byte as a larger type, like a short or int.

But once you get into Java development, you’ll learn that Java is the joke and that the punchline will always be, without fail, “Write once, run everywhere”.

Java XP

Wednesday, December 20th, 2006

I have come to the realization that everything that makes me angry in Java pisses me off in Windows. This has been especially evident when I gave up using Java to study for my CS final and instead have been actually completing some work using Python after taking a few hours of my time to relearn.

Let’s have a look at Java.

class HelloWorld
{
    public static void main(String[] args)
    {
        System.out.println("Hello World!");
    }
}

How about that C?

int main()
{
    printf("Hello World!\n");
}

And my favourite, Python.

print "Hello World!"

Why am I creating a class for a trivial program? Why am I declaring the scope of the main function? Why isn’t main a reserved word?

See, Java makes you go through unnecessary hoops and annoyances to do hammer it into submission. Apparently, this is “more safe” and “reinforces good programming practice”.

Sound familiar?