7 ms·
Where Perl overdid on hackery, Python may have overdone on sugar Haven't used Perl often, but that's sort of my impression as well. And that Python sugar feels
by stinos 6y ago
Where Perl overdid on hackery, Python may have overdone on sugar
Haven't used Perl often, but that's sort of my impression as well. And that Python sugar feels mostly pretty well reasoned about. And fairly usable and readable as well. Whereas in Perl I sometimes had the impression a bunch of people with CS degrees made something they thought out while on LSD and just decided to add it. Cool at the moment, but not too usable by sober minds afterwards.
- kqr 6y agoAs you probably know, contrary to almost every other language out there, Perl was not designed by people with CS degrees adding things that sound cool. Perl was designed by a linguist along the principles of "what would English look like if it was a programming language?" Not in the superficial syntactic sense, but the underlying grammar. What is the implicit "it"? What can we derive from context and decision so we don't have to spell it out? And so on. This makes it very convenient to express common things in different ways (just like English, there is no one true way to say something) but it also creates some peculiar constructs that make sense but you'd go "who says this?" (again, much like in English.)
- DonHopkins 6y agoOk, then if not actually designed under the influence of LSD, then certainly under the influence of religious fanaticism. The tired old "Perl was designed by a linguist" cliché is endlessly Parroted (pardon the pun!), but doesn't actually necessitate or imply good programming language design. But look at the actual factual source of that folklore -- it would be more accurate to say "Perl was designed by a wanna-be missionary", and that certainly shows ("Exegesis", "Apocalypse", "bless", etc): https://en.wikipedia.org/wiki/Larry_Wall https://en.wikipedia.org/wiki/Larry_Wall >While in graduate school at the University of California, Berkeley, Wall and his wife were studying linguistics with the intention of finding an unwritten language, perhaps in Africa, and creating a writing system for it. They would then use this new writing system to translate various texts into the language, among them the Bible. Due to health reasons these plans were cancelled, and they remained in the United States, where Wall instead joined the NASA Jet Propulsion Laboratory after he finished graduate school. Wall is an active member of the New Life, Church of the Nazarene. Going on a missionary expedition in Africa to invent and teach illiterate people of color a written language to read the Bible in certainly sounds to me more like religious and linguistic imperialism than a sound motivation for programming language design. https://en.wikipedia.org/wiki/Linguistic_imperialism https://en.wikipedia.org/wiki/Linguistic_imperialism >Linguistic imperialism or language imperialism is occasionally defined as "the transfer of a dominant language to other people". This language "transfer" (or rather unilateral imposition) comes about because of imperialism. The transfer is considered to be a sign of power; traditionally military power but also, in the modern world, economic power. Aspects of the dominant culture are usually transferred along with the language. Translating CS literary classics like the "Pascal Users Manual and Report" and Anders Hejlsberg's "Turbo Pascal Reference Manual", or even textbooks about sustainable farming techniques, nutrition, medicine, sex ed, and birth control, into their invented written language would do more economic and life sustaining good for those poor Africans than translating the Bible. kqr> "people with CS degrees adding things that sound cool" People with CS degrees add cool things that are sound, not things that sound cool. Do you really believe that programming languages should be intentionally designed to be MORE like religions, MORE imperialistic, MORE evangelical, instead of less? Compare Larry Wall's contributions to this otherwise deep fascinating conversation about language design, versus the contributions of less religiously motivated, more scientifically trained programming language creators with CS degrees, like Guido van Rossum, James Gosling, and Anders Hejlsberg: A Language Creators' Conversation: Guido van Rossum, James Gosling, Larry Wall & Anders Hejlsberg https://news.ycombinator.com/item?id=19568378 https://news.ycombinator.com/item?id=19568378 https://www.youtube.com/watch?v=csL8DLXGNlU&t=49m41s https://www.youtube.com/watch?v=csL8DLXGNlU&t=49m41s James was literally taken aback by Larry's macho IDE shaming: https://news.ycombinator.com/item?id=19568381 https://news.ycombinator.com/item?id=19568381 "I think IDEs make language developers lazy." -Larry Wall "IDEs let me get a lot more done a lot faster. I mean I'm not -- I -- I -- I -- I -- I'm really not into proving my manhood. I'm into getting things done." -James Gosling
- emodendroket 6y agoI think this is a silly line of inquiry at best, but if one were to attempt to take it seriously, surely “there is precisely one way to do it” is an approach that would better fit the “imperialist” frame than Perl’s actual approach.
- DonHopkins 6y agoWhich Imperialistic Programming Language dictates that "there is precisely one way to do it"? Not Python -- it has Zen-like practical suggestions about what matters, instead of ideological doctrine about how to do it: https://www.python.org/dev/peps/pep-0020/ https://www.python.org/dev/peps/pep-0020/ >There should be one-- and preferably only one --obvious way to do it. >Although that way may not be obvious at first unless you're Dutch. Does The Zen of Python really sound "imperialistic" to you? The Zen of Python Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better than complicated. Flat is better than nested. Sparse is better than dense. Readability counts. Special cases aren't special enough to break the rules. Although practicality beats purity. Errors should never pass silently. Unless explicitly silenced. In the face of ambiguity, refuse the temptation to guess. There should be one-- and preferably only one --obvious way to do it. Although that way may not be obvious at first unless you're Dutch. Now is better than never. Although never is often better than *right* now. If the implementation is hard to explain, it's a bad idea. If the implementation is easy to explain, it may be a good idea. Namespaces are one honking great idea -- let's do more of those!
- emodendroket 6y agoNot exactly but I think the idea that Perl (or for that matter Christianity) is imperialistic is itself absurd, so that doesn’t seem like an answer. Anyway, the closest I’ve experienced is Go, to answer your question.
- DonHopkins 6y ago
- twic 6y ago> This makes it very convenient to express common things in different ways This story has been told for decades, but it just isn't true. What is particularly convenient to express in Perl? The only thing i can think of is the implicit use of $_. Everything else is no better than or worse than in a more conventional language.
- wahern 6y agoThere are a ton of hacks in the Perl parser and interpreter that use context to support otherwise irregular syntax. For example, autovivification: https://en.wikipedia.org/wiki/Autovivification https://en.wikipedia.org/wiki/Autovivification DWIM is the goal behind TMTOWTDI. Things like sigil's are useful in this regard because they provide hints that allow extending the language w/ irregular syntax, like with autovivification. Perl wasn't designed; it slowly accreted features as use cases emerged, moderated by implementation constraints, and that was intentional. Python code today is nowhere near as simple as 20 years ago. Python, Java, and similarly aged languages are ending up w/ a cornucopia of mismatched language syntax and semantics much like Perl, except Perl was never blind to the inevitable. Lua is one of the few exceptions, but that's because Lua has gone through a couple top-down redesigns in addition to its more regular backward compatibility breaks.
- cutler 6y agoIt also means you have to grok the language to reap the benefits. Perl is often judged harshly by those who prioritise ease of use for beginners over linguistic elegance and usefulness. Can you imagine going to China and complaining that Mandarin and Cantonese suck because they're not beginner-friendly or that medicine is a pointless practice because it involves learning many complex terms? I've never understood the "Python for readability" mantra.
- joe_the_user 6y agoI think Larry Wall's theory of language development is interesting and the long term failure of Perl shows interesting ways in which computer language development and natural language development are rather different. 1) Natural language doesn't have to worry about backward compatibility in the same way. The exact meaning of older phrases don't have to coexist with those of new phrases. 2) Natural language doesn't have to recruit new users in the same way. I think Spanish is one of the easiest commonly spoken languages - if a random person speaking no commonly-spoken-in-the-world language had to choose languages, Spanish would be ideal. English is weird in saying things with idioms, Chinese has tones and complex characters, etc. English has evolved in a perl-like fashion and if it was a programming 3) No children learn perl or any programming language as their "first language". Everyone learning perl had to wade through it's modes and variable names like "_" and translate them to their internal concept language. (should add: verbs like "be", "do", "have" etc are very fuzzy in English as well as proposition "like" "to", "from", at etc but this fuzziness is incorporated as a person learns the language. But adding an equivalent weirdness to a language someone is just learning isn't necessarily going to be appreciated). 4) Communicating with other humans is arguably a key function of computer languages as well as natural languages. But computer language do also have to communicate exact to descriptions to the very dumb devices known as computers. So "getting the gist" and "getting it exactly" have to be somewhat close and makes "there's more than one way to do things" more problematic, especially as ways to do things multiply.
- DonHopkins 6y agoHey, HyperCard was designed under the influence of LSD, and it came out pretty good! https://news.ycombinator.com/item?id=24083738 https://news.ycombinator.com/item?id=24083738 https://www.mondo2000.com/2018/06/18/the-inspiration-for-hypercard/ https://www.mondo2000.com/2018/06/18/the-inspiration-for-hyp... "In 1985 I swallowed a tiny fleck of gelatin containing a medium dose of LSD, and I spent most of the night sitting on a concrete park bench outside my home in Los Gatos, California." -Bill Atkinson