r/ProgrammerHumor • • 12d ago • Regret 1

Meme bugsExclusivelyOnSunday

Post image
4.6k Upvotes

438 comments sorted by

853

u/Alacritous13 12d ago

I had a error in a batch script with a timestamp because the time is returned as a string and I assumed a leading zero ahead of single digit hours. Program failed before 10am. It was suppose to run automatically at 1am, I never worked before 10am, it took a long time to diagnose.

283

u/CubicalPayload 12d ago

This is why we need to abolish the concept of time. Yes it will have wide-reaching negative consequences in all aspects of life, but programming will be made significantly easier and that is a sacrifice I am willing to make.

79

u/setibeings 12d ago

Let's circle back to this idea on November 31st.

22

u/ThePhyseter 12d ago

I would bet with Javascript that will be possible

7

u/setibeings 12d ago

I'm sure there's a way to get the language to try to treat that as something other than a programming error, but Temporal.Instant at very least definitely won't let you do that. Try this:

console.log(Temporal.Instant.from("2026-11-31T00:00:00Z"));

→ More replies (1)

3

u/Motorslam99 12d ago

All things are possible; through javascript

2

u/WernerderChamp 12d ago

We did indeed have a minor outage due to November 31.

This is what you get by implementing "expiration in 1 month" by just incrementing the month. Turns out the DB does not like invalid dates...

→ More replies (1)

35

u/Steinrikur 12d ago

Don't abolish, standandize. Abolish the people who can't write according to the standard.

6

u/cgebaud 11d ago

Depending on the standard that gonna be at least a few countries worth of people to be abolished.

12

u/Xywzel 11d ago

Or just one more standard.

→ More replies (1)

2

u/Leftover_Salad 12d ago

They got rid of the leap second for us

236

u/Newepsilon 12d ago

My dumbass was about to say, "why didn't you just step through the program" before realizing that would only catch it if you were debugging before 10 am lol.

87

u/Alacritous13 12d ago edited 12d ago

Yeah. The only thing I had to know it failed was a lack of a timestamped file in my output folder. I ran for a month on the assumption the task scheduler was failing.

16

u/AyrA_ch 12d ago

Also as far as I know, you cannot actually step through batch files. You can do so with powershell scripts, and even set breakpoints, but cmd lacks such an integration.

The date and time fields in cmd is cursed anyways because the values are formatted according to the computers locale.

4

u/barthvonries 12d ago

Bash can have a lot of debug output though, especially the variable values every time they change, so that problem would have been easy to diagnose. Even more with some "echo $VAL >> /var/log/myscript.log" to check if everything was going fine.

4

u/StrangelyBrown 12d ago

realizing that would only catch it if you were debugging before 10 am

or, you know, had unit tests...

8

u/viviyawna 12d ago

iso 8601 my beloved

→ More replies (2)

3

u/scalyblue 12d ago

Do it by Unix time then you don’t need to worry for two more years

1

u/joanna-4637 9d ago

Parse the hour as a number before using it; `9` and `09` should compare the same.

1

u/wasd0109 12d ago

Similar issue, we are in Japan which is GMT+9. Our working hour also start from 9am so a lot of time zone issue get missed because we are always running the test after the period with possible issues.

249

u/y0shii3 12d ago

This is why crontab allows both 0 and 7 to indicate Sunday

63

u/e1ectrofern 12d ago

Yeah, when I saw that first, I was a bit confused, but then it dawned on me and it makes so much sense.

227

u/akazakou 12d ago

Do not tell him there are timezones that differ by half an hour.

98

u/mikegalos 12d ago

And quarter hour. And that they change on different days of the year.

31

u/thespud_332 12d ago

And three quarter hour in a tiny portion of Western Australia

8

u/ardarian262 11d ago

Nepal has a very specific timezone. +5:45

5

u/adeadhead 11d ago

Wait. There are?

5

u/mikegalos 11d ago

Yep. A couple were mentioned in replies.

3

u/Lithl 11d ago

Nepal is UTC+5:45

Eucla, Australia is UTC+8:45

Chatham Islands, New Zealand is UTC+12:45

5

u/backfire10z 11d ago

There’s also a timezone that differs by 2 hours: Troll, Antarctica.

7

u/UnrealBee 12d ago

What? 

22

u/timsredditusername 12d ago • Mindblown

there are timezones that differ by half an hour.

5

u/UnrealBee 11d ago

I understood the wording. My what was because of the disbelief 

10

u/marcelsmudda 11d ago • Mindblown

In case you haven't heard it: THERE ARE TIMEZONES THAT ARE OFFSET BY HALF AN HOUR!

2

u/UnrealBee 11d ago

Sorry could you tell me like I'm 3. I hear what you tell but I don't get it

Like for real? Offset by 30 minutes? (going to Google it now) 

4

u/Blue_Moon_Lake 11d ago

Yes and worse.

At least with 15, 20, 30, 40, and 45 there's some kind of neat fraction.

Now imagine

  • 24 minutes
  • 44 minutes
  • 51 minutes
  • 9 minutes and 21 seconds
  • 25 minutes and 21 seconds
  • 39 minutes and 18 seconds

3

u/johnwilkonsons 11d ago

Haha Amsterdam used to have UTC+01:19:32.13 for like 20 years

→ More replies (3)
→ More replies (1)
→ More replies (1)

125

u/Countach3000 12d ago • Bravo

Thats why the bible says "thou shall not execute code on the sabbath". God created the code base in six days, then he shut down the servers to avoid stuff like this.

1.1k

u/RedAndBlack1832 12d ago

Read the documentation moment

346

u/DarthKirtap 12d ago

do you read documentation, when January has index 1?

63

u/greenpepperpasta 12d ago

Remind me of The Elder Scrolls III: Morrowind, where the in-game date jumps from the end of the final month of the year (Evening Star) to the beginning of the second month (Sun's Dawn), skipping over the first month (Morning Star).

  This was caused by an "off-by-one error": although the "GameMonth" value counted months from 0 to 11, the developers incorrectly set it to month 1 after reaching the end of the year, assuming the months would count from 1 to 12. 

16

u/setibeings 12d ago

were they able to patch this, or did players just have to live with that?

→ More replies (4)

100

u/BigGuyWhoKills 12d ago

I do when I get an invalid index error. But I also never assume an index starts at 1.

45

u/GresSimJa 12d ago

Lua devs would have your head for that comment.

→ More replies (12)

20

u/mjec 12d ago

January is semantically represented by 1; month number is not an index, but a natural human representation. Days, however, do not have a natural numerical representation, hence precisely the issue here.

10

u/werm_on_a_string 12d ago

I think the person you’re replying to was suggesting “if you saw January was indexed ‘1’ would you think to check if December was ‘0’?” Which is a fair question. Presumably the person saw Monday = 1 and assumed it went up to Sunday = 7. Days also absolutely have a natural numerical representation. The first, second, third, etc. day of the week being 1, 2, 3, etc. makes perfect sense.

→ More replies (1)

16

u/DarthKirtap 12d ago

only in english, in different languages, some days are derived from numbers

→ More replies (8)

2

u/evenstevens280 11d ago edited 11d ago

This is a silly argument

If years, months and weeks are representable by a number, then so too should days

→ More replies (1)
→ More replies (1)

117

u/Automatic-Tackle5018 12d ago

I respect the hell out of Tsoding's abilities, but he also annoys me intensely because he never reads the docs. He kinda makes a sport out of figuring things out via error messages (as shown here) or by just reading the source, which is kind of impressive in itself, but yeah. Sometimes the dude would save a lot of time and effort just reading the docs.

57

u/MedicatedDeveloper 12d ago

I feel like it's a good example of someone with a high level of skill using play to learn. Programming is a puzzle. He's playing to solve that puzzle in a curious and intuitive fashion instead of trying to solve the puzzle using the picture on the box.

You see this same type of play to learn if you watch George Hotz or Jonathan Blow coding streams. I feel that this is the secret of top 1% developers. It's not the actual programming that makes them so skillful but the process in which they play to internalize new ideas using their own foundational knowledge.

22

u/AbstractContract 12d ago

Sounds like programming with AuDHD. 

5

u/Automatic-Tackle5018 12d ago

Yes, this.

I qualified my original comment by adding that it annoys me when I'm familiar with the library he's using. When I am not familiar, it is quite fascinating.

11

u/gizahnl 12d ago

Since when is "use the source Luke" impressive?!?

6

u/Automatic-Tackle5018 12d ago

I suppose by 'impressive' I'm speaking more to his absolute commitment to the 'no docs' shtick, than I am to using the source specifically.

→ More replies (2)

3

u/Many_Replacement_688 12d ago

on being lazy and not reading docs, aren't we all?

→ More replies (2)

3

u/AWzdShouldKnowBetta 12d ago

Psh documentation?! What's that? This is a unit test for sure. Hell it's a "should have used a pre-existing library" moment at minimum.

117

u/Jock-Tamson 12d ago

A bug from some late 90s C++ code that has stayed with me forever:

Someone had clearly created an array of day or week constants by sloppy copying

SUNDAY, MONDAY, FEBRUARY, WEDNESDAY…

It was blindingly obvious when I looked at the code.

But of course you need to know where to look, and because the result was that the code didn’t work on Tuesdays except in February. I first had to work through.

“App is failing”

“How so that I can replicate it?”

“Never mind it’s working again”.

“Well if it happens again capture the error message and give me repo steps if you can.”

“Okay”

“App is failing”

“Did you get the error message? Any repo steps? It works for me.”

“No. Let me do it again”

“Never mind it’s working now”

Wash rinse repeat for weeks until someone would tell me how it was actually failing.

230

u/FAMICOMASTER 12d ago

1 second of reading for 7 weeks of debugging

85

u/DownwardSpirals 12d ago

I usually open the docs around week 5.

31

u/sixouvie 12d ago

The what ?

31

u/Active_Name5021 12d ago

What PL is this?

27

u/Lunagato20 12d ago

Looks to be Jai, im quite surprised too its used in context outside of game development

22

u/Cutalana 12d ago

for more context, JAI is a programming created by Jonathan Blow, a game developer, and is what he used for his newest game. It's been in development for more than a decade now, but only a few people have been given access. It's expected to be released to the public soon but it's uncertain.

4

u/Lunagato20 12d ago

Yup, i have seen some previews of it from various youtubers, but eh, i like odin better, and i can try it myself since its already released.

6

u/humanbeast7 12d ago

Am I the only one who thought .jai was for Java Artificial Intelligence? As in yet another Java sub-language developed specifically for AI purposes?

19

u/MXRCO007 12d ago

Tsoding just programs whatever comes up in his head

5

u/Active_Name5021 12d ago

Ohhhh, it's Jonathan Blow's game programming language. Never seen it in the wild before

56

u/Azilen 12d ago

But this isn't an exclusive american thing.

29

u/TrekkiMonstr 12d ago

It's not even an American thing at all, everyone here seems to consider Monday as start of week.

30

u/HandleUnlikely2589 12d ago

American (as in USA) calendars (if not specifically focused on the work week) all show Sunday as the first column, Saturday as the last. Never seen an exception that was marketed to the general public here.

Sure, we call Saturday and Sunday the weekend, but nobody said which end. So we split the difference. /s

→ More replies (5)

23

u/Stormdancer 12d ago

As an American, I have never understood why we start with Sunday.

I'm not even particularly religious, and it just seems like Sunday should be the last day of the week. Plus, on calendars, it puts your weekend days together. WTF.

8

u/seedless0 12d ago

Think of it as a payment plan or financing. You get the instant gratification then spend the next 6 days to pay it back.

It can't be more American than this.

1

u/conundorum 11d ago edited 11d ago

Sunday is the frontend, Saturday is the backend. The week exists between the ends. Just like a line segment: It has two ends, one on each side of the line.


We count it that way because the Jewish calendar placed the Sabbath as the seventh day, because that's the day God rested because creation was done and there was nothing left to add. Thus, the last day of the week became their day of rest and fellowship with God. And then Jesus was crucified on the day before the Sabbath, and rose again on (during) the day after the Sabbath, which was subsequently referred to as the Lord's day (officially formalised by Constantine, though in use before then). Thus, the first day of the week became the Christian day of rest and fellowship with God (while the Jewish day was still recognised and followed by early Christians, because most early Christians were devout Jews that believed in Jesus as the Messiah, the fulfillment of prophecy). And eventually, Rome began to observe this same pattern, because Rome had a decent Jewish population and was growing more and more Christian, and people weren't willing to work on either the first day or the Sabbath; their 8-day week wasn't working as well as the 7-day week, since it turns out that clamping the values to holiness makes the equations divine.

And ever since, we have classified this pair of "last day of one week, and first day of the next week" as the "weekend". It's not the week's rear end, and never was; the intent was that the "weekend" is the two days that sit at either end of the week, because weeks are incremental.

[This is also why we distinguish the "work week" from the "weekend", since the "work week" is the non-rest portion of the week that begins on Monday and ends on Friday.]

22

u/GrinningPariah 12d ago

They say age ain't nothing but a number, and the same is true for the date.

Leave all times as epoch milliseconds if at all possible. Translating to the appropriate human-readable time is a job for the UI layer.

1

u/slindenau 12d ago

Believe it or not, but some people want the epoch stored in their local timezone instead of utc. ISO with offset still remains the most accurate.

→ More replies (6)

275

u/CeruleanSovereign 12d ago

Wtf why do Americans not even do days of the week in the right order?

195

u/NeXtDracool 12d ago

That's not that uncommon to be fair. My browser currently supports 246 locales, 80 of which use Sunday as the first day of week, 8 use Saturday, the rest uses Monday.

23

u/m_redditUser 12d ago

i personally setup my calendars to start weeks on saturday bc i plan out the weeks on the weekends

62

u/Eliaskw 12d ago

More like weekstarts in that case

6

u/m_redditUser 12d ago

actually, yea

→ More replies (1)

6

u/AliStarr182 12d ago

I use Sunday/Saturday as margins or padding for my work calendar

5

u/AyrA_ch 12d ago

I hide them from my work calendar because I don't work then

3

u/AshtonCopernicus 12d ago

Gotta start the week with the strongest days. The rest are weakdays.

0

u/[deleted] 12d ago

[deleted] — view deleted comment

→ More replies (1)

5

u/IntentionQuirky9957 12d ago

Saturday is bonkers.

75

u/obliqueoubliette 12d ago

Traditional Christian and Jewish calendars have Sunday as the first day of the week.

For this reason, Constantine moved the Roman Empire off its 8-day "market week" and onto the current 7-day week in 321 - simultaneously declaring the Lord's Day (Sunday) as the first day of the week.

It's not until the 1970's and 1980's that European nations swapped the first day from Sunday to Monday.

6

u/lxpnh98_2 12d ago

In Portuguese, Monday is "segunda-feira", literally meaning 2nd fair, and it goes like that until "sexta-feira" (6th fair), then "sábado" and then "domingo".

4

u/CeruleanSovereign 11d ago

Wait what was the missing 8th day called?

5

u/Flimsy_Meal_4199 11d ago

The Romans were lame about it and just indexed with letters A-H

3

u/CeruleanSovereign 11d ago

Love it, we should have kept letters for days

→ More replies (2)

25

u/moduspol 12d ago

Even that doesn’t make sense. The Bible says God rested on the seventh day, not the first.

43

u/linmanfu 12d ago

And the Jewish Sabbath is on the seventh day, by this count. That still leaves Sunday as the first day of the week 

(There is a slight wrinkle in that the Jewish calendar begins days at sunset while most other people today begin dates at midnight, but that doesn't affect this point.)

25

u/gtne91 12d ago

Yes, and Saturday is the 7th day. Making Sunday the first.

21

u/obliqueoubliette 12d ago

Yes. Saturday is the seventh day.

Christians celebrate Sunday as "the Lord's Day" because of Christ's resurrection.

→ More replies (9)
→ More replies (1)

62

u/PagKev 12d ago

i mean, monday being the first day is a new thing. uN/ISO norm only changed in 1975 to make it so, it was treaded as such. sundway was the traditional first day until the 5 days work week got prominent, long enough

56

u/patiofurnature 12d ago

We probably got them from Canada, Brazil, Mexico, Japan, South Korea, India, Israel, Saudi Arabia, Yemen, South Africa, or the Philippines.

18

u/A_Dull_Proposal 12d ago

I see a pattern

11

u/patiofurnature 12d ago

What is it? Genuinely - not being a smartass. Just dumb.

→ More replies (9)
→ More replies (1)

13

u/zeekar 12d ago

We do them in the right order; we just start in a different spot: Sunday comes first. And we're less alone in this than we are on the whole not-metric or m/d/y fronts.

In tm_wday Sunday is day 0; in ISO 8601 it's day 7. If you're counting mod 7 those are the same number.

32

u/Gaxyhs 12d ago

as much as I like to bash on the US for using the weirdest and least intuitive systems, here in Brazil it also starts on Sunday

At least from my perspective is that Saturday and Sunday are both ends of the week, hence weekend, picture the week as a line basically

3

u/doskkyh 12d ago

The day named "Second" being the first day of the week would be weird.

→ More replies (3)
→ More replies (8)

20

u/Mango-D 12d ago

Because both the starting day of the week and the work days different by region... It's like asking why can't everyone use UTC

7

u/Dotcaprachiappa 12d ago

Ok but the US does start working on Monday so that's not really a reason.

5

u/jpaugh69 12d ago

Just depends on the job. My current retail job starts on Sunday, since they are open every day of the week.

→ More replies (1)

2

u/GibbonFit 12d ago

In the US, the traditional work days do not include the weekends, which are Sunday and Saturday.

→ More replies (4)

25

u/cheezzy4ever 12d ago

Our weeks start on Monday. This is just an "America bad" meme where America has absolutely nothing to do with the issue

7

u/thehobbyqueer 12d ago

Not work weeks. My work week has always started on Sunday, "technically."

7

u/ProjectSnowman 12d ago

aMeRiCa BaD bEcAuSe WeEk StArT mOnDaY

2

u/LouisPlay 12d ago

they need to always do the own shit. also is grate cyber security, noone other then the us wants a programm that calculate thier units or use them

6

u/Weekly-Beginning-229 12d ago

So are they off friday-saturday instead?

11

u/Chorchapu 12d ago

Being in America and seeing the weekend on my calendar be on opposite sides of it threw me off

→ More replies (4)

2

u/wayzata20 12d ago

No, Saturday-Sunday

2

u/Lyndon_Boner_Johnson 12d ago

No, but Israelis are.

7

u/100LittleButterflies 12d ago

Take a loaf of bread and slice off the ends. Now look at your calendar and slice off the ends. Sunday is the front end and Saturday is the back end. And like soccer and empirical units it is almost certainly something we got from brits that they stopped using and now mock us for 😂

→ More replies (14)

6

u/MinecraftW06 12d ago

They wanna feel special

2

u/Nixinova 12d ago

> calls Saturday and Sunday the week's end

> makes the start of the week one of the week's end days

5

u/Xiij 12d ago

Your gonna lose your mind when you learn where bookends are placed

→ More replies (2)

2

u/Skusci 12d ago

We have like 20 bajillion different units of measurement that make no sense an you are going to point at the day of the week?

2

u/UltraSapien 12d ago

Whoops, looks like you failed to understand history

1

u/bowel_blaster123 12d ago

For some reason, the United States Postal Service starts the week on Saturday. Still have no idea why.

It felt good switching my calendar back to Monday after leaving that job.

→ More replies (60)

17

u/IMightBeErnest 12d ago

I got a question wrong in elementary school about which day was the first day of the week. I said monday. The teacher said sunday. I'm still pissed off almost three decades later.

6

u/marcelsmudda 11d ago

You should have gotten the iso norm and ask your teacher where it says that Sunday is the first day...

12

u/ANixosUser 12d ago

Tsoding 🅱️ased

6

u/wooops 12d ago

Once saw tests that could never pass on a Sunday that had been there for nearly a year, and was found when an incident needed a Sunday deployment

6

u/cjbanning 12d ago

I have to routinely work with three indexing systems for days of the week, one which is 0-indexed starting on Sunday, one which is 1-indexed starting on Sunday, and one which is 1-indexed starting on Monday. I have code that turns 0s into 7s and 7s into 0s and nothing else.

6

u/Pezmotion 11d ago

All jokes aside, this kind of problem is the best example I've seen used to explain why writing testable code is important. Being able to run a unit test that feeds in an arbitrary Tuesday timestamp into your code and see it fail is incredibly useful.

1

u/nicki419 10d ago

OpenOffice would like a word.

27

u/iain_1986 12d ago edited 10d ago

Never understood how such a religious country as the US would take the day of rest as the start of the week.

You rest at the end surely?

Edit - Jesus Christ the seriousness with which this nonsense comment was taken in a joke sub 🤷‍♂️

17

u/linmanfu 12d ago

The Old Testament says that God made the world in six days and rested on the seventh, the Sabbath, which is our Saturday. 

But Christians have met on Sundays pretty much since the church formed, because Jesus' Resurrection was on a Sunday, and regard the day of rest to have been transferred for that purpose, and to be a downpayment on the permanent day of rest at the end of history.

So the rest-at-the-end element is still there, but the emphasis is on the end of history rather than the end of the week.

13

u/SuitableDragonfly 12d ago

I was going to say, Sunday being the first day and Saturday being the last is several thousand years older than the US (or Javascript, for that matter), lmao. 

11

u/funny_xor_die 12d ago

That’s not true the world started on Jan 1 1970.

2

u/House0fDerp 8d ago

Might depend on who you ask. Been a part of a few churches that look at it as worship at the beginning of the week.

→ More replies (1)

4

u/Advanced-Blackberry 12d ago

How things look on a calendar isn’t something we think about anymore.  It’s now Sunday - Saturday and that’s fine because it doesn’t matter anymore. We don’t care why it’s like that. We aren’t looking to change it for the sake of changing it. 

2

u/ItsCalledDayTwa 11d ago

Well the funny thing is all the Christian, Western nations used do the exact same and only moved away from it as they got less religious, so I think three assumption that it's a non-religious thing to do is wrong.

3

u/CadenVanV 12d ago

We don’t work Sundays. Think of the weekend as the ends of the week. The start and the end.

5

u/iain_1986 12d ago

It's the week end yes.

Not the week start.

It's also the weekend, not the weeksend or the weekends.

The end of one week.

→ More replies (2)
→ More replies (1)

2

u/i_am_not_a_martian 12d ago

On the first day God created light (sun)day. Not American or religious but I thought that was pretty obvious.

3

u/fdar 11d ago

The sun was actually created on day 4.

2

u/iain_1986 12d ago

You're assuming the days of the week are named after Christianity....?

It's named after the Sun but not because of the Old Testament.

2

u/seiggy 12d ago

Yep! Sun, Moon, Mars / Tiw, Woden, Thor, Frige / Fris, Saturn. Days named for old Norse/Germanic tribal gods.

→ More replies (2)

2

u/i_am_not_a_martian 11d ago

The old testament, specifically Genisis is not solely a Christian text. I know the days of the week were not derived from a Christian strain of religion. I was responding directly to the commentor who referred to the US as a religious country and didn't understand why the week started on the day of rest, which is the Sabbath according to the bible which is Saturday not Sunday, and I gave the first verse of the bible to indicate why they were wrong in their assumption.

→ More replies (1)
→ More replies (13)

1

u/jamesxtreme 11d ago

This isn’t just a US thing. A bunch of foreign languages name their days with numbers in them and Sunday is the first day, though the notable exception is Chinese.

1

u/CardboardJ 12d ago

It's like if you point at a stick and ask where the two ends are and then get confused and angry when we point at two different sides.  Like I don't hear you calling Tuesday the weekstart.

1

u/grandalfxx 11d ago

Sunday and Saturday are the weekends.. americans didn't decide this... theyre called the weekends because theyre at the two ends of the week

3

u/mesonofgib 10d ago

WTF literally no one says "the weekends". It's "the weekend". 

→ More replies (4)
→ More replies (5)

4

u/ChiaraStellata 12d ago

And on the 7th day God rested, because he couldn't do any work during the unplanned downtime.

13

u/redsoxsuc4 12d ago

My guy seriously forgot to say “no mistakes on a sunday"

4

u/Bomaruto 12d ago

Did you tell Claude to not be funny on sundays?

16

u/jolharg 11d ago

Monday is always the beginning.

Americans are not based.

Tsoding is based.

3

u/lacklacklack22 11d ago

Any man whom has to say he is based, is no based king

5

u/mikegalos 12d ago

Welcome to understanding writing code commercially and not just to show off for your friends.

5

u/seedless0 12d ago

Sure. Blame it on someone else for your own lack of RTFM.

6

u/trollol1365 12d ago

the misuse of cyrillic is making me irrationally upset

17

u/Acrobatic-Nature-941 12d ago

Tsoding is russian, he has a pass for that ✌️

→ More replies (1)

2

u/qqqrrrs_ 12d ago

God started working in Sunday or something idk

2

u/anoldoldman 12d ago

And you caught this with a unit test... Right?

2

u/kaplotnikov 12d ago

it is also not reproduced on monday.

2

u/UsAndRufus 11d ago

Skill issue.

2

u/ItsClikcer 11d ago

And this is why you write unit tests to cover your boundary conditions

2

u/conundorum 11d ago

So... is he saying that he can't understand the concept of zero-based indexing unless weeks start on Saturday?

3

u/-Ambriae- 12d ago

Tsoding mentioned lesgoo

Also, America explain!!! I am confusion!!

2

u/OmegaTheta 12d ago

We use 60 seconds in a minute, 60 minutes in an hour, 24 hours in a day, 7 days a week. Worst of all, of course, is a month as a unit of time measurement when the value changes every other month, except when that's not consistent. 

So until you're ready to move on from that ridiculous system, maybe hold your judgment on a country having a different "first day of the week" than yours. 

3

u/Nerd_o_tron 12d ago

This is why we should all adopt the Shire calendar, in which every month is exactly 30 days.

1

u/Brisngr368 11d ago

*most of the time

1

u/Gnonthgol 12d ago

I once had a bug that was only reproducible in the last two weeks of the month or so.

1

u/GlitteringAttitude60 12d ago

It took us two years to notice that our test suite failed on Sundays :D

1

u/lostinthemines 12d ago

If your array was only one index too large, you would be fine

1

u/cubenz 12d ago

On Sundays and when you were testing I hope.

1

u/FoxedDev 12d ago

Reminds me of the Date() API in JS

1

u/Tsc_Tsc_Tsc 12d ago

a-mr a-sozing, another banger.

1

u/Clouds-xD 12d ago

Didn't they call it the "weekend"?

1

u/winter-ocean 12d ago

I feel like there's an r/stunfisk joke in here somewhere

1

u/NoEngrish 12d ago

god wills it, not our fault

1

u/MaleficentMode4222 11d ago

So they start the week in the middle of the weekend?... Yeah sounds American.

1

u/Pouek_ 11d ago

I never thought I'll see a Mr Zozin here

1

u/No_Welder7908 11d ago

Arrays should always start at 1, too.

1

u/Loeris_loca 11d ago

Unexpected .jai mention

1

u/Zdrobot 11d ago

jai-linux new_event.jai ..is it in that language no one has access to except for the people its developer has blessed for whatever reason?

1

u/Ezekeal 11d ago

Do other countries not use an equivalent to the word weekend? Or do they use it incorrectly?

1

u/Brisngr368 11d ago

As always, Rtfm

1

u/Chr155topher 11d ago

They even start their floors at 0 they got our asses damn

1

u/palomdude 12d ago

We are very happy

1

u/nebotron 12d ago

Day of rest enforced by OBOE

1

u/Accidentallygolden 12d ago

Can you eli5?

7

u/Igor_Kozyrev 12d ago

Programmers count starting with 0 i.e. Monday 0, Tuesday 1,..., Sunday 6. But he saw Monday 1 and guessed that in this weird case they started counting with 1. Turns out the weird was that they started the week from Sunday i.e. Sunday 0, Monday 1, etc. Bug ensued.

→ More replies (1)

4

u/Big-Section-5098 12d ago edited 12d ago

What day the "start" of a week is is arbitrary

The US (among other countries) starts the week on a Sunday

OP starts it on a Monday

They didn't read the documentation for tm_wday, so they thought it was 1-indexed

What they thought: Monday (OP's start) = 1, Tuesday = 2, ... Sunday = 7

When they tried WEEKDAYS[tm_wday - 1], it threw an error, because Sunday was actually 0, not 7

3

u/BirbsAreSoCute 12d ago

I'm American and everyone I have spoken to about this agrees that Monday is the "start" of the week, but the start is arbitrary and doesn't really matter. A bug like this could be easily avoided by.. reading the documentation.

2

u/MicrosoftExcel2016 12d ago

I’m not the one you’re replying to but I got all of that. What I’m confused about is why an “array out of bounds” errror that is “only reproducible” the one day that they thought was the maximum value does not cause them to reevaluate their assumptions about the indexing? “Only reproducible” sounds like it happened multiple times before they understood what is going on

2

u/Big-Section-5098 12d ago

I'd guess they saw it crash on the first Sunday after it was written, but didn't find out the bug until next Sunday for whatever reason. Maybe the program has output and they ran it in a way to hide the output, thus hiding the error message? Idk though, pure speculation on my part

If you have a bluesky account you can ask them directly though

→ More replies (2)
→ More replies (5)

1

u/Blue_Moon_Lake 11d ago

ISO-8601 has weekdays numbered 1 to 7
Just like months are 1 to 12.
1 being monday, 7 being sunday.

1

u/White_C4 12d ago

To be fair, this is the kind of stuff you should test for every weekday, first and last days of the month, and first and last months of the year.

1

u/Hatedpriest 12d ago

Sun, Moon, Tyr, Odin, Thor, Freya, Saturnalia

Moon, Tyr, Odin, Thor, Freya, Saturnalia, Sun

I like keeping the sun and moon together.

4

u/Novel_Dog1743 12d ago

Why? We rarely see them at the same time, generally they are opposites.

→ More replies (2)

0

u/tracernz 12d ago

What has this to do with Americans? This predates the existence of the US by a few thousand years. Old mate is just trolling.