RootsWeb.com Mailing Lists
Total: 1/1
    1. Re: What's wrong with GEDCOM ?
    2. Doug McDonald
    3. David Harper wrote: > Doug McDonald wrote: > [SNIP] >> You want bloat and full specification, there are languages for you, >> for instance Ada and Java. Both are near-useless because >> of exact specification disasters: for instance, Java specifies >> a specific float formant that is incompatible with the 80x86, >> a major, major, major problem. So big that strict Java is >> in fact useless for 99.5% of the computers in the world. > > I suspect that we're heading increasingly off-topic, but as someone who > programs in both C and Java, I have to disagree with that > characterisation of Java. > > The Java language itself is actually rather elegant and compact. It > follows the tradition of C in that respect. You can summarise the > essential features of either language on a single sheet of paper. > > The Java API contains several thousand classes, which can be quite > daunting to a novice, but the folks at Sun were wise enough to organise > them into a set of packages according to type of functionality: I/O, > networking, text manipulation, database connectivity and so forth. > > Compare that with the API which C programmers need to achieve the same > functionality. C itself has only a few dozen library functions. I think you are here referring to operating system calls, not the language per se. > > Java does indeed stipulate the endian-ness both of integers and of > floating-point numbers, but the only people who ever need to worry about > that are the programmers who are unlucky enough to have to write Java > code to read binary data produced by non-Java software. For them, the > Java API provides a rich set of conversion functions, so reading and > writing 80x86 native-format binary data is actually very easy. But the endianness of Java is enshrined in disk and other files .... and since it is the wrong choice, a conversion speed disaster ensues. > > Java is widely used on the Intel-based Windows and Linux systems which > make up the bulk of the world's computers. Evidently, Java's > stipulation of big-endian numbers is not a major problem at all. The endianness in general only causes minor slowness problems, since Java internally, for integers, can use the native endianness of the hardware. The major disaster is that Java specifies a floating point format that is incompatible with Intel hardware. And the semantics of Java require that calculations actually be carried out using that format, which is incompatible with Intel hardware. Unlike integers, you can't use native Intel float internally. This means with strict Java you have to do float in SOFTWARE which is abysmally slow. Now normally of course on the PC you don't use Sun Java but Microsoft's native-float clone, which gives identical answers except in the edge cases where Sun and Intel floats differ. C has none of these problems. Its only problem in this regard is in reading binary files from non-native hardware. Doug McDonald

    11/16/2007 09:09:35