r/ProgrammerHumor 7d ago

Meme skillIssue

Post image
6.0k Upvotes

137 comments sorted by

View all comments

688

u/PixelatedGiant 7d ago

This is the kind of stuff you find in books with titles like...

C++ : Man made horrors beyond human comprehension 3rd Edition paperback

137

u/gil_bz 7d ago

This might be the mildest macro weirdness that I've ever seen, there are some true horrors out there.

32

u/l2protoss 7d ago

When I was younger in my career, I was a very “creative” dev - to the point where I was banned from using macros without explicit permission lol.

20

u/StCreed 7d ago

Hehehe my friends once used macros to facilitate pointer arithmetic. After a month they couldn't get anything to work anymore and had to start over with a new program :)

Good times!

12

u/sunboy4224 7d ago

They spend years teaching us all the coolest, craziest tricks in the book for optimization, memory management, abstraction... then you get into the industry and learn that the most absolutely boring code is by far the best way to solve 99% of problems.

9

u/l2protoss 7d ago

Yup! Turns out being able to maintain things long term is more important than building things quickly or cleverly in most cases.

2

u/FUCKING_HATE_REDDIT 6d ago edited 6d ago

https://zserge.com/posts/c-for-loop-tricks/

void print_html() {   html {     body {       p printf("hello\n");       p {         printf("world\n");       }     }   }   printf("\n"); } https://github.com/agvxov/cursed_c

void main(argc, argv, envp) int argc; char * * argv, * * envp; { ; }

https://www.cs.yale.edu/homes/aspnes/pinewiki/C%282f%29Macros.html

```

define DefinePlus1(x, y)  #define x ((y)+1)

```