Skip to content
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

Mention "trim" as a common name for removing space #95

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

afresh1
Copy link

@afresh1 afresh1 commented Apr 1, 2021

As discussed on perl5-porters, folks looking for this entry may not find
it if they are coming from another language where this is commonly
called "trim".

I didn't realize this was maintained in a separate repo, so this replaces the previous:
Perl/perl5#18675

As discussed on perl5-porters, folks looking for this entry may not find
it if they are coming from another language where this is commonly
called "trim".
@Grinnz
Copy link

Grinnz commented Apr 1, 2021

My only concern with changing question titles is that it breaks deep-links to the question. I think this question might be one where those exist. But perldoc -q only searches question titles, so changing the title is the only way to make this work. 🤷

@Grinnz
Copy link

Grinnz commented Apr 1, 2021

Unfortunately my other suggestion, add a second heading so existing deeplinks keep working, is not something that perldoc -q can deal with.

@afresh1
Copy link
Author

afresh1 commented Apr 1, 2021

Would adding an X<> reference with the old title make it work on perldoc.org or the metacpan?

@haarg
Copy link

haarg commented Apr 1, 2021

No, X<> does nothing for linking.

@@ -926,7 +926,7 @@ implementing it yourself is highly recommended; you'll save yourself odd bugs
popping up later by just using code which has already been tried and tested in
production for years.

=head2 How do I strip blank space from the beginning/end of a string?
=head2 How do I trim a string to strip blank space from the beginning/end?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you are going to change the title, a better one would be "How do I trim a string". If you think they know what trim is, they don't need the rest of the words.

Copy link

@briandfoy briandfoy Apr 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But, also consider the people who haven't used other languages and haven't encountered trim.

Thinking about this, I think this change might wait for a trim to show up in Perl, which might be soon.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see this more as a combination of using the English verb "trim" with it coincidentally being the name of this common operation. Thus the additional explanation helps describe that it's referring to blank space specifically.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was shooting for keeping perldoc -q working, but to that end I would probably go with "remove space" as something people might search for. But, overall, it seemed as though folks thought that "trim" was the most common spelling for doing this to a string. I'm not much on SEO though, so whatever folks think is a good title. I thought this might make perl 5.34 while I'm sure trim won't.

How do I trim a string to remove whitespace from the beginning/end?

@briandfoy
Copy link

Maybe @Grinnz can support an internal redirect on perldoc.perl.org for the old question title.

@Grinnz
Copy link

Grinnz commented Apr 1, 2021

Maybe @Grinnz can support an internal redirect on perldoc.perl.org for the old question title.

It would be an additional anchor added to the page, but it is possible.

@karenetheridge
Copy link
Member

How about we keep the question as-is, but add a new question just above that references the original? e.g. "How do I...? ..see <link>, below." Then we preserve existing links to the question, and also get the word "trim" into the table of contents, for searchability.

@Grinnz
Copy link

Grinnz commented Apr 10, 2021

That's a good idea, but I would say the other way around: change the current title, and add a mostly-empty section for the old title, since the old title is there to preserve existing links but the new one is there to make perldoc -q trim work, so should contain the actual answer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants