8 ms·
Because of the frequency I see undecipherable strings like this in actual Perl code, I don't like Perl the programming language. However, I love Perl the projec
by et2o 8y ago
Because of the frequency I see undecipherable strings like this in actual Perl code, I don't like Perl the programming language. However, I love Perl the project. Take a look at the config file for Perl and how many systems and architectures it accommodates: https://github.com/Perl/perl5/blob/blead/Configure https://github.com/Perl/perl5/blob/blead/Configure
It's clearly such an incredible labor of love by Larry Wall et al. that I'm sad for them it isn't more popular. Just a mammoth amount of work by nice, passionate people.
In my world (bioinformatics), it was initially the go-to language. Even today I very occasionally run across something using BioPerl, requiring me to stumble through CPAN again. I get pretty nostalgic thinking about it.
- orev 8y agoPerl gives you as much rope as you want to hang yourself. If you can develop a style, and try to avoid being too clever, it can be just as readable as any other language.
- TimTheTinker 8y agoThe best languages sacrifice readability the least for a given amount of cleverness.
- noja 8y agoExactly. Like BASIC.
- TimTheTinker 8y agoI'd argue that use of clever or advanced patterns in BASIC actually renders the code rather opaque. I.e. compare coroutine usage between BASIC and ruby (if you're even able to get it working in BASIC).
- 4thaccount 8y agoOr the best give you all the flexibility you could ever need and allow you the freedom to write readable and maintainable code or use all the features to write an insanely terse oneliner that can do the job quickly and be thrown out.
- tech2 8y agoExcept, of course, they are rarely thrown out :)
- rkeene2 8y agoYou just described Tcl. :-)
- ndnxhs 8y agoAnd then someone else tries to read your code. One of the things I love about ruby dev is its not about providing 10000 ways to do the same thing but about making sure that given a simple problem, every developer will solve it in pretty much the same way.
- kiaulen 8y agoWhat? With ruby, there are at least 4 ways to find out how big something is (.size, .length, et al). You want to loop over something? You can use python style for in loops, .each, and several other ways. Your block could be a block, or it could be a symbol with an & in front. Want a bit of code without a name? You have blocks, procs, and lambda. Want a string? You have string and symbol, and ne'er the two shall cross paths. Ruby is specifically designed as a replacement for perl, and keeps a lot of the same warts ($igils, and globals like $?, $1, etc). While I agree it's better than perl for readability, it's not because there's only one way to do any given thing.
- horsawlarway 8y agoAre you crazy? I explicitly dislike ruby because I feel it encourages everyone to make their own DSL like bullshit wrappers everywhere - Leading to a million and a half ways to do anything and everything. While I don't use it often, I feel like GoLang at least vaguely tried to adopt a "single solution" approach to language design. They keep the standard library as compact as possible, and formatting is non-optional with gofmt.
- collyw 8y agoI have had to maintain absolute crap in Python and beautifully written Perl. 90% of it is down to the developer.
- ktpsns 8y agoWhile some people tend to say Perl was chosen by the young bioinformatics community because of it's excel in text processing, I think Perl was just the go-to scripting language in the late 90s. In my field (numerical relativity), Perl was also the go-to language in the early days. People then moved on to Python because of the numpy/scipy ecosystem which allowed to combine Perl-like scripts with Matlab/Fortran like post processing. Today, everything is Python. Python2 :-P
- dalke 8y agoPerl was being used in bioinformatics in the early 1990s - definitely before the "late 90s". Perl was becoming the go-to language in Unix fields in early 1990s, and bioinformatics comes out of that Unix tradition. (See also my comment at https://news.ycombinator.com/item?id=11381917 https://news.ycombinator.com/item?id=11381917 .) There's no reason to guess which factors contributed to Perl's uptake in the young bioinformatics community. Text processing is only one of six reasons Lincoln Stein listed in 1996 in "How Perl Saved the Human Genome Project". See https://web.stanford.edu/class/gene211/handouts/How_Perl_HGP.html https://web.stanford.edu/class/gene211/handouts/How_Perl_HGP...
- collyw 8y agoI switched to Python in 2011 (basically because Django was a lot easier to get into as web framework, better docs and because too many ways to do things made Catalyst confusing for a beginner). Perl was starting to loose ground by then, but was still pretty popular. My guess is around a third of bioinformaticans were using it as the goto language at that point. Its a pity, I miss Perl and still pull it out for quick scripts that involve manipulating the filesystem as its got so much better syntactic sugar for that sort of thing. And using regexes in Python is such a chore in comparison. I always need to look up the docs, whereas I remember how to use them in Perl despite hardly using the language in 8 years
- dalke 8y agoYou might enjoy, in a "never try this in practice" sort of way, some code I did to make a working Python variant, which compiled to Python byte code, and supported Perl-like pattern match syntax, like: # get_function_names.py for line in open("python_yacc.py"): if line =~ m/def (?P<name>\w+) *(?P<args>\(.*\)) *:/: print repr($1), repr($args) See http://dalkescientific.com/Python/python4ply-tutorial.html http://dalkescientific.com/Python/python4ply-tutorial.html . It got appreciative hisses when I did a lightning talk about it at a PyCon. FWIW, I co-founded Biopython back in 1999.
- scruple 8y ago> Take a look at the config file for Perl and how many systems and architectures it accommodates: https://github.com/Perl/perl5/blob/blead/Configure https://github.com/Perl/perl5/blob/blead/Configure 25249 lines (23725 sloc) Good grief. This is incredible. Thanks for sharing that.
- et2o 8y agoLots of the comments are really funny.
- sitkack 8y agoLarry Wall is a wonderful human.
- GuB-42 8y ago> It's clearly such an incredible labor of love by Larry Wall et al. that I'm sad for them it isn't more popular. Just a mammoth amount of work by nice, passionate people. That would even more fittingly describe Perl 6. For some reason, there seems to be a complete lack of toxic behavior in the Perl community (both 5 and 6).