-19

In the same way a YouTube video of URL https://www.youtube.com/watch?v=Vqcf2GGiczU has a permanent shorter URL (for easier sharing) youtu.be/Vqcf2GGiczU, is there a similar thing for posts?

Example for comments in code:

print("foo bar")  # see https://stackoverflow.com/questions/419163/what-does-if-name-main-do/419185, but we also have to do foo and bar
# too long!
print("foo bar")  # see https://stackoverflow.com/a/419185, but we also have to do foo and bar
# better
print("foo bar")  # see s.tk/q419185, but we also have to do foo and bar
# would be even better for comments readability!

TL;DR: Could there be an additional shorter URL, for every post?

For future reference, this post is linked with the (upvoted, but declined) Please add question and answer shortlinks with site names to the s.tk URL shortener.

I learned that the s.tk domain belongs to Stack Overflow, it could be a great opportunity!

15
  • Nope, no such service exists (within SE's scope, at least)
    – Cerbrus
    Commented Oct 4, 2023 at 12:58
  • @ThomA Can you please elaborate? What would be the drawback of having an additional URL, minified?
    – Basj
    Commented Oct 4, 2023 at 13:00
  • 12
    A waste of developer time when they should be fixing actual problems, for a start. //stackoverflow.com/a/419185 is short enough.
    – Thom A
    Commented Oct 4, 2023 at 13:01
  • 3
    Shorter isn't necessarily more readable... I, personally, prefer seeing unminified urls.
    – Cerbrus
    Commented Oct 4, 2023 at 13:02
  • @Cerbrus maybe minified isn't the right term. I mean in the same way than youtu.be/Vqcf2GGiczU instead of https://www.youtube.com/watch?v=Vqcf2GGiczU: the same id appears. Maybe "shorter" is the right term and not "minified".
    – Basj
    Commented Oct 4, 2023 at 13:03
  • Doesn't really matter how you call it, tbh :D
    – Cerbrus
    Commented Oct 4, 2023 at 13:09
  • 1
    For the record, youtu.be/Vqcf2GGiczU isn't a URL. If you are fine to write sta.ck/419185 you may as well write stackoverflow.com/a/419185. Commented Oct 4, 2023 at 13:15
  • 9
    Exactly how is the short youtube link "easier sharing" ? You copy-paste a url, or through a phone app you choose to "share" it. The url itself is entirely detached from that process. Unless you've been manually typing them in, in which case I would really advise you to stop doing that.
    – Gimby
    Commented Oct 4, 2023 at 13:47
  • 4
    Declined in the past: Please add question and answer shortlinks with site names to the s.tk URL shortener (2011).
    – Andrew T.
    Commented Oct 4, 2023 at 16:05
  • 1
    Why should Stack Overflow register a domain with Cook Islands? What does that have to do with Stack Overflow? Commented Oct 4, 2023 at 23:19
  • 1
    @AnonCoward You know it was just a simple example in my post, no need to ironize on this particular domain :-)
    – Basj
    Commented Oct 5, 2023 at 6:49
  • "For future reference, this post is linked with the (well-received)..." I don't understand how this is not a duplicate. Commented Oct 5, 2023 at 17:41
  • 1
    Because you cannot dupe vote to MSE, @KarlKnechtel
    – yivi
    Commented Oct 5, 2023 at 20:12
  • If you click on the "share" button I believe it gives you a shorter url than what is shown on the address bar
    – user13267
    Commented Oct 6, 2023 at 2:07
  • @cuzy well at least that's a valid argument for shorter URLs. The first one made in this post. Requesting change just for the sake of change is never going to have any chance of success.
    – Gimby
    Commented Oct 10, 2023 at 13:45

3 Answers 3

17

There is no URL shortener that is focused only on Stack Overflow (or Stack Exchange) posts. The shortest URL you can have is in the form

  • https://stackoverflow.com/a/419185 for answers1
  • https://stackoverflow.com/q/419163 for questions1

Which can further be shortened by removing the protocol: //stackoverflow.com/a/419185 and //stackoverflow.com/q/419163. This is going to use protocol relative URL, thus using HTTP or HTTPS depending on the current domain where the link is.

Yet it saves a total of 5 characters.


1 actually the a or q in the URL does not matter. The ID of the post will lead to the correct place, https://stackoverflow.com/a/419185 and https://stackoverflow.com/q/419185 work the same, as well as https://stackoverflow.com/q/419163 and https://stackoverflow.com/a/419163

16

There is no advantage on having shorter URLs for "sharing", unless we are aiming for sharing in social sites, where character count may be a limitation. A use case for which I personally derive zero value.

For most purposes, it's useful that the URL exhibits some indication of what will be found on the other side of the link. Having a shorter version that makes it easier to hide that information, and no value (I would argue that it actually subtracts value).

I disagree something like that should be created. The existing options, such as they are, are more than enough. No need to build something worse.

3

If you absolutely need links in comments in the code blocks, provide the links in a numbered list after the code block, or on the bottom of your answer, and refer to this list in the comments, for instance // See link 3. That will prevent littering the code block, and you don’t have to open the links to get any sort of idea what they’re about, because you’ll read the Q/A’s title in the list, without leaving the page with your answer.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .