From: Andrew Lentvorski <[EMAIL PROTECTED]>
Gabriel Sechan wrote:
Thats one of the reasons I prefer a small standard library. THere's a lot
of places where standard libraries are just bad (C strings, Java's IO
library, Java's AWT, PHP's SQL libraries, etc).
Your assertions are not universally shared.
But they damn well ought to be :)
C strings are just fine when a string is a "bag of bytes terminated by
NUL". They start looking bad once systems get large and powerful enough to
drag along character counters and people try to interchange between systems
and languages.
The problem with C strings is twofold
1)Some simple things (like getting the size) are inefficient. The
memory/CPU tradeoff may have been right in the 70s, it no longer is.
2)The C string library, due to the design of C strings, leads to easy buffer
overflows/segfaults.
On the plus side, the C string is dead simple and a good way of transfering
data between programs/languages. But it should really only be used to
communicate with libraries and at the edges of programs.
Java's IO library encapsulates a stream abstraction quite well. If you
don't want that particular abstraction, you need Java NIO.
Java's IO library is overly complex, abstracted to the point of uselessness.
At least 5x too many classes, many of which make no sense. The design is
just BAD.
I'm not saying that these are good technologies, but they clearly solved a
problem at the time or they would never have been implemented.
Yes, but they didn't all solve it well. C strings may have at the time, but
now are not the correct solution for most things. Yet we can't get off
them, even in C++, due to them being standard.
But since they're the "standard" it takes a long time for someone to write
better ones. If you introduced a C or C++ library that bad, noone would
use it and they'd use a competitor library instead.
Um, good C libraries? Bad libraries removed by competition?
BWHAHAHAHAHAHA! Oh, you kill me.
Ever taken a look at the API for libjpeg, libtiff, libvorbis, etc. Talk
about wretched libraries.
Don't know about those in particular, I don't do much media stuff. But I've
known plenty of socket libraries that have bitten the dust, plenty of
database access layers that have died, and a host of others. Why? Because
the APIs just weren't any good compared to their competition. In a language
with a standard this just doesn't happen- people use the standard and deal
with inefficient or downright hard to use APIs.
Competition between implementations is a good thing, the end result is the
bad ones dieing and the good ones stealing ideas from each other.
This simply doesn't happen in C. And rarely so in C++.
This *is* one of the things that Java does *perfectly*. The ability to
simply tear out a crappy library by replacing its jar file is a wonderful
thing. Add the fact that everybody expects that a Java library has JUnit
tests and you get pretty close to library nirvana.
100% backwards. THis happens all the time in C/C++, and almost never in
Java. People live with the standard in Java. In C++, very few of the
libraries I used 10 years ago are still around, because better ones have
replaced them.
As for just replacing its jar file- thats laughable. ANy difference in
interface breaks that idea. So no, you aren't getting a better API at all.
Perhaps this is where we differ. I did not mean a better library to mean
"Replace API Foo with a different implementation of API Foo". I mean it as
"Replace API Foo with a new, improved API".
I think perl is set up pretty well that way- small standard library, and
CPAN exists as an easy way to find quality add on libraries. Or C++, with
Boost.
CPAN. <snicker> Which version of the module is compatible with which
version of Perl?
I do like Boost. A lot. Once the STL finally became stable, Boost became
a shining example of what a library repository is supposed to be.
Well, CPAN tried. Its not their fault that perl's implementation is so bad.
Gabe
_________________________________________________________________
The MSN Entertainment Guide to Golden Globes is here. Get all the scoop.
http://tv.msn.com/tv/globes2007/?icid=nctagline2
--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list