Computer
HashiCorp Reportedly Being Acquired By IBM
Read more of this story at Slashdot.
Ex-Amazon Exec Claims She Was Asked To Ignore Copyright Law in Race To AI
Read more of this story at Slashdot.
Linux Can Finally Run Your Car's Safety Systems and Driver-Assistance Features
Read more of this story at Slashdot.
iPhone Sales Drop 19% in China
Read more of this story at Slashdot.
AI Is Poisoning Reddit To Promote Products and Game Google With 'Parasite SEO'
Read more of this story at Slashdot.
How GM Tricked Millions of Drivers Into Being Spied On
Read more of this story at Slashdot.
Apple Cuts Vision Pro Shipments As Demand Falls 'Sharply Beyond Expectations'
Read more of this story at Slashdot.
FTC To Vote On Noncompete Ban
Read more of this story at Slashdot.
No One Buys Books Any More
Read more of this story at Slashdot.
Fedora Linux 40 Officially Released
Read more of this story at Slashdot.
China's Ageing Tech Workers Hit By 'Curse of 35'
Read more of this story at Slashdot.
Microsoft Launches Phi-3 Mini, a 3.8B-Parameter Model Rivaling GPT-3.5 Capabilities
Read more of this story at Slashdot.
Google Fires More Employees Over Protest of Cloud Contract With Israel
Read more of this story at Slashdot.
Toyota's Hydrogen Future Is Crumbling As Owners File Lawsuits, Call For Buybacks
Read more of this story at Slashdot.
NASA Officially Greenlights $3.35 Billion Mission To Saturn's Moon Titan
Read more of this story at Slashdot.
Voyager 1 Resumes Sending Updates To Earth
Read more of this story at Slashdot.
CodeSOD: An Obsolete Approach
Marcus's team was restructuring the API, and the architect thus wanted a number of methods marked obsolete, to encourage developers to move to the new version of the API. So the architect created a Jira task, assigned it to a dev, and moved on.
Somehow, this C# code got committed and merged, despite being code reviewed:
public static void OBSOLETE_PopulateOfferNodes(Ecometry.New.Model.CategoryHierarchyNode _mainNode, ref Ecometry.New.Model.CategoryHierarchyNode _defaultOffersNode, ref Ecometry.New.Model.CategoryHierarchyNode _foundOffersNode) { foreach (Ecometry.New.Model.CategoryHierarchyNode offersNode in _mainNode.Children) { if (offersNode.Category.Name.ToUpper().Trim().Equals("_DEFAULT")) _defaultOffersNode = offersNode; if (offersNode.Category.Name.ToUpper().Trim().Equals(Ecometry.New.Impl.ExecutionContextFactory.ExecutionContext.CurrentCart.SourceCode.Code.ToUpper().Trim()) && Snapshot.OfferRelatedUtilities.isDateOK2Show(offersNode)) _foundOffersNode = offersNode; if (_defaultOffersNode != null && _foundOffersNode != null) break; } return; }Now, what the architect had meant was that the developer should use the [Obsolete] attribute, which lets you annotate methods like so:
[Obsolete("Foo is deprecated, please use Bar instead")] public void Foo() {}What the developer heard, instead, was that they should do a find and replace of every use of the method name and prepend OBSOLETE_ to it.
The annotation has a number of advantages: unlike the name, it produces a compiler warning, and that warning can be promoted to a compiler error in future versions, without fully removing the method. It also helpfully avoids this drunken form of Hungarian notation that sneaks what is essentially version information into the method name.
This is the first step on a path that ends with methods named New_UseThisOne_Foo().
All that aside, the if statements are a mouthful in there. They're not a WTF, but… boy, they could probably be simplified for readability. I suspect that's part of why this method is obsolete.
[Advertisement] Continuously monitor your servers for configuration changes, and report when there's configuration drift. Get started with Otter today!California Is Grappling With a Growing Problem: Too Much Solar
Read more of this story at Slashdot.
Pareto's Economic Theories Used To Find the Best Mario Kart 8 Racer
Read more of this story at Slashdot.
Apple Acquires Datakalab, a French Startup Behind AI and Computer Vision Tech
Read more of this story at Slashdot.