a warm, fuzzy "fuck you" to Java

Perl4 code still works, even though Perl5 has been out for a long time now (by language development standards). I think Perl6 will have to be able to cope with all of the legacy code, even if it’s completely different under the hood.

(If you know something I don’t, tell me.)

Avumende: That’s not really a problem, because sometimes it’s useful to be able to differentiate between strings and numbers. But Perl doesn’t make you think about it if you don’t want to (and it would make sense for you not to). It isn’t an issue in Perl because Perl doesn’t make it one, and instead strives to do what you mean.

I sometimes use Python myself. I like the interactive development environment, but the sheer codebase just isn’t there. There are Perl modules for doing nearly anything you would want to do, all available through CPAN.

Finally, about beauty: You can write train wrecks in any language, including Java and Lisp and other ‘pretty’ languages. You can also write beautiful assembly and Basic, two languages not noted for their asthetics (to put it mildly). Beauty comes from the inside, places like elegant program design and logical flow control and intelligent use of pre-written code (be they modules or libraries or macros). Good programmers can write well (readably and efficiently) in any language.

Perl is a language that does not enforce a format, like FORTRAN and Python and Ruby do, because to prevent people from doing stupid things (like writing unformatted messes of ASCII) prevents them from doing clever things (like writing once-use programs on the command line to solve annoying little problems).

Perl also has a much more idiomatic syntax than other languages: You can do things like say


while (<>){
chomp;
print;}

to mean that you want to read every line in the standard input stream, remove the newline character or characters, and print it to standard output. To me, that’s perfectly intelligible and readable, like reading casual English instead of prose. (In fact, a lot of Perl can be understood by comparing it to English or another natural language.) It takes some getting used to, but any language you want to get good at takes practice and effort.

Yeah, I jumped into this thread with my fists up, ready to defend you!

So many posters with multiple-use names…

thanks, Avumede, for pointing out that a lot of the existing objects implement equals() in a sane manner. I havent really taken the time to look at a lot of them, in fact, i sort of assumed that they did a good implementation, but i may look further into those types of object for future reference.

however, if I am creating an entirely new data structure for some heavy-duty programming, what would have been ideal would be to implement a default equals() sanely in the first place. for instance if I have an object with the following pseudocode data structure:

then 90% of the time, i will implement equals() thus:
return ((obj1.equals(compObject.obj1))&&
(obj2.equals(compObject.obj2))&&
(obj3.equals(compObject.obj3))

i dont want to have to write that every single friggin time i write my own object. however, I won’t complain any more, since the way they implement it (merely defaulting to “==”) at least has the advantage of being simple to implement. My instructor had led me to believe that by default it recursively applies “==” to the member objects, which makes no sense at all.

So my rant against my instructor still stands :slight_smile:

Now, a rant against perl would be a whole 'nother thread…“This may seem a bit weird, but that’s okay, because it is weird.”–Wall. nuff said. (honest to goodness, i have had to deal with folks who coded pointers to pointers to arrays of hashes of arrays of hashes in perl. no thanks!)

Ludovic, you can do the exact same pointer shit in C, and in fact you have to to implement hashes. Perl allows you to do what you want, and some people want to do stupid shit. Some people want to watch “The Beverly Hillbillies” all day and all night, some people want to mainline cocaine, and some people want to create needlessly complex programs. People can be stupid. Perl doesn’t try to stop them.

Why is it so permissive? Because the developers want to allow you to do really smart things as well. Like write an RSA encryption program in two lines (this implementation calls the external but standard program dc, something Perl makes very easy). I don’t think that’s even possible in Java (I don’t know how much Java enforces a certain format), and I know it isn’t in Python.

By basically getting out of your way and letting you do what you want, Perl places a lot of responsibility on the programmer. The responsibility to write objects that others can’t mess with (yes, Perl has good OO support), the responsibility to enforce security (more meaningful in *nices, where you can do with Perl anything you can do with a shell script (plus a shitload more)), and the responsibility to write readable code (one of the main thrusts against Perl, but can be made against even languages with a strictly enforced format). But with responsibility comes power, and Perl is great at empowering the programmer to do the job and get on with it.