[sf-perl] ugh another knock on perl

Kevin Frost biztos at mac.com
Fri Jan 6 15:15:00 PST 2012

I was sort of kidding, and while I think the author of that piece is far, far out of his depth, there's another side that I find interesting.

Leaving aside the question of whether Perl is cruftier than Python or Javascript is scarier than Obj-C or whatever, I believe there really is an aesthetic sensibility in favor of more expressive versus more natural-sounding computer language.

(I say "natural-sounding" on purpose; I don't think there is such a thing as "natural-looking" instructions for a computer.)

A lot of people think it's better if it sounds more like a natural language:  "repeat ten times!"  "YOU HAVE TEN SECONDS TO COMPLY!"

But a lot of other people can "speak computer" well enough to understand how limiting it is to declare it all in English, and presumably as a result of their fluency they have an aesthetic preference for a "foreach" or whatever.

For instance I think this bit of Ruby is super cool and very powerfully expressive:

(1..10).each do|n|
  puts "number #{n}"

I don't speak Ruby, but I speak "computer" well enough to quickly grasp what the |n| is about, and I like the sound of it.  It tells me a lot, and doesn't beat around the bush.  Probably everyone on this list understands that you can "do" more this way, but my point is that I think with experience you have an actual aesthetic feel for it, and it feels better.

Of course, as with natural languages, not everyone is going to agree on what feels best and why.  I'm probably not going to convince you that Hungarian sounds better than French, but to me it does.  Arguing that English codes better than code is more like saying Pig Latin sounds better than French... there might be someone for whom that is true, but would you want to have unch-lay with them?


-- f.

On Jan 6, 2012, at 11:41 PM, Philip J. Hollenback wrote:

> I agree, it's a terrible example (and several commenters on the article
> point that out).  Even though I haven't written any C in 10 years or so
> I still cringe every time I see one of those.
> On Fri, Jan 6, 2012, at 11:35 PM, Kevin Frost wrote:
>> And of course his example of Perl is this:
>>   for(int i = 0; i < 10; i++) {
>>   }
>> I can never tell whether "int" is random syntax or whether I'm speaking
>> the wrong $LANGUAGE.
>> On Jan 6, 2012, at 9:16 PM, Philip J. Hollenback wrote:
>>> That stupid study about how perl is worse than random syntax is popping
>>> up all over the place:
>>> http://www.fastcodesign.com/1665735/why-arent-computer-programming-languages-designed-better
>>> --  
>>> Philip J. Hollenback
>>> philiph at pobox.com
>>> www.hollenback.net
>>> _______________________________________________
>>> SanFrancisco-pm mailing list
>>> SanFrancisco-pm at pm.org
>>> http://mail.pm.org/mailman/listinfo/sanfrancisco-pm
> --  
> Philip J. Hollenback
> philiph at pobox.com
> www.hollenback.net

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/sanfrancisco-pm/attachments/20120107/7628af96/attachment.html>

More information about the SanFrancisco-pm mailing list