Feed aggregator
Firefox Finally Introducing MKV Playback Support
Read more of this story at Slashdot.
India's IT Sector Nervous as US Proposes Outsourcing Tax
Read more of this story at Slashdot.
Snapchat Allows Drug Dealers To Operate Openly on Platform, Finds Danish Study
Read more of this story at Slashdot.
Amazon Drivers Could Be Wearing AR Glasses With a Built-In Display Next Year
Read more of this story at Slashdot.
DNA Cassette Tape Can Store Every Song Ever Recorded
Read more of this story at Slashdot.
CodeSOD: The Getter Setter Getter
Today's Java snippet comes from Capybara James.
The first sign something was wrong was this:
private Map<String, String> getExtractedDataMap(PayloadDto payload) { return setExtractedDataToMap(payload); }Java conventions tell us that a get method retrieves a value, and a set method mutates the value. So a getter that calls a setter is… confusing. But neither of these are truly getters nor setters.
setExtractedDataToMap converts the PayloadDto to a Map<String, String>. getExtractedMap just calls that, which is just one extra layer of indirection that nobody needed, but whatever. At its core, this is just two badly named methods where there should be one.
But that distracts from the true WTF in here. Why on Earth are we converting an actual Java object to a Map<String,String>? That is a definite code smell, a sign that someone isn't entirely comfortable with object-oriented programming. You can't even say, "Well, maybe for serialization to JSON or something?" because Java has serializers that just do this transparently. And that's just the purpose of a DTO in the first place- to be a bucket that holds data for easy serialization.
We're left wondering what the point of all of this code is, and we're not alone. James writes:
I found this gem of a code snippet while trying to understand a workflow for data flow documentation purpose. I was not quite sure what the original developer was trying to achieve and at this point I just gave up
[Advertisement] Picking up NuGet is easy. Getting good at it takes time. Download our guide to learn the best practice of NuGet for the Enterprise.As World Gets Hotter, Americans Are Turning To More Sugar, Study Finds
Read more of this story at Slashdot.
RSS Co-Creator Launches New Protocol For AI Data Licensing
Read more of this story at Slashdot.
Amazon's Zoox Launches Robotaxi Service In Las Vegas
Read more of this story at Slashdot.
US Warns Hidden Radios May Be Embedded In Solar-Powered Highway Infrastructure
Read more of this story at Slashdot.
BMW Says Europe's Gas Engine Ban 'Can Kill an Industry'
Read more of this story at Slashdot.
White House Asks FDA To Review Pharma Advertising On TV
Read more of this story at Slashdot.
Oracle's Best Day Since 1992 Puts Ellison on Top of the World's Richest List
Read more of this story at Slashdot.
Developers Joke About 'Coding Like Cavemen' As AI Service Suffers Major Outage
Read more of this story at Slashdot.
ATM Fees Are at a Record High, a New Survey Finds
Read more of this story at Slashdot.
Wyden Says Microsoft Flaws Led to Hack of US Hospital System
Read more of this story at Slashdot.
iPhone 17 Air Drops Physical SIM Slot Globally, Pushing eSIM-Only Future
Read more of this story at Slashdot.
FAA Warns Airlines About Lithium Battery Dangers After 50 Incidents This Year
Read more of this story at Slashdot.
Bending Spoons Buys Video Platform Vimeo for $1.38 Billion
Read more of this story at Slashdot.
iPhones 17 and the Sugar Water Trap
Read more of this story at Slashdot.