Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: thoughts on perl language

by tobyink (Canon)
on Nov 09, 2012 at 10:36 UTC ( [id://1003097]=note: print w/replies, xml ) Need Help??


in reply to thoughts on perl language

I think it's interesting you compare Perl to English and say that both are beautiful. Many people would say they are each rather ugly. English is inconsistent. Most languages have a few irregular verbs; English is jam-packed with them. And idioms that make almost no sense when read literally are employed liberally. (Who packs a language with jam after all?)

Robert Pirzig (my favourite modern philosopher), in Zen and the Art of Motorcycle Maintenance speaks of a Romantic/Classical divide with regards to the perception of Quality. An example he gives is using a small circle of tin cut from a beer can as a shim when repairing a friend's motorcycle. His friend, considering the surface appearance of the shim, is aghast that Pirzig is using an old piece of rubbish to repair an expensive piece of engineering. Pirzig on the other hand looks at the underlying form of the shim; its weight, thickness, strength, and considers it an elegant solution.

To me, it seems both English and Perl are low quality languages when viewed from the Romantic angle, and only their surface appearance is considered, but high quality languages from the Classical angle, when their underlying form is taken into account.

Perl features like prototypes, import subs, globs, compile-time code execution, stack inspection and so forth, combine to create a language which is internally extensible. You can effectively define new Perl syntax from within Perl. (English also tends to be very tolerant of extendawording.) These features, if wielded with experience can combine to produce very elegant and concise code.

So yes, from an insider's point of view, Perl can be a very elegant way to get the job done. But we should also understand why outsiders, looking at only the surface appearance of Perl code, often consider it to be ugly.

perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'

Replies are listed 'Best First'.
Re^2: thoughts on perl language
by MidLifeXis (Monsignor) on Nov 09, 2012 at 13:39 UTC

    "English also tends to be very tolerant of extendawording."

    ++ for the embedded example :-)

    --MidLifeXis

Re^2: thoughts on perl language
by Jenda (Abbot) on Nov 10, 2012 at 10:49 UTC

    Beg your pardon? English jam-packed with irregular verbs? With what language did you compare it??? Some 370 irregular verbs with three forms to a verb?

    English has a messed up spelling due to its history, other than that it's brain-dead regular.

    Jenda
    Enoch was right!
    Enjoy the last years of Rome.

      I'm not entirely sure where you get the number 370 from. This website claims to have a list of 620 available to its subscribers, and I imagine that even that it not exhaustive.

      It's not about sheer numbers though. Most verbs are regular, obviously. However many of the irregular verbs also happen to be very commonly used. Take a look at this list. It's the 10 most common verbs in the English language:

      1. be
      2. have
      3. do
      4. say
      5. get
      6. make
      7. go
      8. know
      9. take
      10. see

      How many are irregular? How about all of them! Only 7 of the top 25 English verbs are regular.

      Compare that to, say, German, which happens to be one of English's closest neighbours linguistically. In German there's only one truly irregular verb, sein (to be). Other than that, all verbs fall into two categories, strong and weak, which each have their own (different, but predictable) conjugation rules. Of the top ten German verbs, one is irregular, eight are strong, and one is weak.

      Three forms to a verb? Regular ones have four (look, looks, looking, looked). Irregular ones have X forms, where X is a number perhaps less, perhaps more, or perhaps equal to four.

      There are plenty of weird things in English other than spelling. How about...

      • The verb "to dust" can mean to add dust to a surface, but also to remove dust from a surface.

      • Irregular plurals: mouse/mice, goose/geese, man/men, etc. The plural form of "sheep" is "sheep".

      • For that matter, why on earth is there no singular for the word "cattle". They're a common enough animal, and it clearly makes sense to be able to talk about them in the singular. So why do we just have this plural word "cattle"?

        There is of course "cow", but that refers exclusively to females. "Bull" refers to males, and "calf" (another irregular plural by the way, calves) to the young. There is no English word to refer to a single individual Bos primigenius without committing to its sex or age.

      • Given the two phrases "a cute little puppy" versus "a little cute puppy"; almost all native English speakers would agree that the second one sounds wrong. Virtually none of them could tell you why. :-)

        Similarly, "a nice warm bath"/"a warm nice bath"; "a red Japanese car"/"a Japanese red car"; "an old woollen scarf"/"a woollen old scarf". In each case the first is right, the second is wrong.

      • Bags of synonyms. If you know what the word "moon" means, that doesn't help you if you hear the phrase "lunar cycles".

        The main reason we have so many synonyms in English is that the language is a cut and shut combination of Low German and Norse French. So we ended up with one word inherited from German ("need") and one from French ("require") meaning exactly the same thing. We also ended up with a lot of (mostly technical) words derived directly from Latin without the French intermediary, and then to make matters worse the bloody Vikings gave us a whole bunch of other words we neither needed nor required.

        (This also explains why nobody wins the human race. English has two words spelt "race" which are pronounced exactly the same. "Race" meaning ethnicity or population comes from French; "race" meaning a speed contest comes from Norse.)

      • And I don't want to bang on about them but... the idioms. Perhaps you and I don't see eye to eye on this, but as far as deciphering the meaning of a sentence goes, even if you know the definitions of the individual words, it's not a done deal.

        On the other hand, perhaps I can see your point? After all, people learning English as a second language do seem to pick up the meaning of idioms as soon as they run into them. Maybe it's a piece of cake?!

      perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'

        It's mostly the common verbs that are irregular ... they are being used often and thus have a chance to become and stay irregular.

        OK. So maybe there's more commonly used irregular verbs than in one specific language, what about the rest? Let's have a quick look at Czech. An ordinary verb has 6 forms just for the present (1st-3rd person x singular/plural). For conjugation verbs are separated into five groups, with 16 different patterns in total and we haven't yet leave the realm of verbs that could have been somehow fitted into a group. See the intro for yourself here.

        Nouns and pronouns are a similar mess. 14 forms to a word, 6 patterns for masculinum, 4 for feminimum, 4 for neutrum with the word gender assigned ad hoc and loads of irregular words etc.

        • Irregular plurals? Nouns have 14 forms in Czech, loads of them irregular plus there's a group of nouns that only have the plural forms even if you only use them for a single item. Some of them as in English (nůžky-scissors), some not (dveře-door).
        • Ehm ... cattle is "dobytek" and guess what, it has no real singular either. Cow is kráva, bull is býk, ox is vůl, calf is tele and there is no Czech word to refer to a single individual Bos primigenius without committing to its sex or age.
        • Let's see ... the sentence "I was there" .. in Czech it can be "Byl jsem tam.", "Tam jsem byl.", "Tam jsem byl já", "Já jsem tam byl.", "Já jsem byl tam." or even "Byl jsem tam já." with very slighly different meanings (you may be stressing the "I", the "was" or the "there" and you would use different orders as a response to different questions with the other orders being wrong. And the only reason people could give you would be "because they feel wrong".
        • We've got words of Slavic origin, German origin, Latin and Greek.
        • Idioms are nothing special. They exist in all languages. The difference between the English and Czech ones is that English often uses prepositions and Czech prefixes. Let's see "dělat" is "to do", dodělat = finish, oddělat = kill, remove, předělat = rework, obdělat = cultivate, zadělat = knead, cover, mess up, foul, podělat = botch up, fuck up, shit all over, přidělat - attach, faste, fix, make some more, nadělat = make a lot of sth (nadělat dluhy → run up debts
          (na)dělat si nepřátele → make enemies
          nadělat spoušť → wreak havoc, leave a scene of devastation
          nadělat kde paseku → play hell with sth , wreak havoc swh
          nadělat víc škody než užitku → do more harm than good, be more trouble than worth
          ) ... (See here)

        Compared to other cakes, English is not exceptionally complicated.

        Jenda
        Enoch was right!
        Enjoy the last years of Rome.

        You're oversimplifying German grammar.

        In antiquity strong verbs used to follow 7 regular schemes, now they diffused in over 180 subgroups, with many groups only consisting of only one verb.

        So if you say those are mostly regular then English verbs are regular too, since they are the cognates of those strong verbs and in most cases you can apply the same "rules":

        German: Ich singe, ich sang, ich habe gesungen English: I sing, I sang, I have sung

        After trying to learn some languages I can tell you that non had a regular verb system. Just try to cope with Russian (or Slavic) aspects.

        And in English you don't have to bother with many suffixes for different persons, 3rd person singular has an s, that's it.

        Most English speakers don't even know what a subjunctive form is ("If I were you!"), while you have to learn and apply 4 subjunctive forms in Spanish.

        OTOH you're right that English is very heterogeneous, mostly because Norman French was for centuries the language of the upper class, which resulted into an amalgamated creole language with a totally confusing orthography.

        German profits from the fact that over centuries many scholars - and most prominently Martin Luther - tried to translate foreign (mainly Latin, Greek and French) constructs into corresponding German constructs to make them understandable for simple people, especially the language in the mass!

        Dia/rrhea Greek "flowing through" Durch/fall German "falling through" grand-père French "Big Father" Groß/vater German "Big Father" flood light English Flut/licht German

        So many German terms are more easily understandable by analyzing the parts.

        And standardization of German - especially of orthography and pronunciation - happened for political and historical reasons very late in the 1880s and was always driven by compromising between the dialects in different autonomous regions to find a common base for a highly decentralized culture sphere.

        Standard English OTOH was dictated by the slang of the cliques from Oxford and Cambridge and reflects a pronunciation as it was centuries ago in London's centralized realm. (with exception of the differing English of Scottish parliament)

        So yes English has problems, but certainly not the verb system. =)

        Cheers Rolf

        • The verb "to dust" can mean to add dust to a surface, but also to remove dust from a surface.

        Or, one of my personal favorites, the word "ravel", which (often) means the same thing as "unravel" 8-}

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1003097]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (9)
As of 2024-04-16 08:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found