Feed aggregator
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.
Huawei Wants To Take Homegrown HarmonyOS Phone Platform Worldwide
Read more of this story at Slashdot.
Gaming Giant Embracer Group Is Splitting Into Three Companies
Read more of this story at Slashdot.
EU Opens Probe of TikTok Lite, Citing Concerns About Addictive Design
Read more of this story at Slashdot.
Home Assistant Has a New Foundation, Goal To Become a Consumer Brand
Read more of this story at Slashdot.
Europe Baked in 'Extreme Heat Stress' Pushing Temperatures To Record Highs
Read more of this story at Slashdot.
Study: Alphabetical Order of Surnames May Affect Grading
Read more of this story at Slashdot.
Amazon Ends California Drone Deliveries
Read more of this story at Slashdot.
Meta Opens Quest OS To Third Parties, Including ASUS and Lenovo
Read more of this story at Slashdot.