> I hope people will actually read the RFC before coming back with these
> canned responses which I (and presumably everyone else on this list)
> am completely familiar with. I used to believe that too! Honest...
> 
> I am looking forward to reading some *real* criticisms...

Ok, here goes. First off, I *did* read the RFC. I never respond before
reading. Personally, I wish people would quit coming up with these silly
"let's drop the prefixes" RFC's that everyone on this list is completely
familiar with.

> Also in modern programming, lists are not longer simple
> lists, neither are hashes, we have multidimensional arrays,
> FIFO stacks, LIFO stacks, semi-infinite lists, etc. 

Yeah, and isn't it cool that Perl gives you easy access to using and
understanding such complex data structures:

   print @{ $cars->{$model} };

That "junk" makes it easy to see that you're derefencing a hashref that
contains a key which is pointing to an array. How is this:

   print cars->model;

any clearer? Nicer to look at? Maybe for some. Not for me, I like the
former. Maybe it doesn't let you know exactly what you're getting, but
you're a lot closer. And this:

   print "Welcome back, $fullname, to $website!\n";

is MUCH better than this:

   print "Welcome back " . fullname . " to " . website . "!\n";

Ugly. Plus, is fullname a scalar? Array? Hash? Sub? Builtin? Well, it
looks like you have to guess, unless you wrote the whole program, which
you probably didn't.

Don't overlook the simple benefits of prefixes.

> Those days are gone. Perl 5 introduced the idea of Objects
> and now any variable can be one of ten million possible
> types all of very different behaviours.

Not true!! Only $scalars can hold objects. Now, @arrays and %hashes can
hold groups of objects, but only $scalars can hold objects.

I used to think this was bad also, and that objects should have their
own prefix, like *. So:

   *object = new CGI;
   print *object->param($name);

That makes it easier to see what objects are, true. But that's not the
real problem.

The real problem is that we lack true object polymorphism. That is,
objects are useless in number and string contexts. This is the problem
that needs to be addressed. I've submitted RFC's 49 and 73 on this, and
have another one coming. I hope you'll read them.

Please, nobody submit an RFC on the * idea. It's bad, and here's why:

   @stuff = (*object, $number, *filehandle);
   foreach ( @stuff ) {
      print "Got $_\n";
   }

If you have a separate prefix and type for objects, then this will have
to fail with "Attempt to stick object whatzitz in scalar whatzitz". Bad.

However, if you have object polymorphism, then you don't have this
problem. Objects are automatically converted to numbers and strings
on-demand. The internals people are doing some really interesting stuff
along these lines.

To summarize, you should read RFC's 49, 73, 28, and the link to TomC's
email I sent you. These address the real problems, and not the symptoms.

Maybe the prefix system isn't perfect, and maybe needs improvement. But
I don't see how eliminating it can possibly count as improvement.

-Nate

Reply via email to