this post was submitted on 01 Aug 2023
296 points (94.3% liked)

Programmer Humor

20778 readers
1590 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
 
all 38 comments
sorted by: hot top controversial new old
[–] heartlessevil@lemmy.one 65 points 2 years ago (6 children)

Programmer: "Does that mean it's free?"

Cashier: stabs you in the face

[–] marcos@lemmy.world 33 points 2 years ago (1 children)

Undefined behavior can go bad quickly.

[–] ruffsl@programming.dev 17 points 2 years ago

Could go the other way though. Ask them nicely if they'd be willing to free up their heap of inventory, and if they return you a cart overflow, you know you've stumbled upon the ultimate zero day coupon.

[–] spaceape@lemmy.nrsk.no 6 points 2 years ago (1 children)

I give money to cashier, change comes out of coin dispenser. I say "Looks like I won again!", cashier dies a little inside.

Every time.

[–] Malfeasant@lemmy.world 3 points 2 years ago

Long long ago in a callcenter not too far away, I made a guy choke on his drink. As required, I asked if there was anything else he needed before I ended the call, to which he replied "the winning lottery numbers?" I said "if I had those, I wouldn't be talking to you."

[–] Moc@lemmy.world 3 points 2 years ago* (last edited 2 years ago)

Unhandled exception leads to panic

[–] velxundussa@sh.itjust.works 2 points 2 years ago

I worked in groceries story when I was younger.

But funily enough, it's probably one of the rare times I'd have answered "yes"!

We got a policy here where anything mislabelled under 10$ is free for the first item. Anything over 10$ gets a 10$ rebate.

My understanding is that it was put in place a while ago when stores stopped labelling individual items to keep them in check and ensure that consumers had a recourse in case of mistake.

Source: https://www.opc.gouv.qc.ca/en/consumer/topic/price-discount/store/tip-sheet/

NULL being "no money" by any definition, and the regular price for this probably being under 10$... well, it's probably free!

[–] ICastFist@programming.dev 1 points 2 years ago

Everything is free. The problem is avoiding the cops afterwards.

[–] bappity@lemmy.world 23 points 2 years ago (1 children)

can I get uhhhhh NullPointer Exception: Object reference not set to an instance of an object.

[–] randomblock1@lemmy.world 7 points 2 years ago (2 children)

sorry we only have Exception in thread "main" java.lang.NullPointerException, is that okay?

[–] bappity@lemmy.world 2 points 2 years ago

that's how I like my coffee

[–] yum13241@lemm.ee 2 points 2 years ago

How about

Class lol : Object
{
public static init void main (string args)
{
    virtual void A_Start()
    {
          Java.Print(args)
          break
     }
}
}

In case it's not clear, I know nothing about Java.

[–] lightsecond@programming.dev 16 points 2 years ago

!softwaregore@lemmy.world

[–] z3n0x@feddit.de 12 points 2 years ago

Mmh nice, nullives.

[–] Grandwolf319@sh.itjust.works 11 points 2 years ago

It is funny, it’s just that the amount of funny is null.

[–] matti@lemmy.world 10 points 2 years ago (1 children)

When you buy these an exception is thrown.

[–] Speiser0@feddit.de 1 points 2 years ago

Real world doesn't make exceptions. So you'll get UB.

[–] nowitsabby@lemmy.blahaj.zone 9 points 2 years ago

Item labels only do this when they're very stressed

[–] Jakylla@sh.itjust.works 9 points 2 years ago

At least, the CSS works

[–] passepartout@feddit.de 6 points 2 years ago (1 children)
[–] sbv@sh.itjust.works 3 points 2 years ago (1 children)
[–] SariEverna@lemmy.ca 3 points 2 years ago (1 children)

Null null null null null? Null.

[–] sbv@sh.itjust.works 2 points 2 years ago (1 children)
[–] roofuskit@kbin.social 6 points 2 years ago (1 children)

Free olives, the cost is listed as 0.

[–] osprior@lemmy.world 2 points 2 years ago (1 children)
[–] roofuskit@kbin.social 1 points 2 years ago
[–] snor10@lemm.ee 4 points 2 years ago

*olives > /dev/null

[–] ExperimentalGuy@programming.dev 4 points 2 years ago

Don't try to buy it unless u want the register to open a black hole when the cashier puts it in.

[–] csm10495@sh.itjust.works 2 points 2 years ago* (last edited 2 years ago) (4 children)

Isn't NULL a macro in C for 0? So doesn't that mean these items are free?

In a way it's still the same with more modern languages. Especially OOP, setting an object to Null is just setting the address pointer to to 0x00000000.

Hence NullPointerException / NullReferenceException or similar, depending on the language.

[–] Haus@kbin.social 2 points 2 years ago (1 children)

I'd guess, in context, it's a floating point price column that hasn't been set, and the table designer didn't specify the column to be NOT NULL.

[–] csm10495@sh.itjust.works 2 points 2 years ago

I guess Rust would have solved the problem as well.

[–] kamenlady@lemmy.world 2 points 2 years ago

Null is zero in german - so this must be free, it's a german shop

[–] oldfart@lemm.ee 2 points 2 years ago

In a country where Null literally means zero? Awesome