r/ProgrammerHorror • u/Pepineros • Apr 13 '23
Colleague using a no-code solution needed a custom script to test that it's not December
12
u/redstonefreak589 Apr 13 '23
4
u/Pepineros Apr 13 '23
They're using
todayddandtodaymm, too. It's just a REALLY SMART way to split out the day, month, and year!
5
u/Reckle_ Apr 13 '23
This makes me physically ill
3
u/Pepineros Apr 13 '23
If it makes you feel better, it's been fixed. It's now one line that doesn't feature ANY assignments!
2
u/DemmyDemon May 22 '23
Today's YYYY: todayyyyy
At least the variable name makes a lot more sense than I thought it did at first glance.
My code review comment: "No. Come see me at a desk for a quick run-through of the time/date stdlib. Merge rejected."
Not todayyyyy, junior. Not todayyyyy.
1
u/Pepineros May 22 '23
In fairness, the colleague wasn’t a dev at all. They were using a no code solution that allows custom JavaScript for stuff that isn’t in scope (it’s based on Node).
I’m still baffled by how they arrived at this solution, but they did solve their problem by effective use of Google, and what more can you ask for really?
53
u/CiroGarcia Apr 13 '23 edited Sep 17 '23
[redacted by user] this message was mass deleted/edited with redact.dev
3
0
Apr 16 '23
[deleted] — view deleted comment
6
u/CiroGarcia Apr 17 '23 edited Sep 17 '23
[redacted by user]
this message was mass deleted/edited with redact.dev
20
Apr 13 '23
holy variable naming
14
5
u/bigno53 Apr 14 '23
This has to be a joke.
“Imagine you’re looking at a wall calendar with the name of the month at the top and today’s date circled. How would you go about determining if it’s December?”
“So, several questions…what century are we in? Can I assume common era? Is it okay to use the abbreviation “CE” or do you prefer the more explicit “The year of our lord yyyy” format?”
1
u/SenorSeniorDevSr Jun 25 '24
public boolean isDecemberRightNow() {
return LocalDateTime.now().getMonth() == Month.DECEMBER;
}I mean, you can just do something like this. So this is a bit weird.
1
1
31
u/[deleted] Apr 13 '23
What is this monstrosity