|
you have to remember it's perl programmers writing this. did you expect anything else?
|
# ? Aug 10, 2017 17:14 |
|
|
# ? Jun 5, 2024 20:49 |
|
Jewel posted:Perl 6 is a nightmare I feel like Perl would benefit from having a gatekeeper in the way of all changes who just asks "what problem does this solve".
|
# ? Aug 10, 2017 17:30 |
|
Hammerite posted:I feel like Perl would benefit from having a gatekeeper in the way of all changes who just asks "what problem does this solve". Remember that the Perl motto is "there's more than one way to do it", so the "problem" being solved in many cases would be "there's currently an insufficient number of ways to do this thing."
|
# ? Aug 10, 2017 17:57 |
|
Hammerite posted:I feel like Fixed
|
# ? Aug 10, 2017 18:09 |
|
Hammerite posted:I feel like Perl would benefit from having a gatekeeper in the way of all changes who just asks "what problem does this solve". That's about as anti-perl an idea as it's possible to be.
|
# ? Aug 10, 2017 18:29 |
|
So much forehead slapping
|
# ? Aug 10, 2017 19:17 |
|
Spatial posted:So much forehead slapping A brave new world of unicode parsing vulnerabilities. I'm honestly glad that I used php instead of perl for late 90s CGI work. As poo poo as it is it didn't train you that clever > *. Reading perl reminds me of Sendmail's turing complete configuration language code:
|
# ? Aug 10, 2017 20:55 |
|
Do people still use sendmail? Seems like time was you would hear about a sendmail vulnerability every month.
|
# ? Aug 10, 2017 21:38 |
|
Nippashish posted:I'm pretty sure Perl is entirely designed around being maximally clever. The purpose of calling ASCII operators "Texas" is so that when a Perl 6 programmer calls ASCII operators "Texas", somebody else has no choice but to ask why they call ASCII operators "Texas", which leads naturally into a delightful and exasperating conversation about Perl 6. It has nothing to do with overarching language design or consistency, it's intended to trap people for the purposes of evangelism. It's the same with any cutesy feature of Perl 5 or Perl 6. It's the most maddening way to design a programming language I've ever seen. Perl 6 Booleans have a successor method which always returns True. Perl 6 has five equality operators: eqv, ==, eq, ===, =:=. Perl 6 has a role Stringy for anything which can act like a string, Str, Uni, Blob, which apparently does nothing. It has a concept Cool which, despite being an adjective, is not a role but a class; "Cool" actually stands for "convenient object-oriented loop". Again, it is not a role, nor is it a programming construct, certainly not a loop; it's a class. "Perl 6 intentionally confuses items and single-element lists", which means that, whereas in Perl 5 any value could be used alternately as a string or a number and it was largely impossible to distinguish the two, in Perl 6 any value can be used alternately as a string, a number or a list. And a string, of course, when considered as a list, always has length 1. This is everything I know about Perl 6.
|
# ? Aug 10, 2017 21:47 |
|
Oh, almost forgot: it's not "loop", it's actually loopback. Yeah, like the network address. Intentionally.
|
# ? Aug 10, 2017 21:53 |
|
If it helps, and it won't, remember that Perl was designed by a linguist to be as expressive as a natural human language. It was Perl's first mistake.
|
# ? Aug 10, 2017 23:08 |
|
When I took Perl in college I knew things were going to take a turn for the worse when I saw the trailing if statements. Also sigils can pissssssssss
|
# ? Aug 10, 2017 23:26 |
|
Perl code:
|
# ? Aug 10, 2017 23:36 |
|
fritz posted:Do people still use sendmail? Seems like time was you would hear about a sendmail vulnerability every month. God, I hope not. There's so many better options. They just don't have the distinction of such an... interesting configuration format. E: I have a pocketknife with the sendmail logo that I got from Eric Allman at some linux conference. That'd be sometime after '98 when he formed Sendmail, inc and still had control of it. Back then, being a "swiss army knife" program was considered a good thing instead of a morass of security vulnerabilities that we look at it as now. Harik fucked around with this message at 01:11 on Aug 11, 2017 |
# ? Aug 11, 2017 00:54 |
|
Doom Mathematic posted:
Ooh, I know this one! It's because `print` evaluates its arguments in list context, and in list context `reverse` just returns its arguments but in the opposite order. Since it only has one argument, it just returns it. But if you do `$string = reverse "hello"` then reverse is being called in a scalar context, in which case it does string reversal.
|
# ? Aug 11, 2017 02:25 |
|
vOv posted:Ooh, I know this one! It's because `print` evaluates its arguments in list context, and in list context `reverse` just returns its arguments but in the opposite order. Since it only has one argument, it just returns it. But if you do `$string = reverse "hello"` then reverse is being called in a scalar context, in which case it does string reversal.
|
# ? Aug 11, 2017 03:09 |
|
vOv posted:Ooh, I know this one! It's because `print` evaluates its arguments in list context, and in list context `reverse` just returns its arguments but in the opposite order. Since it only has one argument, it just returns it. But if you do `$string = reverse "hello"` then reverse is being called in a scalar context, in which case it does string reversal. Can’t decide what’s worse: that the above is what happens, or that I correctly guessed the explanation before reading it.
|
# ? Aug 11, 2017 03:33 |
|
Is there something perl 6 is particularly well-suited for? e: other than one-liners to replace some annoying bash stuff, is there anything perl 5 is well-suited for?
|
# ? Aug 11, 2017 08:42 |
|
Job security.
|
# ? Aug 11, 2017 09:07 |
|
If you're the sort of person who wants to make a programming language, and you also like programming lots of nifty special cases and writing lots of cutesy documentation explaining them with jokes and metaphors, perl 6 is pretty fantastic. I have no idea why anyone would actually want to use it.
|
# ? Aug 11, 2017 09:09 |
|
WINNINGHARD posted:Is there something perl 6 is particularly well-suited for? Replacing sed and awk.
|
# ? Aug 11, 2017 14:42 |
|
Spatial posted:When I took Perl in college I knew things were going to take a turn for the worse when I saw the trailing if statements. Trailing if statements? I'm somewhat familiar with Perl but I'm not sure how that'd work
|
# ? Aug 11, 2017 14:54 |
|
WINNINGHARD posted:Is there something perl 6 is particularly well-suited for?
|
# ? Aug 11, 2017 14:59 |
|
Munkeymon posted:Trailing if statements? I'm somewhat familiar with Perl but I'm not sure how that'd work print "that's perl everybody" if $a==$b;
|
# ? Aug 11, 2017 15:35 |
That does seem ugly. How do you all feel about Python's trailing conditional assignment?Python code:
|
|
# ? Aug 11, 2017 15:42 |
|
Munkeymon posted:Trailing if statements? I'm somewhat familiar with Perl but I'm not sure how that'd work code:
|
# ? Aug 11, 2017 15:45 |
|
Perl also has the `unless` conditional so you can do e.g. "i++ unless i % 2". I'm kind of amused that Perl has an entire separate keyword for saying "if not", but on the other hand it does read rather prettily.
|
# ? Aug 11, 2017 15:50 |
|
Eela6 posted:That does seem ugly. How do you all feel about Python's trailing conditional assignment? It can be useful if it's not overused. I think it represents a more readable way of accomplishing the same thing as the ternary operator.
|
# ? Aug 11, 2017 15:51 |
|
PT6A posted:It can be useful if it's not overused. I think it represents a more readable way of accomplishing the same thing as the ternary operator. That's because it is Python's ternary operator.
|
# ? Aug 11, 2017 15:57 |
|
TooMuchAbstraction posted:Perl also has the `unless` conditional so you can do e.g. "i++ unless i % 2". Plus it lets you do confusing triple negatives, like this! Perl code:
|
# ? Aug 11, 2017 16:06 |
|
fritz posted:print "that's perl everybody" if $a==$b; Careful: $a and $b are reserved globals! They're used for sorting, and changing them causes sorting to break. Perl code:
|
# ? Aug 11, 2017 16:22 |
|
fritz posted:print "that's perl everybody" if $a==$b; Oh my brain shut down after the 'if' in 'trailing if statement' and I couldn't figure out how ending a whole expression in an if keyword (not whole statement) was possible in Perl syntax, but would not be surprised if it were because Perl.
|
# ? Aug 11, 2017 16:27 |
|
Ruby can do that too.
|
# ? Aug 11, 2017 16:55 |
|
Doom Mathematic posted:Plus it lets you do confusing triple negatives, like this! I go on a rampage whenever I see poo poo like this. How broke does your brain have to be to think this is okay?
|
# ? Aug 11, 2017 17:10 |
|
Is noCookies an integer containing the number of cookies, or a boolean telling you if there are cookies?
|
# ? Aug 11, 2017 17:35 |
|
Fergus Mac Roich posted:Is noCookies an integer containing the number of cookies, or a boolean telling you if there are cookies? Yes.
|
# ? Aug 11, 2017 18:04 |
|
PT6A posted:It can be useful if it's not overused. I think it represents a more readable way of accomplishing the same thing as the ternary operator. But it splits up the possible assignables and jams the condition in the middle? The ternary is a gussied up if/then/else.
|
# ? Aug 11, 2017 18:05 |
|
necrotic posted:I go on a rampage whenever I see poo poo like this. How broke does your brain have to be to think this is okay? I can tell you exactly how it happens, because I've seen it happen. It's a series of well meaning steps. First it's a simple "unless", then a bug fix changes it to an "unless not equals", then a new feature changes it to "unless not equals or else".
|
# ? Aug 11, 2017 18:11 |
|
JawnV6 posted:But it splits up the possible assignables and jams the condition in the middle? The ternary is a gussied up if/then/else. I do like the order of operations in the ternary operator better, but I hate using "?" and ":" as control flow indicators; keywords are definitely preferable. I guess Python doesn't allow "foo = if bar then baz else quux" because it doesn't read nicely?
|
# ? Aug 11, 2017 18:28 |
|
|
# ? Jun 5, 2024 20:49 |
|
lifg posted:I can tell you exactly how it happens, because I've seen it happen. It's a series of well meaning steps. First it's a simple "unless", then a bug fix changes it to an "unless not equals", then a new feature changes it to "unless not equals or else". I know how it happens, but not someone does the third change and goes "gently caress that". I've all but banned the use of unless in our code base except in basic guard conditions. Affirmatives or GTFO.
|
# ? Aug 11, 2017 18:57 |