this post was submitted on 08 Nov 2025
219 points (97.0% liked)

Programmer Humor

27248 readers
872 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] palordrolap@fedia.io 6 points 1 day ago (1 children)

Wait until you learn how months are numbered in some programming languages.

The clever documentation calls it "months since January".

[–] brotundspiele@sh.itjust.works 1 points 18 hours ago (1 children)

JavaScript: Hold my Date!

new Date().getYear() == 125

[–] palordrolap@fedia.io 2 points 17 hours ago

JavaScript is in that set of "some" languages. Most of it ties back to C's struct tm which zero-indexes months (0-11), weekdays (0-6), and the rarely used day of year (0-365), as well as offsetting years by 1900.

The odd man out, so to speak, is the date (or "mday" as it's called there), which is in the range 1-31. One (Perl) book I own suggests that the zero-based ones are used to index arrays of strings and implies this one is different because it generally isn't used that way.

But anyway, these are decisions made 50 years ago that still haunt us.