|
After years of using and defending PHP, you *finally* bumped up against something that you found a problem with? Or did you even bump into an issue with it, your post seems to say you saw someone else having an issue with it on YT.
If it works for you, what's the problem?
|
|
|
|
|
Sounds like an opportunity to me. PHP is in fact open source. Like it's been pointed out in this thread, there are many community things out there that you can use to overcome your hurdles.
|
|
|
|
|
|
|
https://www.youtube.com/watch?v=9bZkp7q19f0[^]
Top comment from YouTube staff :
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 have to upgrade!
|
|
|
|
|
At least it is signed, to allow for the "unviewers"?
|
|
|
|
|
That's the first thing I thought too. Nice to know even YT has some legacy code they'd rather not talk about. Makes me feel better.
Jeremy Falcon
|
|
|
|
|
If we all go and watch the YouTube video of the Arianne rocket launch fail caused by an integer overflow...we might cause a YouTube integer overflow.
This is how we will defeat the terminator robots in our dystopian future - unchecked integer assignments.
|
|
|
|
|
Nish Sivakumar wrote: "Gangnam Style" has been viewed so many times we have to upgrade!
The brain of the users.
Read it in the Cybermen voice
|
|
|
|
|
Psy for president...
|
|
|
|
|
No reason not to just stop counting at maxint.
FTFM
|
|
|
|
|
But if they stopped counting, how would the sheep know what they should be watching?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Pfft, Psy is so last year. I mean stop at maxint.
|
|
|
|
|
That is why counters should be started as text, then you can do the math internally using floating point and converted back...
Seriously, I worked on a system that did just that...
Created havoc when trying to balance values at month end.
|
|
|
|
|
|
You'd still run into a similar issue with max length not being large enough and then converting them to numbers anyway to do arithmetic on them. Which still means the int max would come into play, and as an added bonus increase computation time. I'll stick with ints. YT should have at least went with an unsigned 32-bit int at the very least, which is a greater amount than half the population of the world so it would carry them far enough.
Jeremy Falcon
|
|
|
|
|
Obviously, everything should be stored as text. I mean, what's the point of using a numeric field for anything, if it's going to have a limit?
You can even make things easier by storing it already formatted... You know, like instead of storing -12345, you actually store "(12,345)". It makes it easier to display things, and only adds a little overhead when you have to parse it for processing.
And you know what? Why store those values in separate fields? It'd be more efficient to put a few of them together in the same field, along with some tags so you can categorize things. I mean, if you're doing some parsing when you load them anyway, you might as well compact the data a little, right?
... Yeah, I've worked with systems like that too... Not quite as bad as the horrible and disgusting exaggeration above... But pretty bad
|
|
|
|
|
I beat you to the draw, but your way of saying it was more funny.
Jeremy Falcon
|
|
|
|
|
Easy enough to do with a Turing Machine.
|
|
|
|
|
BCD came first (much to his partner chagrin).
|
|
|
|
|
They should have simply rewritten YouTube in Lisp, and that would really solve the problem[^]. This way, they'll have to upgrade to 128 bits once "Gangnam Style" gets viewed 9,223,372,036,854,775,807 times
|
|
|
|
|
Stolen and FB'd.
/ravi
|
|
|
|
|
You are welcome
|
|
|
|
|
All they have to do is only count unique watches by ip, instead of lying about how many people watch their videos. We all know Nish watched Gangnam at least 2 million times.
.'\ /`.
.'.-.`-'.-.`.
..._: .-. .-. :_...
.' '-.(o ) (o ).-' `.
: _ _ _`~(_)~`_ _ _ :
: /: ' .-=_ _=-. ` ;\ :
: :|-.._ ' ` _..-|: :
: `:| |`:-:-.-:-:'| |:' :
`. `.| | | | | | |.' .'
`. `-:_| | |_:-' .'
`-._ ```` _.-'
``-------'/xml>
|
|
|
|
|
Hey!
|
|
|
|