Computer
ByteDance Prefers TikTok Shutdown in US if Legal Options Fail, Report Says
Read more of this story at Slashdot.
New Rule Compels US Coal-Fired Power Plants To Capture Emissions - or Shut Down
Read more of this story at Slashdot.
iPhone Activation Market Share Hits New Low as Android Dominates
Read more of this story at Slashdot.
Net Neutrality is About To Make a Comeback
Read more of this story at Slashdot.
Ford Just Reported a Massive Loss on Every Electric Vehicle It Sold
Read more of this story at Slashdot.
Spotify Says Apple Has Rejected Its App Update With Price Information for EU Users
Read more of this story at Slashdot.
AI Could Kill Off Most Call Centres, Says TCS Head
Read more of this story at Slashdot.
US Fertility Rate Falls To Lowest In a Century
Read more of this story at Slashdot.
Vast DNA Tree of Life For Plants Revealed By Global Science Team
Read more of this story at Slashdot.
Airlines Required To Refund Passengers For Canceled, Delayed Flights
Read more of this story at Slashdot.
CodeSOD: Unaccountable Counting
Ulvhamne sends us some bad code that, well, I think at this point we should really coin a name for this particular anti-pattern.
@Override public int getNumOfItemsInDataContainer(int parDataId) { int numberOfItems = 0; for (Integer x : myTransactionDataContainerMap.keySet()) { numberOfItems ++; } return numberOfItems; }This C# function wants to get the number of items contained in a dictionary. To do that, it iterates across the set of keys, and increments a counter. This is instead of using the size field that's part of the dictionary container.
This one adds a lovely bonus of taking a parameter parDataId, and doing nothing with it.
Marking the parameter as par is an example of so-called "Apps Hungarian", where the prefix is meant to represent the "logical" datatype or purpose of the variable- semantic information, instead of type information. While marginally better than iDataId, I still hate it. Also, if your methods have so many local variables in scope that you need to distinguish them from the parameters somehow, lest you get confused, that's an even bigger code smell.
All the Hungarian nonsense aside, this is an example of the very common anti-pattern of manually counting the items in a container when the container already can report that information.
So what do we call that? "Container Countification"? "Fingers and Toes"? "Sesame Street Counting"?
[Advertisement] Continuously monitor your servers for configuration changes, and report when there's configuration drift. Get started with Otter today!Almost Every Chinese Keyboard App Has a Security Flaw That Reveals What Users Type
Read more of this story at Slashdot.
Manga Site Blocks Adult Content, But Only For US and UK Users
Read more of this story at Slashdot.
Apple Reportedly Developing Its Own Custom Silicon For AI Servers
Read more of this story at Slashdot.
Google Delays Third-Party Cookie Demise Yet Again
Read more of this story at Slashdot.
'ArcaneDoor' Cyberspies Hacked Cisco Firewalls To Access Government Networks
Read more of this story at Slashdot.
Taser Company Axon Is Selling AI That Turns Body Cam Audio Into Police Reports
Read more of this story at Slashdot.
Meta Opens Quest Operating System To Third-Party Device Makers
Read more of this story at Slashdot.
Updating California's Grid For EVs May Cost Up To $20 Billion
Read more of this story at Slashdot.
Lenovo First To Implement LPCAMM2 in Laptop
Read more of this story at Slashdot.