- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Frist! Tipical Youtube, to be honest. Always striving to make everything uglier and less functional.
Admin
memcpy((char*)black, "black", 6);
Admin
When particular companies got strong enough to just completely do what they want, instead of keeping some interoperability alive... But even the introduction "like any reasonable video service" tries hard to hide, what YT/Google actually is: US mega club (like FB, Amazon) looking for world domination....
Admin
Sorry, but "working" beats "cool" into a cocked hat. This seems to be a case of "if it ain't broke, break it".
Admin
In the old times (tm) of 8 colors, color index 0 was used for "transparent", so no need to take it into account.
And then there was the tester who thought, hey, we have to test at least one strange color (and why more than the bare minimum), and filed a ticket for 0x080808. (Or this was added as a second thought to introduce something black-y.)
Admin
Good to know even the folks at Google have their WTFs
Admin
Replace "cool" with "enterprise-y", and the case is closed.
Admin
"if it ain’t broke, break it" -- quickly
Admin
Long time reader, but this is my Frist ever comment.
This is a barely believable WTF. Notwithstanding the actual stupidity stupidity of that code, then unless I'm very much mistaken all it needed was
pen.color = "#" + jsonPen.fcForeColor.toString(16)
- with I guess some left padding and a bit of input validation. No idea what possessed them to hardcode a very limited set of values, let alone completely failing to do that part properly.Admin
So this is the type of code the vaunted google interview process results in? Not to mention the quality of testing at a trillion dollar company. It's not like youtube is some obscure website from the 90's either, or one of those things google gives us on like google finance (which is the most useless website ever).
Admin
Do people actually watch youtube videos? Why?
Admin
Huh? #FF0000 is 0xFF0000. That's almost certainly how the colour value is stored in the browser's memory and exactly what you have to write to video memory (in 24-bit mode or 32-bit mode with the appropriate alpha byte; byte-order and colour corrections notwithstanding) to get that colour. Virtually all graphics APIs can take 32-bit values and directly use them as colours in this way.
Admin
Ah. I see the interns are back.
Admin
Quickly has the best quotes.
Admin
When storing a color value as a string, browsers support a condensed format for simple colors - using three characters instead of six - by eliminating the duplicated characters.
These pinheads took the condensed text representation and converted it back to a number. This resulted in a meaningless value that is actually larger than the value it represents. If they really cared about payload size, they should have simply left the RGB string. If they really cared about having an easy to use interface, then they would have used the proper number. They cared about nothing, so they got this.
Admin
No, #FF0000 is a string, while 0xFF0000 is a number. And numbers have the problem that 0x000F00 and 0xF00 are the same, while #000F00 and #F00 very much aren't.
Admin
I talk to my friends in JSON, because English isn't cool anymore.
Admin
{"response":[{"negation":true,"verb":"think","subject":"PWolff","object":{"verb":"be","verbmode":"auxiliary","subject":{"idea":{"verb":"talk","verbmodifier":"only"}},"predicate":"good"}}]}
I hope I didn't forget any parentheses
Admin
Well, all the symbols in your thing were braces and square brackets, so you forgot all the parentheses.
Admin
["word":"Yeah, ", "word":"but ", "word":"I ", "word":"think ", "word":"it'", "word":"s ", "word":"more ", "word":"likely", "word":"to ", "word":"be ", "word":"implemented ", "word":"like ", "word":"this."]
Admin
This isn't JSON's fault - there's no reason the JSON version shouldn't be as functional and more readable than XML (though if the XML version was working fine...). But apparently they gave an intern who's the boss's kid the job to write the shim for it and the kid knew neither XML, JSON, or JS.
Admin
Could the #080808 be a typo (or misremembered value that nobody bothered to look up) for #808080 grey?
Admin
Yup, I lost mucho respect for Google when they hired one of my coworkers. Her resume had nothing worthwhile, and her scripts and markup were crap, yet she landed a front-end role with them. I'm on the fence as to whether she's capable of this WTF.
Admin
Is this an early indication for hex-triplet strings being on Google's list, to be addressed right after they have done with URLs? (For sure, you do not want to be an RGB-string then.)
Admin
I think it's a victim of "test driven design". Someone wrote the unit test first with half a dozen colours. Then someone wrote the code to pass the unit tests - and nothing else.
Admin
Anything not necessary to pass the given tests would be premature optimization.
Admin
To give some context for the almost-black-but-not-quite #080808 entry: this is the background color used by regular black-and-white subtitles. So while this "YouTube black" was supported, real black wasn't.
Admin
I don't think "meeting customer requirements" can be described as premature optimisation. (But you're joking, of course.)
Admin
Yes...
And then there's still the question what does "customer requirements" mean?
(plus the stuff we KNOW the client will demand in the near future (and we told them so) - my pre-previous boss told me to build it in, while I'm at it, but to deactivate it, so that we can bill the double amount of hours when the client demands it)
Admin
Ah you missed "What the business analyst presented as a functional requirements document".
Probably for the best, less informed than the coder and the users if my experience is anything to go by.
Admin
So management wanted test-driven design in the worst possible way - and got it.
Admin
More precisely, these "pinheads" as you put it (more likely one person who wasn't really thinking their best, and a few reviewers who were just literally checking to see if the code was syntactically correct, rather than trying to determine if it was a good idea.) converted the short form to the 12 bit number that is explicitly referenced by the short form.
Everything would've been fine if they decided to translate the short form to a number that happened to match up to the right number... and also, of course, load all 16781312 possible options into the table.
Now, don't look at me like that. I fully get that's a bad design. But it would've been fine, because of course google has reviews, and any reviewer should've seen that was a bad design, and then gone back to having the strings translated like any numeric strings are translated, except with some logic to shift the bits of the short form number out to their respective places. (It does occur to me that I have not heard of a machine language instruction that moves bits 8-11 to 20-23, 4-7 to 12-15, and 0-3 to 4-7. So that last bit might be more than one opcode. But it could be done in one line of C or C++ or Java or C# or Perl or ..., even so.)