Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > The single biggest STUPIDITY in Perl ...

Reply
Thread Tools

The single biggest STUPIDITY in Perl ...

 
 
jps
Guest
Posts: n/a
 
      12-11-2008
The single biggest STUPIDITY in Perl, IMO, is that it does not
implement proper list-of-list, list-of-hash, hash-of-list & hash-of-
hash structures.

If -for example- you could just write
my @list = ((1,2),(3,4));
to get a 2x2 matrix (rather than 4-element list) I think the code
could be soooo much more elegant, and easier to write in a much more
readable fashion.

I believe you could then eliminate some 99% of all references that you
see in actual Perl-code -- them all sitting there only as a dreaded
workaround for this profound defect of the language.

Or am I missing something here?

Is this, by any chance, being fixed in Perl6, btw?
 
Reply With Quote
 
 
 
 
A. Sinan Unur
Guest
Posts: n/a
 
      12-11-2008
jps <(E-Mail Removed)> wrote in news:0810b4ad-e075-45ca-b94b-
http://www.velocityreviews.com/forums/(E-Mail Removed):

> The single biggest STUPIDITY in Perl, IMO, is that it does not
> implement proper list-of-list, list-of-hash, hash-of-list & hash-of-
> hash structures.


Need some attention, eh?

> If -for example- you could just write
> my @list = ((1,2),(3,4));
> to get a 2x2 matrix (rather than 4-element list) I think the code
> could be soooo much more elegant, and easier to write in a much more
> readable fashion.


First, @list is an array.

Second, what is so unreadable about:

#!/usr/bin/perl

use strict;
use warnings;

my @x = ( [1,2], [3,4] );

print $x[1][0], "\n";

__END__

> I believe you could then eliminate some 99% of all references that you
> see in actual Perl-code -- them all sitting there only as a dreaded
> workaround for this profound defect of the language.


I guess if Perl 1 - 4 never existed, Perl 5 might have done things
differently. However, if the existence of references is the worst thing
about Perl, then it really ain't so bad, IMO.

> Or am I missing something here?


The proper attitude. If you find the language so profoundly STUPID, feel
free not to use it. If you are going to use it, try to understand why
things are the way they are before making proclamations.

> Is this, by any chance, being fixed in Perl6, btw?


I still haven't paid much attention to Perl 6, but I bet you could find
out and inform us about the differences in the handling of multi-
dimensional data structures.

Maybe someone has already written something about multidimensional data
structures in Perl 6. I wonder how one might find out if such a document
exists. I wonder indeed.

http://www.google.com/search?&q=perl...data+structure

Ain't life wonderful?

Sinan

--
A. Sinan Unur <(E-Mail Removed)>
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/
 
Reply With Quote
 
 
 
 
Tad J McClellan
Guest
Posts: n/a
 
      12-11-2008
jps <(E-Mail Removed)> wrote:

> The single biggest STUPIDITY in Perl,


> this profound defect of the language.
>
> Or am I missing something here?



You are missing that you are free to use a less stupid and defective
programming language.

Perl is not for everyone.


--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
 
Reply With Quote
 
smallpond
Guest
Posts: n/a
 
      12-11-2008
On Dec 10, 7:09*pm, jps <(E-Mail Removed)> wrote:
> The single biggest STUPIDITY in Perl, IMO, is that it does not
> implement proper list-of-list, list-of-hash, hash-of-list & hash-of-
> hash structures.
>


Obviously you don't know about "0 but true"
 
Reply With Quote
 
Peter Makholm
Guest
Posts: n/a
 
      12-11-2008
smallpond <(E-Mail Removed)> writes:

> On Dec 10, 7:09*pm, jps <(E-Mail Removed)> wrote:
>> The single biggest STUPIDITY in Perl, IMO, is that it does not
>> implement proper list-of-list, list-of-hash, hash-of-list & hash-of-
>> hash structures.
>>

>
> Obviously you don't know about "0 but true"


Which, when you think of it, isn't quite as stupid as "0 and false".

//Makholm
 
Reply With Quote
 
brian d foy
Guest
Posts: n/a
 
      12-11-2008
In article
<(E-Mail Removed)>,
jps <(E-Mail Removed)> wrote:

> The single biggest STUPIDITY in Perl, IMO, is that it does not
> implement proper list-of-list, list-of-hash, hash-of-list & hash-of-
> hash structures.


I think there are a lot of candidates for "biggest", and in Perl 4 this
might have been one of them.

> I believe you could then eliminate some 99% of all references that you
> see in actual Perl-code


Well, remember that objects are references, and I bet they make up most
of the references.

> Is this, by any chance, being fixed in Perl6, btw?


Well, it probably gets worse, because now almost everything is an
object.
 
Reply With Quote
 
jps
Guest
Posts: n/a
 
      12-11-2008
On Dec 11, 8:32*pm, brian d foy <(E-Mail Removed)> wrote:
> I think there are a lot of candidates for "biggest" ...



Hi Brian!
Well -- I disagree!!
Been using Perl on and off since ca 5 years,
mostly for what it was actually designed and where it truly *SHINES*
-- i.e. "extraction and reports".
All of the other strange quirks --while many of them certainly
peculiar-- I really dont have much of a problem with.
Only this one REALLY leaves a persistent impression of two fingers in
your eyes

How so many propellerheads came to the conclusion that Perl was a good
tool for things like serving web-contents,
is certainly beyond me -- but if some genius decides to build a new
house with cuttlery, it cant be blamed on the cuttlery!


> > Is this, by any chance, being fixed in Perl6, btw?

>
> Well, it probably gets worse, because now almost everything is an object.


Well... Objects are a GOOOOD thing.
References are a BAAAAAAAAAAAAAAAAAAAD thing.
So there might still be hope
 
Reply With Quote
 
Tim Greer
Guest
Posts: n/a
 
      12-11-2008
jps wrote:

> How so many propellerheads came to the conclusion that Perl was a good
> tool for things like serving web-contents,


I still think it is. After all, embedding Perl code in the web page and
web server process (not spawning a new process and creating the
overhead of CGI -- which is CGI as the issue and not Perl) is why PHP
came about in the first place. I don't believe it's a terrible thing,
and the difference is really about what content you want it to output
and in what manner. There are templates, mod_perl and Mason and a lot
of things that put it on par for embedding and make it just as easy,
but I don't believe a CGI script is the worst plan for web content
anyway in most cases.
--
Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
and Custom Hosting. 24/7 support, 30 day guarantee, secure servers.
Industry's most experienced staff! -- Web Hosting With Muscle!
 
Reply With Quote
 
jps
Guest
Posts: n/a
 
      12-11-2008
On Dec 11, 2:25*am, "A. Sinan Unur" <(E-Mail Removed)> wrote:
> ...what is so unreadable about:
>
> #!/usr/bin/perl
>
> use strict;
> use warnings;
>
> my @x = ( [1,2], [3,4] );
>
> print $x[1][0], "\n";


Heeey! Youre CHEATING!
And the "use strict" pragma is BROKEN!!!

Mannerly Perl syntax is:
A) $x[0]->[1]
or
B) ${$x[0]}[1]

But thats not where the trouble is -- it comes when you start calling
subroutines with arrays and hashes in the parameter-list... which you
CANT!
 
Reply With Quote
 
jps
Guest
Posts: n/a
 
      12-11-2008
On Dec 11, 2:25*am, "A. Sinan Unur" <(E-Mail Removed)> wrote:
> > If -for example- you could just write
> > * *my @list = ((1,2),(3,4));
> > to get a 2x2 matrix (rather than 4-element list) I think the code
> > could be soooo much more elegant, and easier to write in a much more
> > readable fashion.

>
> First, @list is an array.


Wrong! It's BOTH. Perl cant tell the difference
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
OT: Thursday Stupidity Briscobar MCSE 11 06-30-2005 10:28 PM
in the valley of spam stupidity on spam removing nota chance Computer Support 4 08-08-2004 10:44 PM
grasping a Usenet stupidity anthonyberet Computer Support 3 05-28-2004 06:30 AM
Perl Bug or stupidity on my part? - I looked in FAQs and dejanews prior to posting Zachary Buckholz Perl Misc 11 01-17-2004 07:31 AM
FINALLY FIXED (That's to the stupidity on my part) MatGyver Cisco 0 10-29-2003 09:48 PM



Advertisments