Eric J. Roode said:
[...]
Only in that it lacks some niceties that more modern languages (like
Perl, or Java, or C#) provide, such as exceptions.
Isn't there one (or even more) library that makes exceptions available
in C?
Not that I've seen. I don't see how it could be implemented. Of course,
I may be missing something.
You can do anything with goto. Doesn't mean it's a lovely control
structure.
nor does Perl for that matter, eval and die is not that different from
longjmp. However, with both C and Perl you can use a library to make
things easier.
eval and die are tons different from setjmp/longjump.
No, it doesn't.
Aren't there libraries that do *exactly* the same for C / C++?
Dunno. Can you point to one that does so for C?
such a library might have a join, a split.
sprintf.
Sure, sprintf exists. You can't tell me it's a simple or easy to use as,
say $foo = "$bar $baz{a}{b} $quux[5]";
Yup, all this can be found in libraries for C, C++, Java, etc.
No library can make C or C++ support multi-line strings. Try this in C:
strcpy (var, "This string has
a newline in it");
or:
strcpy (var, <<END_OF_STRING);
...
END_OF_STRING
Then you don't know what you're talking about.
The question is: do you need those all the time? Moreover, the things
you do with, for example closures, are those not work arounds (now and
then) for limitations Perl has, but say C++ not?
Do you need those all the time? Of course not. I don't need wire
strippers all the time, but they're in my toolkit, and using a knife to
strip insulation off a wire is tedious and dangerous.
I don't see how closures are a workaround for limitations perl has,
except possibly in the sense of information hiding. Closures are
probably never necessary, but they make a bunch of problems easier to
solve. There have been times when I've wished for a closure in C.
No it isn't. Just create your own Universal class, and let everything
that adds inherit from it.
That only works if all of the libraries (including those from other
vendors) that you are using inherit from _your_ Universal class, which of
course they don't. In Perl, polymorphism simply requires that methods
have the same name. In C++, it requires that they have the same
ancestor.
C++'s solution is not *wrong* (nor is Perl's *right*); they're just
*different*. I happen to prefer Perl's, and have used it to good effect.
C++'s is more limited, however.