- Feature Articles
- CodeSOD
-
Error'd
- Most Recent Articles
- Time For (a cool change)
- Phoning One In
- Filling
- Nothin Doin
- It Seats Zero
- Take Off
- Even Auld Lang Syner
- Chill
-
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 the 50 Shades of Grey book was banned a Brad's company. After they removed all copies, Brad decided to go one better by removing 255 shades of grey.
Admin
#ffffff is missing in colorsBlackWhite
Admin
That doesn't look like PHP to me, but some HTML templating language used by a backend framework which could be written in pretty much any language. (It looks quite a bit like Jinja which is a Python templating engine, but most of them look pretty similar.)
Using such a think inside JS rather than just for HTML as designed though definitely looks like WTF territory.
Admin
Good on Brad for justifying the word "pessimal"'s existence.
Admin
Imagine all the shenanigans to be described in the upcoming book called "200 shades of RGB"
Admin
Presumably we also have:
let colors = ["#000000", "#000001", "#000002", "#000003", ... // source truncated for brevity
Admin
TRWTF is generating javascript with a templating language!! All static analysis, including vuln scanning and linting -- even the most basic reporting on compile errors -- will be gone.
Admin
It might be Django: https://www.djangoproject.com/start/
Admin
It seems Jinja2 to me as well, and yes, using it inside JS is a RWTF in itself!
Admin
I love how colorsBlackWhite[idx] and colorsBlackWhite[idx +1] are optimized for maximum contrast between the first x layers
Admin
yes, it could be - as I said, most of these templating engines are pretty similar in syntax