4 ms·
Lazy, functional, and pretty: I had no idea Perl could be this nice! (Actually, I know next to zero Perl, but that's not the point…)
by saagarjha 7y ago
Lazy, functional, and pretty: I had no idea Perl could be this nice! (Actually, I know next to zero Perl, but that's not the point…)
- collyw 7y agoPerl gets a bad rep, but a decent programmer should be able to write readable Perl.
- majewsky 7y ago> readable Perl I worked with Perl 5 intensively for three years and know the language in and out. These Perl 6 snippets there are mostly foreign to me. It's like how a non-Perler looks at Perl 5: mostly a mess of unexpected symbols with some recognizable keywords inbetween.
- mhd 7y agoIt's a bit like if a C programmer looks at a Schwartzian transform.
- lmm 7y agoA good programmer will write readable code in any language, and a bad code will write unreadable code in any language. But most programmers are somewhere in the middle, and so whether mediocre programmers end up writing readable code ends up being what's important.
- reallydude 7y ago> A good programmer will write readable code in any language, That's a fantasy, pure and simple. Taking the statement on its face, let us ignore the undefined boundaries of "good" or "readable" and focus on the practical issue. Have you seen Brainfuck or Whitespace? Many languages are less readable than others, be it incidentally or by design. People are imperfect beings and for whatever "good" means, a "good" or "bad" programmer will write code that is against their assessed skill at times.
- npongratz 7y agoI found Modern Perl [0] to be an absolutely brilliant exposition of readable Perl 5 and how great Perl can be. I'll be forever grateful to chromatic for writing and revising the book! [0] http://modernperlbooks.com/ http://modernperlbooks.com/
- Grinnz 7y agoAlso, Raku is a different language with a very different design, so Perl's bad rep ideally wouldn't apply.
- agumonkey 7y agoperl6 seems ultra versatile, near lisp levels and can thus be molded into concise lazy functional
- mhd 7y agoDuring the development of Perl 6, Haskell and similar languages weren't ignored. If I recall correctly, the first actual interpreter was written in Haskell (by Audrey Tang). The way I see it, Perl initially (up to version 4) was mostly about compositing various Unix tools and sub-languages (sed, awk, (k|c)*sh) -- and believe me, back in those days that was really needed, as every Unix version out there did it another way. With Perl 5, some "programming in the large" concepts were added, although it was decided that no definite OO style was needed due to the malleability of the language (if you haven't had a look at Perl5 since CGI days, take a look at the Moose ecosystem these days). And Perl6 branched out into more "esoteric" topics, which included functional programming. I really need to take a better look at it and it's great that it's now stable enough that writing interesting articles about it doesn't mean that you can't run the code a week later (or that it's horribly slow). And Damian Conway is always worth a look. Can't wait for 'Perl6 Best Practices'…
- JadeNB 7y ago> If I recall correctly, the first actual interpreter was written in Haskell (by Audrey Tang). Yup! https://en.wikipedia.org/wiki/Pugs_(programming) https://en.wikipedia.org/wiki/Pugs_(programming)