First off, Stack Overflow already *has* a URL shortening service: [s.tk](http://meta.stackexchange.com/questions/109795/what-shortened-urls-are-available-through-s-tk). It's mostly used internally and for ad campaigns, but it exists, we maintain it, and in rare cases it can be useful. Note that only a few people have access to *create* links using it, and that's probably not going to change for the reasons outlined in other answers and comments.

Second, Stack Overflow [already offers *short URLs*](http://meta.stackexchange.com/questions/23834/official-shortened-url-service/75352#75352) for things like questions and answers: /q/[id] and /a/[id] are interchangeable and redirect handily to the question or answer associated with the ID. For internal links, this should be more than adequate: `[this question](/q/319962)` -> [this question](/q/319962).

Finally, **shorteners are completely unnecessary and actively harmful in ordinary Q&A**. Links break frequently enough already; adding another layer of indirection just makes them harder to find and harder to fix, and adds yet another point of failure. You have 30,000 characters to play with here; that should be enough in most if not all circumstances. Let's face it: we don't have the markup structure to handle long articles in the way that (say) Wikipedia does; if your answer is exceeding 30,000 characters, you should probably break it up into multiple answers so that folks can find and link to the important bits. Or... y'know... learn to be slightly more concise. If *I* can fit my rambling into these constraints, I know you can. 

That just leaves...

##Comments

Comments are always problematic. In this case, the slim 600-character limit can potentially create a real hardship that simply doesn't exist for ordinary posts. It's not surprising then that folks have used URL shorteners in comments for a long time. 

...But what have they been used for? I sat down last night, determined to find out. 

First, I collected a list of shortened URLs from comments on Stack Overflow, comments that hadn't been deleted and weren't attached to deleted posts. I collected only URLs shortened via bit.ly, goo.gl, and tinyurl.com. Here's [the list of 25K+ URLs][1], if you're interested.

Turns out the 30 most common short URLs were:

- http://bit.ly/phpmsql x1503
- http://j.mp/QEx8IB x1484
- http://j.mp/T9hLWi x1480
- http://j.mp/Te9zIL x1471
- http://j.mp/PoWehJ x1089
- http://tinyurl.com/so-hints x1081
- http://j.mp/XqV7Lp x577
- http://goo.gl/vn8zQ x567
- http://goo.gl/vFWnC x562
- http://goo.gl/KJveJ x548
- http://goo.gl/3gqF9 x547
- http://goo.gl/GPmFd x447
- http://tinyurl.com/stack-hints x192
- http://tinyurl.com/so-list x174
- http://j.mp/Rj2iVR x164
- http://tinyurl.com/reproducible-000 x117
- http://tinyurl.com/2vycnvr x82
- http://goo.gl/orrj0 x55
- http://goo.gl/YXyWL x53
- http://goo.gl/J5jAo x53
- http://tinyurl.com/kdxb7le x53
- http://goo.gl/OWwr2 x52
- http://goo.gl/TD3xh x52
- http://goo.gl/q0gwD x52
- http://goo.gl/b2ATO x52
- http://bit.ly/SORepro x48
- http://bit.ly/unipain x37
- https://goo.gl/photos x35
- http://goo.gl/C1Kwu x32
- http://tinyurl.com/so-cxxbooks x29

Ok, so this is *mildly* interesting... Primarily because none of those URLs are even long; heck, several are just links to *questions on Stack Overflow*, which (as I noted above) can be linked to using SO's own built-in short-form URLs. Several of them have some value as easy-to-remember URLs, but it's worth noting that [two of those have been broken for a year and a half][2]. Nick did a big search & replace back then on Jon's behalf, but of course these were obscured by the damn short URL... In theory, whoever created those short links could've updated them to point to the blog post, but... They didn't. So a thousand+ links that no one can edit are just sitting there, broken. 

But enough about the top 30; they only account for about 50% of the short URLs used in comments, and as usual there's a long tail... I wonder how much is being *obscured* by these mostly-opaque URLs?

Since I had LINQPad open anyway, I decided to see if I could find out where all these links were pointing to:

<!-- language: lang-cs -->

	// world's crappiest shorturl resolver
    // don't do this at home, kids: find someone who knows what they're doing 
    // and ask 'em to teach you about rate-limiting and backoff
	foreach (String url in shortened)
	{
		HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(url);
		req.Method = "HEAD";
		req.AllowAutoRedirect = false;
		try
		{
			using (WebResponse resp = req.GetResponse())
			{
				var location = resp.Headers["Location"];
				var loc = "failed";
				if ( !string.IsNullOrEmpty(location) )
				{
					try
					{
						loc = (new Uri(location)).Host;
					}
					catch (UriFormatException)
					{
						loc = location;
					}
				}
				Console.WriteLine("{0}, {1}", url, loc);
			}
		}
		catch(WebException we)
		{
			Console.WriteLine("{0}, {1}", url, "failed");
		}
	}	

A half hour or so later, [I got some results to look at][3]. Here are the top 30 *hosts* being directed to by those short URLs:

- stackoverflow.com x2799
- en.wikipedia.org x2230
- php.net x2105
- uk.php.net x1970
- wiki.hashphp.org x1703
- msmvps.com x1123
- lmgtfy&#8203;.com x786
- news.php.net x764
- wiki.php.net x577
- gcc.godbolt.org x521
- github.com x497
- failed x394
- msdn.microsoft.com x271
- meta.stackoverflow.com x249
- developer.apple.com x222
- codeblog.jonskeet.uk x202
- www.google.com x166
- www.tutorialspoint.com x142
- developer.android.com x141
- docs.google.com x141
- www.dropbox.com x139
- drive.google.com x137
- code.google.com x129
- blogs.msdn.com x93
- groups.google.com x89
- dl.dropbox.com x83
- docs.oracle.com x81
- gist.github.com x66
- www.typescriptlang.org x65
- www.lmgtfy&#8203;.com x64

Ok, so... This is kinda embarrassing. **The most common use for URL shorteners in Stack Overflow comments is to point to *posts on Stack Overflow*.** Rounding out the top three we have Wikipedia and php.net, neither of which are exactly famous for extremely long URLs. Seeing [the long-banned LMGTFY][4] in the top 10 isn't exactly a great feeling either. We do finally get to gcc.godbolt, a site that might legitimately need a shortener to be used in comments, at #10, two spots ahead of the not-quite-400 links that completely failed.

...About that... All those broken links to Skeet's blog were kinda bothering me. How many *broken links* are we hiding behind these short URLs?

I dropped the AllowAutoRedirect line from my crappy resolver above, and let it run while I went to bed and slept the good sleep of a decaying body in a broken world. And woke to [yet another big list][5], which revealed that roughly 14% of these links are utterly broken. They'll likely never be fixed, most of them can't even be found, but there they sit. [A little more grit in the machine](https://www.youtube.com/watch?v=Nrb3EqGEI_E "Things fall apart; the centre cannot old; mere anarchy is loosed upon the world...").

In total, the compiler services [identified by Ajedi32 in the other thread](http://meta.stackoverflow.com/questions/319549/how-are-we-supposed-to-post-godbolt-links-now-that-url-shortening-is-blocked/319680#319680) account for a hair over 3% of the total, with most of that being links to gcc.godbolt.org (which [has a work-around in place now](http://meta.stackoverflow.com/questions/319549/how-are-we-supposed-to-post-godbolt-links-now-that-url-shortening-is-blocked/319814#319814)). 

##Final thoughts

The classic argument against blocking stuff like this is that folks will inevitably find a way around it. This is true. A blacklist is a rough tool, and no doubt some number of people will just pick a more obscure shortener and go on with what they were doing, our efforts to dissuade them wasted.

In spite of this, I cannot look at these results and not feel ashamed for waiting so long to implement this restriction. These links - and comments that depend on them - are a blight, and by failing to dissuade folks from their use (which we can now see was nearly always unwarranted even in comments), we've allowed them to take hold. 




  [1]: https://gist.github.com/Shog9/c4667c7acc17124e22571ad28075ced9
  [2]: http://meta.stackexchange.com/questions/237110/is-there-any-support-for-mass-link-editing
  [3]: https://gist.github.com/Shog9/140e54acaf93ecba709645df87ada0b1
  [4]: http://meta.stackexchange.com/questions/15650/ban-lmgtfy-let-me-google-that-for-you-links
  [5]: https://gist.github.com/Shog9/3b1b01f740538ded9b76326139e30436