Classic WTF: NoeTimeToken
by in Feature Articles on 2025-06-26Maybe we'll just try and read a book. That's a good way to spend your vacation. This can't possibly go badly! Original --Remy
"Have you had a chance to look at that JIRA ticket yet?"
Maybe we'll just try and read a book. That's a good way to spend your vacation. This can't possibly go badly! Original --Remy
"Have you had a chance to look at that JIRA ticket yet?"
Where did you GOTO on your vacation? Nowhere. GOTO is considered harmful. Original --Remy
Everybody knows that you should never use "goto" statements. Well, except in one or two rare circumstances that you won't come across anyway. But even when you do come across those situations, they're usually "mirage cases" where there's no need to "goto" anyway. Kinda like today's example, written by Jonathan Rockway's colleague. Of course, the irony here is that the author likely tried to use "continue" as his label, but was forced to abbreviate it to "cont" in order to skirt compiler "reserved words" errors.
As our vacation continues, we might want to maybe play some video games. What could possibly go wrong? Original --Remy
“You R haccking files on my computer~!!!” Charles Carmichael read in a newly-submitted support ticket, “this is illigle and I will sue your whoal compiny. But first I will tell every1 nevar to buy youre stupid game agin.”
The bizarre spelling and vague threats were par for the course. After all, when you market and sell a game to the general public, you can expect a certain percentage of bizarre and vague customer communications. When that game is a popular MMPORG (no, not that one), that percentage tends to hover around the majority.
It's summer break time, here at TDWTF, and based on this classic, we shouldn't be traveling by bus. Original --Remy
Rachel started working as a web developer for the local bus company. The job made her feel young, since the buses, the IT infrastructure, and most of their back-office code was older than she was. The bus fare-boxes were cash only, and while you could buy a monthly pass, it was just a little cardboard slip that you showed the driver. Their accounting system ran on a mainframe, their garage management software was a 16-bit DOS application. Email ran on an Exchange 5.5 server.
Just a quick note this week: I discovered that many people have been sending in submissions for this column and designating them for CodeSod by mistakes. Consequently, there is an immense backlog of material from which to choose. An abundance of riches! We will be seeing some older items in the future. For today, a collection of colons:
Bill NoLastName , giving away clues to his banking security questions online: "If had known there was a limit, I would have changed my daughter's middle name. I've been caught by this before - my dad has only a middle initial (no middle name)."
If you write a lot of Java, you're going to end up writing a lot of getters and setters. Without debating the merits of loads of getters and setters versus bare properties, ideally, getters and setters are the easiest code to write. Many IDEs will just generate them for you! How can you screw up getters and setters?
Well, Dave found someone who could.
Many a network admin has turned to the siren song of Perl to help them automate managing their networks. Frank's predecessor is no exception.
They also got a bit combative about people critiquing their Perl code:
Ah, bad date handling. We've all seen it. We all know it. So when Lorenzo sent us this C# function, we almost ignored it:
private string GetTimeStamp(DateTime param)
{
string retDate = param.Year.ToString() + "-";
if (param.Month < 10)
retDate = retDate + "0" + param.Month.ToString() + "-";
else
retDate = retDate + param.Month.ToString() + "-";
if (param.Day < 10)
retDate = retDate + "0" + param.Day.ToString() + " ";
else
retDate = retDate + param.Day.ToString() + " ";
if (param.Hour < 10)
retDate = retDate + "0" + param.Hour.ToString() + ":";
else
retDate = retDate + param.Hour.ToString() + ":";
if (param.Minute < 10)
retDate = retDate + "0" + param.Minute.ToString() + ":";
else
retDate = retDate + param.Minute.ToString() + ":";
if (param.Second < 10)
retDate = retDate + "0" + param.Second.ToString() + ".";
else
retDate = retDate + param.Second.ToString() + ".";
if (param.Millisecond < 10)
retDate = retDate + "0" + param.Millisecond.ToString();
else
retDate = retDate + param.Millisecond.ToString();
return retDate;
}
Yitzchak was going through some old web code, and found some still in-use JavaScript to handle compatibility issues with older Firefox versions.
if ($.browser.mozilla &&
$.browser.version.slice(0, 1) == '1')
{
…
}
Time Lord Jason H. has lost control of his calendar. "This is from my credit card company. A major company you have definitely heard of and depending upon the size of the area you live in, they may even have a bank branch near you. I've reloaded the page and clicked the sort button multiple times to order the rows by date in both ascending and descending order. It always ends up the same. May 17th and 18th happened twice, but not in the expected order." I must say that it is more fun when we know who they are.
Dan's co-workers like passing around TDWTF stories, mostly because seeing code worse than what they're writing makes them feel less bad about how often they end up hacking things together.
One day, a co-worker told Dan: "Hey, I think I found something for that website with the bad code stories!"
Our anonymous submitter, whom we'll call Carmen, embarked on her IT career with an up-and-coming firm that developed and managed eCommerce websites for their clients. After her new boss Russell walked her around the small office and introduced her to a handful of coworkers, he led her back to his desk to discuss her first project. Carmen brought her laptop along and sat down across from Russell, poised to take notes.
Russell explained that their newest client, Sharon, taught CPR classes. She wanted her customers to be able to pay and sign up for classes online. She also wanted the ability to charge customers a fee in case they cancelled on her.
We've talked about ASP .Net WebForms in the past. In this style of development, everything was event driven: click a button, and the browser sends an HTTP request to the server which triggers a series of events, including a "Button Click" event, and renders a new page.
When ASP .Net launched, one of the "features" was a lazy repaint in browsers which supported it (aka, Internet Explorer), where you'd click the button, the page would render on the server, download, and then the browser would repaint only the changed areas, making it feel more like a desktop application, albeit a laggy one.
Eddie's company hired a Highly Paid Consultant to help them retool their systems for a major upgrade. Of course, the HPC needed more and more time, and the project ran later and later and ended up wildly over budget, so the HPC had to be released, and Eddie inherited the code.
What followed was a massive crunch to try and hit absolutely hard delivery dates. Management didn't want their team "rewriting" the expensive code they'd already paid for, they just wanted "quick fixes" to get it live. Obviously, the HPC's code must be better than theirs, right?
... London!
This week, we're showcasing some multiple submissions from two
regular participants who fell into the theme. Everybody else is
just going to have to wait for their turn next week.
Frist up it's Daniel D. "I wanted to see events for the dates I would be in London. Is Skiddle (the website in question) telling me I should come to London more often?" They're certainly being very generous with their interpretation of dates.
One of the key points of confusion for people unfamiliar with Java is the distinction between true object types, like Integer
, and "primitive" types, like int
. This is made worse by the collection types, like ArrayList
, which needs to hold a true object type, but can't hold a primitive. A generic ArrayList<Integer>
is valid, but ArrayList<int>
won't compile. Fortunately for everyone, Java automatically "boxes" types- at least since Java 5, way back in 2004- so integerList.add(5)
and int n = integerList.get(0)
will both work just fine.
Somebody should have told that to Alice's co-worker, who spends a lot of code to do some type gymnastics that they shouldn't have:
Today's short function comes from Janusz, and it's anything you want it to be:
public static function isAnything($data)
{
return true;
}
A recent code-review on a new build pipeline got Sandra's attention (previously). The normally responsible and reliable developer responsible for the commit included this in their Jenkinsfile:
sh '''
if ! command -v yamllint &> /dev/null; then
if command -v apt-get &> /dev/null; then
apt-get update && apt-get install -y yamllint
elif command -v apk &> /dev/null; then
apk add --no-cache yamllint
elif command -v pip3 &> /dev/null; then
pip3 install --break-system-packages yamllint
fi
fi
find . -name '*.yaml' -exec yamllint {} \\; || true
find . -name '*.yml' -exec yamllint {} \\; || true
'''
Frederico planned to celebrate the new year with friends at the exotic international tourist haven of Molvania. When visiting the area, one could buy and use a MolvaPass (The Most Passive Way About Town!) for free or discounted access to cultural sites, public transit, and more. MolvaPasses were available for 3, 7, or 365 days, and could be bought in advance and activated later.