714
you are viewing a single comment's thread
view the rest of the comments
[-] kamen@lemmy.world 5 points 5 months ago

Weren't you getting runtime errors for the function not being found?

[-] humbletightband@lemmy.dbzer0.com 7 points 5 months ago

No, they were probably getting false every time

[-] shasta@lemm.ee 1 points 5 months ago* (last edited 5 months ago)

Falsy* because it was undefined

However, their IDE should have highlighted it as an unknown property. Guess this guy is coding in notepad or vi.

[-] humbletightband@lemmy.dbzer0.com 2 points 5 months ago

Yep, thanks for correcting me. In fact, if they write something like

if (day.isWeekend) {...}

The block will never be executed with the old version of library

[-] shasta@lemm.ee 2 points 5 months ago

Yeah that's exactly what I think happened to him. He needs a better IDE and/or needs to stop copy/pasting code from stackoverflow or documentation that doesn't match his library version.

[-] ByteJunk@lemmy.world 0 points 5 months ago

My dude, you need to understand that all that anger and resentment, it is not you. It's the years of JavaScript poisoning your mind.

In any case, that goes to my point. I would have to be saved by my IDE, when any sane language will blow up in your face as soon as you try to run it.

[-] owsei@programming.dev 2 points 5 months ago

I don't know how luxon works, but isWeekend could be a property instead of a function

[-] ByteJunk@lemmy.world 2 points 5 months ago

It is. It also happens to be undefined, and checking that for truth is how I was bitten.

this post was submitted on 21 Apr 2024
714 points (97.0% liked)

Programmer Humor

32069 readers
2585 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS