Feed aggregator
New Jersey Sues Property Management Software Firm RealPage, Says Collusion With Landlords Drives Up Rents
Read more of this story at Slashdot.
Draft Executive Order Outlines Plan To Integrate AI Into K-12 Schools
Read more of this story at Slashdot.
Google Gemini Has 350 Million Monthly Users, Reveals Court Hearing
Read more of this story at Slashdot.
WhatsApp Blocks People From Exporting Your Entire Chat History
Read more of this story at Slashdot.
D&D Updates Core Rules, Sticks With CC License
Read more of this story at Slashdot.
Discord's CEO and Co-Founder Is Stepping Down
Read more of this story at Slashdot.
Meta Rolls Out Live Translations To All Ray-Ban Smart Glasses Users
Read more of this story at Slashdot.
AI Secretly Helped Write California Bar Exam, Sparking Uproar
Read more of this story at Slashdot.
OpenAI Forecasts Revenue Topping $125 Billion in 2029 as Agents, New Products Gain
Read more of this story at Slashdot.
Nintendo Seeks Discord User's Identity Following Major Pokemon Leak
Read more of this story at Slashdot.
Apple, Meta Fined as EU Presses Ahead With Tech Probes
Read more of this story at Slashdot.
More Than 80% of the World's Reefs Hit By Bleaching After Worst Global Event On Record
Read more of this story at Slashdot.
Amazon's Starlink Rival Struggles To Ramp Up Satellite Production
Read more of this story at Slashdot.
On YouTube's 20th Anniversary, the Platform Says Over 20 Trillion Videos Have Been Uploaded
Read more of this story at Slashdot.
UBS and Gartner Trim Smartphone, PC Forecasts Amid Tariff Fears
Read more of this story at Slashdot.
Deep-Sea Fishers Fight for Wi-Fi
Read more of this story at Slashdot.
Shopify Must Face Data Privacy Lawsuit In US
Read more of this story at Slashdot.
California Is About To Run Out of License Plate Numbers
Read more of this story at Slashdot.
CodeSOD: Dating in Another Language
It takes a lot of time and effort to build a code base that exceeds 100kloc. Rome wasn't built in a day; it just burned down in one.
Liza was working in a Python shop. They had a mildly successful product that ran on Linux. The sales team wanted better sales software to help them out, and instead of buying something off the shelf, they hired a C# developer to make something entirely custom.
Within a few months, that developer had produced a codebase of 320kloc I say "produced" and not "wrote" because who knows how much of it was copy/pasted, stolen from Stack Overflow, or otherwise not the developer's own work.
You have to wonder, how do you get such a large codebase so quickly?
private String getDatum() { DateTime datum = new DateTime(); datum = DateTime.Now; return datum.ToShortDateString(); } public int getTag() { int tag; DateTime datum = new DateTime(); datum = DateTime.Today; tag = datum.Day; return tag; } private int getMonat() { int monat; DateTime datum = new DateTime(); datum = DateTime.Today; monat = datum.Month; return monat; } private int getJahr() { int monat; DateTime datum = new DateTime(); datum = DateTime.Today; monat = datum.Year; return monat; } private int getStunde() { int monat; DateTime datum = new DateTime(); datum = DateTime.Now; monat = datum.Hour; return monat; } private int getMinute() { int monat; DateTime datum = new DateTime(); datum = DateTime.Now; monat = datum.Minute; return monat; }Instead of our traditional "bad date handling code" which eschews the built-in libraries, this just wraps the built in libraries with a less useful set of wrappers. Each of these could be replaced with some version of DateTime.Now.Minute.
You'll notice that most of the methods are private, but one is public. That seems strange, doesn't it? Well this set of methods was pulled from one random class which implements them in the codebase, but many classes have these methods copy/pasted in. At some point, the developer realized that duplicating that much code was a bad idea, and started marking them as public, so that you could just call them as needed. Note, said developer never learned to use the keyword static, so you end up calling the method on whatever random instance of whatever random class you happen to have handy. The idea of putting it into a common base class, or dedicated date-time utility class never occurred to the developer, but I guess that's because they were already part of a dedicated date-time utility class.
[Advertisement] BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how!Yahoo Will Give Millions To a Settlement Fund For Chinese Dissidents
Read more of this story at Slashdot.