Computer
Researchers Caught Hiding AI Prompts in Research Papers To Get Favorable Reviews
Read more of this story at Slashdot.
A Lot of Product Makers Snub Right To Repair Laws
Read more of this story at Slashdot.
House Passes Bill That Slashes Solar, Wind and EV Tax Credits
Read more of this story at Slashdot.
Developer Accused of Defrauding YC Companies Through Simultaneous Employment Scheme
Read more of this story at Slashdot.
Scientists Warn US Will Lose a Generation of Talent
Read more of this story at Slashdot.
Citi Spends $9 Billion on Tech Overhaul After Series of Costly Errors
Read more of this story at Slashdot.
Samsung Working on Three-Panel Smartphone
Read more of this story at Slashdot.
Let's Encrypt Rolls Out Free Security Certs For IP Addresses
Read more of this story at Slashdot.
Ford CEO Predicts AI Could Eliminate Half of US White-Collar Jobs
Read more of this story at Slashdot.
US Agencies' Science Journal Subscriptions Canceled
Read more of this story at Slashdot.
New Evidence That Some Supernovae May Be a 'Double Detonation'
Read more of this story at Slashdot.
A New 'Interstellar Visitor' Has Entered the Solar System
Read more of this story at Slashdot.
CodeSOD: The Last Last Name
Sometimes, you see some code which is perfectly harmless, but illustrates an incredibly dangerous person behind them. The code isn't good, but it isn't bad in any meaningful way, but they were written by a cocaine addled pomeranian behind the controls of a bulldozer: it's full of energy, doesn't know exactly what's going on, and at some point, it's going to hit something important.
Such is the code which Román sends us.
public static function registerUser($name, $lastName, $username, ...) { // 100% unmodified first lines, some comments removed $tsCreation = new DateTime(); $user = new User(); $name = $name; $lastname = $lastName; $username = $username; $user->setUsername($username); $user->setLastname($lastname); $user->setName($name); // And so on. }This creates a user object and populates its fields. It doesn't use a meaningful constructor, which is its own problem, but that's not why we're here. We're here because for some reason the developer behind this function assigns some of the parameters to themselves. Why? I don't know, but it's clearly the result of some underlying misunderstanding of how things work.
But the real landmine is the $lastname variable- which is an entirely new variable which has slightly different capitalization from $lastName.
And you've all heard this song many times, so sing along with the chorus: "this particular pattern shows up all through the codebase," complete with inconsistent capitalization.
.comment { border: none; } [Advertisement] Utilize BuildMaster to release your software with confidence, at the pace your business demands. Download today!Data Breach Reveals Catwatchful 'Stalkerware' Is Spying On Thousands of Phones
Read more of this story at Slashdot.
Proposed Budget Seeks To Close Mauna Loa Observatory's Climate CO2 Study
Read more of this story at Slashdot.
Foxconn Mysteriously Tells Chinese Workers To Quit India and Return To China
Read more of this story at Slashdot.
Hacker With 'Political Agenda' Stole Data From Columbia, University Says
Read more of this story at Slashdot.
Intel's New CEO Explores Big Shift In Chip Manufacturing Business
Read more of this story at Slashdot.
Nintendo Locked Down the Switch 2's USB-C Port, Broke Third-Party Docking
Read more of this story at Slashdot.
Grammarly Acquires AI Email Client Superhuman
Read more of this story at Slashdot.