Gangnam Style Surpasses YouTube's 32-bit View Counter
First time accepted submitter neoritter writes "The Korean pop star PSY's viral music video "Gangnam Style" has reached the limit of YouTube's view counter. According to YouTube's Google+ account, "We never thought a video would be watched in numbers greater than a 32-bit integer (=2,147,483,647 views), but that was before we met PSY. 'Gangnam Style' has been viewed so many times we had to upgrade to a 64-bit integer (9,223,372,036,854,775,808)!"
I would have figured Rick Astley would have hit that count first!.
Why the hell was it signed?
who cares really?
The numbering should go 1.. 2.. 3.. etc.. thousands.. tens of thousands.. hundreds of thousands.. millions.. too many to give a fuck about.
Because they were following the Google C++ Style Guide?
"You should not use the unsigned integer types such as uint32_t, unless there is a valid reason such as representing a bit pattern rather than a number, or you need defined overflow modulo 2^N. In particular, do not use unsigned types to say a number will never be negative. Instead, use assertions for this."
If they'd used a 32 bit unsigned integer they might have bought another 6 months or something.
You could say the same of the unix time_t problem, which is a signed 32bit int. If it were unsigned, it'd go to 2106 instead of 2038. Either way, that's not not really the solution. The solution, as youtube has done, is to move to 64bit int.
Personally, I'm amazed at the hit count!
There are 2^31 seconds between 1970-01-01 and 2038-01-19.
If this video was watched once every second since 1970, it'd still have 24 years before it rolled over that counter.
By comparison, it hasn't been available very long. How many views a second is that thing getting? On average, more than 28 hits a second!!!
28 hits/sec may not seem outrageous for a very popular file on a very popular site, but that's averaged since July 2012 until today. That, IMO, is nuts.
I assume they're gonna be calling this the Psy2K bug.
The song and video are a parody of the lifestyle of Koreans in the Gangnam District of Seoul.
There can be good reasons to use it but there are also a couple of reasons to avoid it.
1: overflows are "hidden", with a signed number overflow will usually* result in a nonsensical (very large negative) number, with an unsigned number overflows will usually bring you back to zero which is much less likely to be noticed
2: the rules for operations (especially comparisions) involving a mixture of signed and unsigned types are seriously counter-intuitive.
* Yes I know the C standard doesn't actually require this and modern versions of gcc are being retarded about it in some cases but for the most part it holds true
note: i'm known as plugwash most places but i screwd up registering that here somehow in the past and now can't register
... for the successful rick-rolling goes to the "informative" mods...
Even though "beats the 64bit integer" was very obvious BS, I still clicked...
That was part of my evil scheme. ;-)
No Slashdotter can resist the sense of superiority that comes from correcting a trivial math error.