programmer_humor

This magazine is from a federated server and may be incomplete. Browse more on the original instance.

irdc, in Welcome to the wonderful world of code obfuscation

<span style="color:#323232;">weekend = day_of_week in (“sat”, “sun”)
</span>

As a bonus this completely sidesteps the issue of what day is 0 or 1.

xav, in GoOn

I’ll start.

0.0.0.1: Sophie

Your turn.

starman2112,
@starman2112@sh.itjust.works avatar

0.0.0.2 is Bob

xmunk, in Welcome to the wonderful world of code obfuscation

As a Real Programmer™ I have developed such a deep fear of anything time and date related that I would fully endorse dispatching an API call to the tz_database instead of attempting any fucking part of this.

Kids, it’s fine to meme about silly stuff… but date and time is deadly serious, regardless of how careful you think you’re being you are wrong.

Do you know how many timezones there are in Indiana? No? Look it up and scream in horror.

AndyLikesCandy,

Here’s a fun thought experiment: What gregorian year and date will the spacian date value of zero correlate to? Trick question.

The atomic clock on the moon and every other celestial body colonized will simply start at zero, and thanks to relativity it will not actually be the same rate of time passing as on earth.

Enjoy your nightmares.

sunbeam60,

What if I told you that weekend days are locale dependent?!

Time and date is the black hole where optimistic programmers go to die. Nothing is simply with localisation and if you think it is, you mustn’t have worked enough with it.

Source: Run a system that schedules millions of interactions across the world and deeply depend on this. The amount of code to manage and/or call out to external services to give us information about time zones, summer time, locale specific settings, day names, calendar systems, week numbers etc etc.

kogasa,
@kogasa@programming.dev avatar

IMO every datetime should be in utc, and variables for datetimes should either be suffixed “Utc” or have a type indicating their time zone (DateTimeOffset or UtcDateTime etc). Conversion to local time happens at the last possible second (e.g. in the view model or an outbound http request parameter). Of course that doesn’t solve the problem of interoperating with other morons programmers who don’t follow these rules, but it keeps things a lot neater locally.

Scheduling based on regional time conventions (holidays, weekends, etc) is just not great though.

DAMunzy,

2 timezones but the complication is that it is dependent on which country you’re in?

dan, in GoOn
@dan@upvote.au avatar

This reminds me of something I saw online maybe 20 years ago now. Someone created a torrent with a name like “every IP address ever (hacking tool)” and uploaded it to Suprnova, which ended up having thousands of people seeding it. It was just a text file with every IPv4 from 0.0.0.0 to 255.255.255.255 😂

coloredgrayscale,

Heard about that too! Is there an updated version for ipv6?

space, in Welcome to the wonderful world of code obfuscation

You want to expand your business to Europe. Bam, your code is broken, in Europe the week starts on Monday.

Than you want to expand to the middle east. Bam, broken again… Because in arab countries and Israel, the weekend is on Friday and Saturday.

Then you want to expand to Mexico and India. Bam, broken again, their weekend is only on Sunday.

henfredemars, in Debugging

You’re sure that there was a crime? You’re fortunate that your bug is consistently reproducible.

Gormadt,
@Gormadt@lemmy.blahaj.zone avatar

My “favorite” is when following the steps to reproduce a specific bug you get an entirely different bug then what was reported

AnarchoSnowPlow, in me_irl

Also me waiting for the junior dev to address review comments satisfactorily.

DeltaTangoLima, in Debugging
@DeltaTangoLima@reddrefuge.com avatar

My biggest problem isn’t discovering my own crime. It’s trying to determine what my motive was at the time.

Gormadt,
@Gormadt@lemmy.blahaj.zone avatar

Usually my motive is, “It’s 3am I’ll just put this temp placeholder here and fix it in the morning.”

Proceeds to not fix it due to forgetting by the morning

DieguiTux8623, in me_irl

The worst case is when someone requires changes, you address them, but then they disappear/go on a leave.

If the repository rules require all conversations to be resolved before merging and only the original reviewer can mark them as solved, the PR is stuck forever even if the rest of the team approves it.

teft, in Me trying to fix a complex bug that's not important
@teft@startrek.website avatar

How some people are in comments. Always gotta get that one last comment in the chain in.

ErKaf,

I disagree

Matombo, in Welcome to the wonderful world of code obfuscation

Ok another US local units are retarded rant: it’s called weekEND! why do you start your week at sunday and not monday! Sunday is part of the weekEND!

candyman337, in Password requirements are getting out of hand

“Password length requirements: 6 inches”

Guy tries to make an account

“Password requirements not met”

“Bro I swear that’s 6 inches 😢”

dingleberry,

Can’t login when it’s cold.

mattd,

My password was in the pool!

lurch, in Password requirements are getting out of hand

Pretty unsafe, because it makes people prefer big letters, i.e. W

plistig,

That’s why my password consists exclusively out of Assyrian cuneiform letters, e.g.

https://en.wiktionary.org/wiki/File:Assyrian_cuneiform_U12030_MesZL_293.svg

Yes, that’s one letter.

Blackmist, in Me trying to fix a complex bug that's not important

That moment where you finally convince your boss it’s not worth fixing, and then you instantly think of a way to easily solve it.

onlinepersona, in Yes

The dude on the right is some neckbeard who yells “RTFM” and “i use Arch btw ;)” IRL.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • programmer_humor@programming.dev
  • localhost
  • All magazines
  • Loading…
    Loading the web debug toolbar…
    Attempt #