-
Notifications
You must be signed in to change notification settings - Fork 291
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
Include ASCII Equivalents in Official Docs code Examples #2201
Comments
In fact, we have the opposite policy for the docs. It's not written in stone, but this means that most examples are going to follow your example number 1, not the second. |
OK, actually, here's what happened. We had some examples using ascii chars, and other examples using non-ascii chars. While in some cases it's ok, generally it's inconsistent, so I came up with #1520, take a look at the issue for a justification. Basically, we introduced “Prefer non-ASCII syntax in examples” not to piss off those who don't like unicode chars, but because you can then deunicodify examples with dumb-as-bricks code and very high rates of success (basically just So we can actually “Include ASCII Equivalents” as requested, someone just needs to do it. And then, should it be done in javascript or do we have any better alternative? |
A dynamic method would be cool if it could be done fairly easily so non-fluent js folks could cookbook enter it fairly easily when the spirit moves them. |
Hi, thanks for the feedback, I was not aware of the policy or issue #1520 I don't want to waste anybodies time on this, but I will this say and I promise, I wont take it further or argue more, this was a very negative experience for me, and I am very sure, it will be a negative experience for many outsiders and new comers This policy as it is implemented today
I think, we can keep the policy, but fix the undesirable side effect, it can be mentioned somewhere prominent on the site, that ASCII codes exist (this is not the case today) |
Sorry, I should've mentioned I was vaguely aware of something like that when I suggested you file the Issue.
Here's the user not understanding how to write the code shown in the examples. The rest of the channel are in the middle of some weird religious discussion and answer the user only three minutes later.
A really easy thing to implement would be just a piece of JS that scans for Unicode ops and sticks a tiny question mark icon next to that line. Hover over it and it shows a tooltip explaining that we have ASCII alternatives for all the fancy ops and the Language section has both a section on how to type fancy ops and a map of all the fancy ops to ASCII equivalents. Basically, just making the user aware they don't have to use fancy symbols if they don't want to. (the CSS code that genned the shown example. Probably needs more tweakage to work with different fonts. Also, since .line.marked .source::before {
content: "?";
position: absolute;
left: -4ex;
font-size: 80%;
display: block;
background: #aaf;
color: #fff;
border-radius: 3ex;
width: 2.5ex;
height: 2.5ex;
text-align: center;
vertical-align: middle;
box-shadow: 0 0 1px rgba(0,0,0,.2);
margin-top: 1px;
} |
https://docs.raku.org/language/unicode_ascii exists, which shows the alternatives. See the related commit for an addition of this information to the intro page, which should answer the modified ask. |
For Perl6 new comers, those who are not familiar with the Perl6 community and culture
and how Perl6 came to be or evolve
The special Unicode Characters in code and especially in operators, can look very intimidating
it can be quiet engaging to find out how to insert those characters in your favorite OS or editor
Having Unicode only code samples and examples, might give the impression, that there is no other way to write that code, except using the unicode characters
It should be made clear in the docs, that for example this line
my @primes = ^∞ .grep: *.is-prime;
Can simply be written as
my @primes2 = ^Inf .grep: *.is-prime;
And if possible any unicode operator mentioned in the docs, should have a link to its ascii equivalent
I understand, that Perl6 might be trying to promote itself as a 100 year language, and that part of this is promoting the use of the nicer looking unicode characters, but for new comers who are not aware of this or sold on this idea, this can be very intimidating and confusing
The text was updated successfully, but these errors were encountered: