4 ms·
As someone who actually glares at Perl quite frequently can I gently request you take that slight back. Or at least qualify it to be "perl regex". Unless youve
by Ultimatt 8y ago
As someone who actually glares at Perl quite frequently can I gently request you take that slight back. Or at least qualify it to be "perl regex". Unless youve used Perl 6 (a different language) and not found it readable youd do well to say Perl 5 too. Or perhaps you've never used either language but use it as a defacto meme to make a point?
The bigger argument is not readability but where the abstraction lies. From the examples I cant see much sugar beyond what an ORM often provides.
- carlmr 8y ago>can I gently request you take that slight back. Or at least qualify it to be "perl regex". Regex has the same complexity in any language, that can't be a valid reason to denigrate Perl. My biggest issue with Perl is that functions don't even have proper parameters and you need somewhat cryptic syntax to work with arrays, scalars and dictionaries.
- yellowapple 8y agoDefine "proper parameters". Perl subroutines are delightfully flexible in that regard compared to most other languages, and they also happen to be closer to your machine's reality (x86 doesn't care about what's in your stack when you JMP). With the Perl approach, you have the tools to implement multiple dispatch, variable numbers of arguments, etc. rather easily and elegantly. Yeah, it looks weird from the outside, but once you're used to it you start to want it in other languages. That's one example of what makes Perl a great teaching tool for general programming: it doesn't hide the mechanics of function/method calls behind the language, but instead shows it off to you and encourages you to explore and experiment.
- carlmr 8y agoI don't want a great teaching tool, I can use ASM for that. I want something that's easy to read and maintain. I think Perl 6 got it right, but a little too late.
- b2gills 8y agoPeople keep saying that Perl 6 is too late, but they don't say that about other new languages. I mean nobody says the same about Julia, which has been in development for the better part of a decade. The only way it could be too late is if it doesn't do anything better than a single other language. By that I mean if there is a language that does everything that Perl 6 does, and does it just as well. Even if all it does is bring a collection of useful features that haven't already been collected together into a single language, then it isn't too late. It could also create a new design of an existing feature that goes on to influence the design in future languages. That would also make it so that it isn't too late. (I think that in the future we may be able say that about Perl 6 grammars.) I think the real reason people keep saying that about Perl 6 is that they want it to be true. We can only really make that determination years from now when we have perspective.
- petre 8y agoIt does have subroutine signatures since 5.20. And there's autobox.
- carlmr 8y agoOk, I didn't know that, haven't used Perl in a long time. But I don't think any of my Perl programming colleagues have heard of it or like using it. I still think their code is harder to read because of this ingrained bad practice.
- petre 8y agoI write Perl5 every work day and find Perl6 less readable due to double symbols and increased symbol madness. Like the new ternary operator, which is probably much more visible but looks just crazy. Or private/public variables. In some respects it's worse than Perl5, in others it's exponentially more powerful. It's like giving you the equivalent of a swiss army knife for each and every tool inside your toolbox. https://docs.perl6.org/type/Signature#index-entry-Type_Capture_%28signature%29 https://docs.perl6.org/type/Signature#index-entry-Type_Captu... That said, I am more tempted to try Ruby, Crystal and Dlang for a new project, rather than Perl6. The latter looks like it was designed by a mad scientist on LSD.
- lizmat 8y ago> less readable due to double symbols Double symbols? What do you mean by that? > increased symbol madness Could you elaborate what you mean by that? > It's like giving you the equivalent of a swiss army knife for each and every tool inside your toolbox. Please note that the link you've given, is about being able to restrict calling a subroutine by making sure that the first 2 parameters are of the same type (regardless of which type). Generally one knows which types to expect. And even so, typechecking is an optional thing in Perl 6 (hence the term "gradual typechecking". > The latter looks like it was designed by a mad scientist on LSD. I think that's uncalled for. But that's your opinion. The same mad scientist who gave you Perl 5, by that reasoning, by the way.
- petre 8y agoI mean $.x and $!x or such craziness: submethod BUILD(:&!callback, :@!dependencies) { } https://docs.perl6.org/language/015-classtut#Private_Methods https://docs.perl6.org/language/015-classtut#Private_Methods or the quite useful Z=> operator. my %hash = @keys Z=> @values; or the Bat range operators: (1^..^5).list; # (2 3 4) I know. It was meant as a Perl6 example chosen at random. It looks as something taken out of the Discworld novels: https://en.wikipedia.org/wiki/Unseen_University#Octavo https://en.wikipedia.org/wiki/Unseen_University#Octavo
- 8y ago