Question about wizard Perl programmers

  • Thread starter LovesHisLittleShad
  • Start date
A

Ayaz Ahmed Khan

"De Vliegende Hollander" typed:
The sentient life form Ayaz Ahmed Khan posted the following:

But it's not nearly as powerful as Perl...

That is pretty subjective: what makes a language powerful?

--
Ayaz Ahmed Khan

Falling in love makes smoking pot all day look like the ultimate in
restraint.
-- Dave Sim, author of "Cerebus".
 
M

Mirco Wahab

Ayaz said:
"De Vliegende Hollander" typed:
The sentient life form Ayaz Ahmed Khan posted the following:
[Perl/Python]
But it's not nearly as powerful as Perl...

That is pretty subjective: what makes a language powerful?

IMHO, succinct idioms of 'accepted powerfulness'.

Furthermore, the ability of chaining idioms
into 'super idioms' and allowing for forms
one can remember with ease.

If that's what was meant: 'expressional powerfulness'.

Of the three more or less widely used 'P'-languages,
in my personal and subjective view, the one P smells
like "Windows System", the other one like "Macintosh
System", whereas the third is "Unix system".

(I use all three of them, but mostly stick to the
'unix-flavor' if possible - and don't want to throw
flames).


Regards

Mirco
 
C

Charlton Wilbur

MD> They are, and moreover contrary to what one may naively
MD> expect, golf and obfu players are generally perfectly able to
MD> write sane and readable code too, when it matters, e.g. in
MD> "production", whatever that means.

Players who are conscious of what they're doing, perhaps. I've seen a
lot of poor Perl code.

People who are fluent in natural languages and clear of thought can
use them to clearly and unambiguously express things; or they can
indulge in wordplay and puns. People who are not fluent, or careless,
can rarely do either well, and their attempts at the former are often
indistinguishable from their attempts at the latter.

It's the same way with Perl: the very best authors of obfuscated and
golf Perl can also write straightforward clear and unambiguous Perl.
Indeed, their reasonable Perl is likely to be terser and clearer than
it might otherwise be, because they understand the language deeply.
And those who aren't fluent, or don't think clearly, don't produce
very good Perl.

But blaming Perl for the inability of programmers to write clearly is
like blaming English for the circumlocutions of bureaucrats: it's
blaming the tool, not the user. The reason Perl gets this blame --
and it's just as possible to not think clearly in Java, or C++, or
Python -- is that it's one of the few languages that's so flexible in
syntax and semantics that style can become idiosyncratic, and it's
widely used by both experts and novice programmers.

(It's also, in entrenched corporate environments, a Threat to the Way
Things Are Done, which explains a lot of the FUD. But Ruby and Python
get much of that same FUD too.)

Charlton
 
P

Peter J. Holzer

It compiles and runs. Does this make Java a very difficult language? (It
simply prints "Hi!", in case you're interested.)

Not to mention widely known C stuff, from a friend of mine's .sig:

char code[] =
"\xeb\x19\x31\xc0\x31\xdb\x31\xc9\x31\xd2\xb0"
"\x04\xb3\x01\x59\xb2\x03\xcd\x80\x31\xc0\x31"
"\xdb\xb0\x01\xcd\x80\xe8\xe2\xff\xff\xffG.\n"
;

Shouldn't that be "char main[] = ..."?

hp
 
X

Xiong Changnian

I see a lot of funny stuff said but few clear answers to the original
poster.

* * *

LovesHisLittleShad said:
Is it my imagination, or is Perl a million
times harder than other languages?

No; it's much much easier to use, to get a job done, than almost any
other language. Even if you know very little about Perl, you can try to
write a simple program using it -- and have a fair chance of it working.

However, Perl is also extremely powerful and it's difficult to learn to
control that much power. That's only another way of saying that nothing
is free.

Imagine, if you will, a demon or slave who is extremely intelligent and
will do absolutely anything you ask of it. It understands your natural
language but will not do much to infer your *intent* -- what you request
is what you get, not necessarily what you desire.

* The Monkey's Paw:

The charmed paw of a monkey grants three wishes. Its new owner, without
thinking, asks for cash -- and gets it from the insurance when his son
is killed. Anguished, he wishes his son alive again -- and sees the
decaying corpse walking and talking. He uses his third wish to return
his son to the grave.

The owner of the monkey's paw was careless; he tried to use a tool of
great power without thinking clearly. More wisely, he might have used
his first wish to demand an unlimited number of additional wishes (or
extra monkey paws). He might have specified not only cash but the means
by which he wished to receive it. Asking for long life, he might ask
also for health and for the ability to end that life in case of boredom.
The paw is not to blame.

Perl provides more power at less brainpower cost than any other language
I've seen; and I've seen quite a few. Nothing can compensate for a
failure to think.

...Perl is the only one that seems greek
in most chapters, with very little explanation
of what the people are doing.

Depends on the book but, yes, I agree that there is a sort of rough
assumption in most Perl documentation that the reader has considerable
programming background. Much is taken for granted. That's a shame; I
think Perl is a good place to *begin* for the novice programmer.

I've noticed many places where a Perl feature is explained by saying
"this works the same as the corresponding shell command". That's fine if
you are familiar with *NIX shell; otherwise, you're lost.

O'Reilly's /Learning Perl/ by Schwartz and Phoenix starts off more
gently than some books but even here, I feel, you get stuffed into
things somewhere in the middle and have to find your own ground. To some
extent, I think this is just Perl culture. The assumption is that you're
better off making your own mistakes and forming your own model of how
Perl works, rather than having a model thrust upon you.

It seems as if Perl is often a reaction against the strict structures of
C and other formal languages. For about 50 years, every basic book about
programming covered the same ground in about the same way. Perl books
often seem to delight in violating these conventions. It's more fun but
it's not always more clear.

...does the Perl language literally attract
the wizards of the world to it...?

I'd have to disagree. There have always been proficient programmers who
spend their free time writing weird code. It's exactly equivalent to
puns and word games made up by fluent speakers of English. Perl does
lend itself to this kind of foolishness, though, just as Chinese
(/putonghua/) is the best natural language for making puns.

* * *

If I may venture a suggestion, dive right in. Take a small problem and
code it up. Ignore, for the most part, the advanced idioms and clever
labor-saving approaches; just write code in the most straightforward way
you know. You can write Perl that looks almost exactly like C or Pascal.

When you start to look at code examples, you'll see that Perl syntax is
extremely flexible and not all of the variations are well documented.
You might like to take some snippets and rewrite them in familiar
idioms; then take some of your own code and rewrite them using syntax
you've just learned.

Another tip is to use much more whitespace than you see in the books.
You'll often see code that throws a lot of punctuation marks together,
usually with many braces. Sort this stuff out, balance the braces in
your own mind, and meaning may emerge.

I'm only just learning Perl myself and I've already done a lot with it.
I often find that when I'm frustrated, it's not because Perl is making
me do something weird -- it's that I *think* I have to do something
weird or strained because that's what I've learned in other languages.
But Perl lets me do things the easy way -- if only I try.

Good luck!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top