this post was submitted on 15 Aug 2024
96 points (97.1% liked)

Programmer Humor

19176 readers
1781 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 1 year ago
MODERATORS
 

By Jon S. Stumpf

May your signals all trap
    May your references be bounded
All memory aligned
    Floats to ints rounded

Remember ...

Non-zero is true
    ++ adds one
Arrays start with zero
    and, NULL is for none

For octal, use zero
    0x means hex
= will set
    == means test

use -> for a pointer
    a dot if its not
? : is confusing
    use them a lot

a.out is your program
    there's no U in foobar
and, char (*(*x())[])() is
    a function returning a pointer
    to an array of pointers to
    functions returning char

top 7 comments
sorted by: hot top controversial new old
[–] Thorry84@feddit.nl 32 points 1 month ago (1 children)

Segmentation fault (core dumped)

[–] CanadaPlus@lemmy.sdf.org 12 points 1 month ago (1 children)

Dump a core out for my homies.

[–] SatouKazuma@programming.dev 5 points 1 month ago

No need. Intel dumped all of them out, even if it was onto the rest of the motherboard.

[–] I_like_cats@lemmy.one 11 points 1 month ago
[–] 7uWqKj@lemmy.world 6 points 1 month ago (1 children)

This is older than many reading here … and C was already old when this was written.

[–] 7uWqKj@lemmy.world 3 points 1 month ago (1 children)

Or should I say, when this was posted on Usenet. Who knows when it was written.

[–] dactylotheca@suppo.fi 3 points 1 month ago* (last edited 1 month ago)

The Usenet post I linked to claims it's originally from the 1st quarter of 1990, but who knows if that's accurate or not. I actually can't find a good source for whether Stumpf is the original author or just the one who posted it to rec.humor.funny.reruns, but it's usually attributed to him at any rate.

But yeah, fairly ancient by internet standards. I remember first running into it in the 90's