Ian Bicking: the old part of his blog

Re: The unbridled humanity of APIs

Whatever your feeling is about Java, saying it is stupid is really not a smart thing to say. You spread oil on the flames. Instead of trying to decrease the gap between the two communities you just end up giving a bad image of the Python community to the Java world. Now that is stupid IMO.

Comment on The unbridled humanity of APIs
by S.

Comments:

source
// "stupid" seems an appropriate description for a language that can't split a string...
// To be honest, I can't figure out how they screwed this up.  I'm trying 
// to imagine what the underlying split() code looks like, and I can't picture it.
public class stupid
{
    public static void main (String[] args)
    {
        System.out.println("1:2:3".split(":").length);
        System.out.println(":2:3".split(":").length);
        System.out.println("1:2:".split(":").length);
        System.out.println(":2:".split(":").length);
        System.out.println("1::".split(":").length);
        System.out.println("::".split(":").length);
    }
}

C:\tmp>javac stupid.java && java -cp . stupid
3
3
2
2
1
0

Compare:
>>> print len("1:2:3".split(":"))
3
>>> print len("1:2:".split(":"))
3
>>> print len(":2:".split(":"))
3
>>> print len("::".split(":"))
3
# msw

I think sometimes people mistake poor language design for problems with static typing. One class of problems is structural, and represents specific priorities with respect to the programmer and architect. But many parts of Java just show poor language design. Not giving containers (quality) first class syntax is just a design problem, there's nothing fundamental about it. So I call it stupid, because I think containers are pretty damn useful.

# Ian Bicking