Feed aggregator
Turkish Student Arrested For Using AI To Cheat in University Exam
Read more of this story at Slashdot.
China Is Testing More Driverless Cars Than Any Other Country
Read more of this story at Slashdot.
How Amazon Blew Alexa's Shot To Dominate AI
Read more of this story at Slashdot.
Wells Fargo Fires Employees for Faking Work By Simulating Keyboard Activity
Read more of this story at Slashdot.
Microsoft Chose Profit Over Security and Left US Government Vulnerable To Russian Hack, Whistleblower Says
Read more of this story at Slashdot.
Firefox Browser Blocks Anti-Censorship Add-Ons At Russia's Request
Read more of this story at Slashdot.
Roku TV Owners Complain That Motion Smoothing Is Stuck 'On' After an Update
Read more of this story at Slashdot.
Stoke Space Scores a Success In First Test Firing of Engine For Reusable Nova Booster
Read more of this story at Slashdot.
CodeSOD: Broken Loop
Kyle sends us a puzzler of bad code today. It appears in a "JSP-like" codebase- which Kyle provides no futher details on, but certainly hints at a serious WTF underpinning this code.
boolean loop = true; while (loop) { // fake loop to break out of loop = false; doesStuff(); moreStuff(); etc(); }This is a representative block, as this pattern appears frequently in the code. The comment fake loop to break out of is part of the code- it's copypasted everywhere this particular pattern is used. In no instance is the variable loop ever changed- we enter the loop, set it to false, and then execute our code.
My suspicion about the purpose is that it's meant to easily disable blocks of code- change the first line to boolean loop = false and you effectively skip the block. But if that were the case, a conditional statement would do the job just as well. There's no reason to use a loop. And even if that were the case, that's a huge code-smell, anyway. Is it some misguided attempt at error handling? A misguided attempt at some kind of optimization, somehow? A ritual performed for no reason other than someone decided to do it that way one day, and just kept doing it forever after?
Oh, right, it was written by the kind of person that has a "JSP-like" codebase, implying some sort of inner platform, home-grown, monstrosity. Yeah, that probably explains it.
.comment { border: none; } [Advertisement] BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how!Apple To 'Pay' OpenAI for ChatGPT Through Distribution, Not Cash
Read more of this story at Slashdot.
Chemical Makers Sue Over Rule To Rid Water of 'Forever Chemicals'
Read more of this story at Slashdot.
Norway Discovers Europe's Largest Deposit of Rare Earth Metals
Read more of this story at Slashdot.
Japan Enacts Law Forcing Third-Party App Stores On Apple and Google
Read more of this story at Slashdot.
Intel Is Trucking a 916,000-Pound 'Super Load' Across Ohio To Its New Fab
Read more of this story at Slashdot.
Stable Diffusion 3 Mangles Human Bodies Due To Nudity Filters
Read more of this story at Slashdot.
Adobe Says It Won't Train AI On Customers' Work In Overhauled ToS
Read more of this story at Slashdot.
EU Announces Higher Tariffs of Up To 38% On Chinese EVs
Read more of this story at Slashdot.
One of Two Major Data Brokers Shuts Down Product Related To Driver Behavior Patterns
Read more of this story at Slashdot.
Google's Abuse of Fitbit Continues With Web App Shutdown
Read more of this story at Slashdot.
Rivals and Legal Action Cast Shadows Over Windows on Arm Market
Read more of this story at Slashdot.