Computer
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.
HashiCorp Reportedly Being Acquired By IBM [UPDATE]
Read more of this story at Slashdot.
Adobe's Impressive AI Upscaling Project Makes Blurry Videos Look HD
Read more of this story at Slashdot.
Google-Backed Glance Pilots Android Lockscreen Platform in US
Read more of this story at Slashdot.
Steam Closes Early Access Playtime Loophole
Read more of this story at Slashdot.
Apple Releases OpenELM: Small, Open Source AI Models Designed To Run On-device
Read more of this story at Slashdot.
Framework Won't Be Just a Laptop Company Anymore
Read more of this story at Slashdot.
'The Man Who Killed Google Search'
Read more of this story at Slashdot.