New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What is a trap and what isn't? #1523
Comments
|
Here's a list that we can use to mark (✓) things that should stay: Variables and Constants
Objects
Whitespace
Captures
Cool tricks
Arrays
Strings
Operators
Regexes
Common Precedence Mistakes
Subroutine and method calls
Input and Output
Exception Handling
Using Shortcuts
Scope
|
|
Note that there may be other reasons we can call something a trap. Think wisely before removing stuff to resolve this ticket. When it doubt, leave the text in. If it saves somebody, great! If not, well, maybe people will learn something interesting when they read it. |
|
I think we should move instead of removing them, to a tricks page. |
|
Also using the term "gotcha" might be useful |
|
Or maybe call it “Perl 6 Pitfalls” analogously to BashPitfalls. |
|
This reminds me of Chapter 24, "Common Practices", of Programming Perl, 3rd Ed. There's a "Frequently Ignored Advice" section there that outlines several traps, as well as other traps brought on when moving from C, Shell, and previous Perls. |
|
I thought the traps were supposed to be "if you came from another language and expected FOO, sorry it's not quite like that". I always expected the traps would eventually actually be tied to the language it's a trap for, and this information would be moved to the lang-to-perl6 specific pages. |
|
How about splitting the document in two? One for traps. The things with the edge cases that nobody thinks about. Lieing in wait for the moment that they can do the maximum possible damage, secretly praying to Murphy, God of Breakage, that it will be Remote Code Execution As Root. One for surprises. Things that work differently than expected, but in a clearly visible fashion, and you instantly get unexpected behaviour. One-time surprises if you will: You learn to avoid them by falling to them, once. |
|
OK, after coming back to this after a while… I think that anything that results in a compile-time error with a helpful error message is not a trap. For example, In other words, all items that are current not marked with ✓ have to go. Hopefully to another page where that discussion is more appropriate. |
|
I am happy with the current page, and IMO this issue outlived itself. I think if someone wants to change anything they'll have to start a new issue, this one is a bit overloaded already. |
From #1163 (comment):
The text was updated successfully, but these errors were encountered: