Katie Price displays her VERY taut visage while taking her puppy for a walk in Rhyl ahead of adult Easter pantomime in Wales
What it's really like to be a Norland Nanny: Student at school where royal childcare experts train reveals hers day-to-day including tiny bedrooms, defence lessons and incredible perks
Freddie Mercury's sister 'secretly spends £3M to get back singer's memorabilia amid battle with his 'wife' Mary Austin over star's possessions'
Listed: The hardest primary schools to get into in Essex this year revealed
Listed: The hardest primary schools to get into in Essex this year revealed
Elizabeth Hurley shares sneak peek inside new life with 'hillbilly' lover Billy Ray Cyrus
Mark Rylance blasts Labour council over star-studded festivals that campaigners say are turning loved local park into 'a prison camp'
Revealed: The royal who wanted to 'shoot' Queen Elizabeth's corgis
The telltale signs YOU might be sexually repressed: TRACEY COX speaks to people who struggle with shame in the bedroom who reveal how religion has ruined sex
Resident rescued after fire broke out in garage
Ella Rae Wise leaves CBB house with concerns over fellow contestant
The incredible house hidden in plain sight that thousands of people walk past each day but have 'no idea it's there'
California Is About To Run Out of License Plate Numbers
Read more of this story at Slashdot.
Man who raped woman in storeroom at workplace party jailed
Britain's 'worst' seaside town getting £23 million upgrade
Tensions flare among clerics who will choose Pope Francis' successor amid claims 'old cardinals from peripheries' have been sidelined from meetings
Major high street retailer announces nine store closures within weeks - is YOUR local branch affected?
The 6 most common dreams - and what they REALLY mean
Inside Justin Bieber's shrinking inner circle amid his former best man's fears over his 'cult-like' church
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.