Feed aggregator
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.
NYT To Start Searching Deleted ChatGPT Logs After Beating OpenAI In Court
Read more of this story at Slashdot.
Google Ordered To Pay $315 Million for Taking Data From Idle Android Phones
Read more of this story at Slashdot.
Amazon To Shut Down Its Freevee App Next Month
Read more of this story at Slashdot.
China's Giant New Gamble With Digital IDs
Read more of this story at Slashdot.
AI Note Takers Are Increasingly Outnumbering Humans in Workplace Video Calls
Read more of this story at Slashdot.
US Probes Whether Negotiator Took Slice of Hacker Payments
Read more of this story at Slashdot.