Computer
Lenovo's Latest Laptop Has a Rollable OLED Screen
Read more of this story at Slashdot.
Review Roundup: OnePlus 13
Read more of this story at Slashdot.
Nvidia Launches RTX 50 Blackwell GPUs: From the $2,000 RTX 5090 To the $549 RTX
Read more of this story at Slashdot.
Big Landlord Settles With US, Will Cooperate In Price-Fixing Investigation
Read more of this story at Slashdot.
Thailand Bans Imports of Plastic Waste To Curb Toxic Pollution
Read more of this story at Slashdot.
Hackers Claim Massive Breach of Location Data Giant, Threaten To Leak Data
Read more of this story at Slashdot.
Crunchyroll Is Getting (Back) Into the Manga App Game
Read more of this story at Slashdot.
Chinese Venture Capitalists Force Failed Founders On To Debtor Blacklist
Read more of this story at Slashdot.
AI Startup Anthropic Raising Funding Valuing it at $60 Billion
Read more of this story at Slashdot.
Meta Ends Fact-Checking on Facebook, Instagram in Free-Speech Pitch
Read more of this story at Slashdot.
Popular DNA Sequencer Left Vulnerable By 7-Year-Old Firmware, Unfixed Security Flaws
Read more of this story at Slashdot.
Apple's AI Is Proving It's Anything But Intelligent
Read more of this story at Slashdot.
Nvidia Unveils $3,000 Personal AI Supercomputer
Read more of this story at Slashdot.
Nvidia To Deploy AI Teammates in Video Games this Year
Read more of this story at Slashdot.
Getty Images and Shutterstock Agree To Merge
Read more of this story at Slashdot.
Instagram Begins Randomly Showing Users AI-Generated Images of Themselves
Read more of this story at Slashdot.
America Is Stuck With an Elevator Crisis
Read more of this story at Slashdot.
Microsoft Plans $3 Billion AI, Cloud Investment in India
Read more of this story at Slashdot.
Outgoing NASA Administrator Urges Incoming Leaders To Stick With Artemis Plan
Read more of this story at Slashdot.
Representative Line: Generate JSON
Today's anonymous submission is a delightfully simple line of JavaScript which really is an archetype of a representative line.
$json = "{";Now, I know you're thinking, "I see a '$' sigil, this must be PHP or maybe Perl!" No, this is JavaScript. And as you might be gathering from the code, this is the first line in a long block that constructs JSON through string concatenation.
And yes, JavaScript has built in functions for this, which work better than this. While it's possible that they need to generate custom JSON to support a misbehaving parser on the other side, that's it's own WTF- and it isn't the case here. The developers responsible simply didn't know how to handle JSON in JavaScript.
Do you know what else they couldn't understand? Source control and collaboration tools, so all of the JavaScript files were named things like david.js and lisa.js- each developer got their own JS file to work on, so they didn't conflict with anyone else.
[Advertisement] Picking up NuGet is easy. Getting good at it takes time. Download our guide to learn the best practice of NuGet for the Enterprise.