6 ms·
My personal issue with Perl is how much of a mess the syntax is (10 different ways of doing the same thing), and the lack of a standard library (CPAN is not a v
by Rjevski 9y ago
My personal issue with Perl is how much of a mess the syntax is (10 different ways of doing the same thing), and the lack of a standard library (CPAN is not a viable replacement).
- IslaDeEncanta 9y agoWhy is CPAN not a viable replacement? It has always been perfectly viable for me.
- Rjevski 9y agoCPAN packages are written by thousands of different people with varying styles (cf. the issue with 10 different ways of doing the same thing), quality standards and maintenance schedules. In Python I can expect the standard library to be consistent and be maintained as part of the core language. Now I don't mean that everything has to be in the standard library (I'm fine with the database access libraries being third-party for example), but in Perl even the most basic stuff like exceptions is only on CPAN and there are again multiple packages to choose from..
- b2gills 9y agoUnfortunately for Python is that many/most of the modules that are included were written when the language was fairly new, so at a time when nobody was an expert in the language. Which means that perhaps for many of them there is a better module out in the ecosystem that almost nobody uses because they have one extra step to install them. If you want something close to that in Perl 6, just install Inline::Python and you can use all of those “batteries included” with Python as if they were modules written in Perl 6. Exceptions in Perl 6 are much easier to deal with than they are in Perl 5.
- yellowapple 9y agoI'll take 10 different ways to do the same thing with different approaches over one "true" way with no flexibility any day. Perl gives the programmer a lot of rope to work with. Whether one ties that rope into a drawbridge or a noose is the programmer's choice. Also, CPAN is fantastic and widely supported. I really wish more languages would follow its example, especially when it comes to package namespaces.
- bloobloobloo 9y ago> 10 different ways of doing the same thing Mostly an urban myth. Where it isn't, at least 8 of those ways are actually important. Exercise: write a python program that prints Python's quoting documentation, without external files, without editing the documentation. Spoiler alert: it's impossible.
- gjm11 9y agoI'm not sure I understand your exercise. What do you mean by "Python's quoting documentation", and what do you mean by "editing" it?
- yorwba 9y agoI was wondering about that, too. Unless `"Python's quoting documentation"` is an easter-egg in "help()" that recursively contains a quoted version of itself, it should be possible to just escape all problematic characters. But maybe that counts as `"editing"`? Not sure.
- bloobloobloo 9y ago> maybe that counts as `"editing"` how would it not
- bloobloobloo 9y ago> What do you mean by "Python's quoting documentation" String literals are described by the following lexical definitions: stringliteral: shortstring | longstring shortstring: "'" shortstringitem* "'" | '"' shortstringitem* '"' longstring: "'''" longstringitem* "'''" | '"""' longstringitem* '"""' shortstringitem: shortstringchar | escapeseq longstringitem: longstringchar | escapeseq shortstringchar: <any ASCII character except "\" or newline or the quote> longstringchar: <any ASCII character except "\"> escapeseq: "\" <any ASCII character> You can't paste that text into a file and write a Python program around it that outputs the same text. You need to encode the quote characters. More generally, there is no way in (many languages including) Python to treat an arbitrary (yet known) block of data as data.