this post was submitted on 15 Nov 2024
131 points (97.1% liked)

Programmer Humor

26390 readers
2654 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
 
top 14 comments
sorted by: hot top controversial new old
[–] bleistift2@sopuli.xyz 23 points 10 months ago

0 3 * * * reboot

[–] MyNameIsRichard@lemmy.ml 18 points 10 months ago (1 children)

There's always a destructor though. It may do nothing but it's there.

[–] Valmond@lemmy.world 16 points 10 months ago (1 children)

No need to declare it though ofc.

Rule of 0/3/5

[–] MyNameIsRichard@lemmy.ml 3 points 10 months ago (1 children)

Yeah the compiler generates it so it's always there

[–] Valmond@lemmy.world 5 points 10 months ago (1 children)

Well yes, except when you allocate stuff in the constructor.

[–] MyNameIsRichard@lemmy.ml 4 points 10 months ago (1 children)

The compiler will still generate one. It won't be any use but it will be generated :)

[–] Valmond@lemmy.world 1 points 10 months ago (1 children)

Well no because if you allocate stuff in the constructor, you are going to write a destructor now, freeing that allocated stuff up / closing that socket, pipe whatever etc.

Right?

Right??

[–] MyNameIsRichard@lemmy.ml 4 points 10 months ago* (last edited 10 months ago) (1 children)

If I do it straight after the constructor, then definitely but if I get distracted by something else then it's only probably until I run it through valgrind and see the leak. These days, I mostly use smart pointers in new code though so there are fewer opportunities to need a destructor. It's funny that I never forget when opening a file or db connection!

[–] Valmond@lemmy.world 2 points 10 months ago (1 children)

After the constructor?

No need for a destructir bc smart pointers?

Man you does not make any sense.

[–] MyNameIsRichard@lemmy.ml 3 points 10 months ago

Man your reading comprehension is really low.

[–] Appoxo@lemmy.dbzer0.com 15 points 10 months ago (1 children)
[–] DaPorkchop_@lemmy.ml 4 points 10 months ago (2 children)

The longer I look at this the more uncertain I am whether or not this is AI.

The fingers look weirdly long, but all of the text is actually written and oriented correctly, but the shading across the surface of all the cards seems to change brightness randomly, ...

[–] SkyeStarfall@lemmy.blahaj.zone 2 points 10 months ago

Some people just have unusual features