1075
they call it gen z c++ (sh.itjust.works)
submitted 11 months ago by pastermil to c/[email protected]
top 50 comments
sorted by: hot top controversial new old
[-] [email protected] 156 points 11 months ago

That was so much more fun than it had any right to be.

[-] pastermil 67 points 11 months ago
[-] [email protected] 14 points 11 months ago
[-] pastermil 2 points 11 months ago

πŸ’€πŸ’€πŸ’€

[-] [email protected] 37 points 11 months ago
[-] [email protected] 16 points 11 months ago

I was fine till I hit sussin.

[-] [email protected] 95 points 11 months ago
[-] [email protected] 64 points 11 months ago

How regular C++ feels if English isn’t your first language

[-] [email protected] 63 points 11 months ago
[-] [email protected] 40 points 11 months ago

Reminder that yeet is a keyword in rust

[-] [email protected] 4 points 11 months ago

Is it synonymous with eject?

[-] [email protected] 53 points 11 months ago

this had me deadass laughin fr fr no cap

[-] [email protected] 22 points 11 months ago

you can use emojis in your username? that's lit fam

[-] pastermil 9 points 11 months ago

fr mf be bussin

[-] [email protected] 44 points 11 months ago
[-] [email protected] 4 points 11 months ago
load more comments (1 replies)
[-] [email protected] 39 points 11 months ago
[-] [email protected] 34 points 11 months ago

That's called a Domain-specific Language.

[-] [email protected] 31 points 11 months ago

I was following along until the bussin loop. What is it trying to yeet?

[-] [email protected] 15 points 11 months ago

yeet cap rn

It's right there!

[-] [email protected] 14 points 11 months ago* (last edited 11 months ago)

I believe it outputs the prime factors of the number you gave it.

The yeet value is just specifying if the function succeeded or not

[-] [email protected] 14 points 11 months ago

I found this amusing enough to try it out. It does actually compile (I used g++ for this). However, the current implementation just goes into an infinite loop if you enter a number >= 2.

I think the original author meant to do n -= 1 rn in the tweakin loop that is inside the bussin loop. That way, at some point n % i finna cap will be false, and i will bouta. Which then makes the expression i <= n in the bussin loop eventually false, so we stop bussin and yeet cap rn.

However, that would mean that the intention of the program isn't to output prime factors, because even with this fix it does not do so. The structure of mf chief() also doesn't suggest that is the purpose as it is missing another tweakin and sussin like this example of calculating prime factors in C++.

Example run:

$ ./zpp.exe
Enter a number larger than 1: 50
2
7
8
47
[-] [email protected] 7 points 11 months ago

Yeah it definitely looks like a flawed implementation either way. Probably a student got bored of trying to make it work, and went nuts with the #defines for fun

As a career programmer myself.... I can absolutely relate.

[-] [email protected] 6 points 11 months ago

Returns a zero, I think.

[-] [email protected] 30 points 11 months ago

ngl, SQL could use some rejuvenation

[-] pastermil 21 points 11 months ago
[-] [email protected] 29 points 11 months ago

Finally, an actual programming language. So long, Fortran.

[-] [email protected] 25 points 11 months ago

Gen-X here. Is it weird that I found the Z++ version easier to read?

[-] [email protected] 5 points 11 months ago

Millennial here, this is unironically way better, I wanna code in slang from now on.

[-] [email protected] 21 points 11 months ago

fr, I didn't know dat macros could be used to make nu programming languages.

[-] Dogeek 7 points 11 months ago

#define is nothing but a search and replace from the preprocessor.

I've been burned one too many times with #include which replaces the directive with the contents of the included headers file (I think that if you're truly evil you can even include straight .c files and forgo headers entirely)

[-] [email protected] 20 points 11 months ago

Ages ago downloaded some code for handling volume control for me to extend, it was a VB developer using c and they did the same, I just closed it and found some other code to use. πŸ™„

[-] [email protected] 19 points 11 months ago

So...you took C++, and turned it into COBOL. I'm not sure if I'm impressed or horrified.

[-] [email protected] 18 points 11 months ago

This feels like those boomer comics about how dumb millennials are

[-] Dagu 13 points 11 months ago

You could do this so much better than this

[-] [email protected] 27 points 11 months ago

Let's see what you got.

[-] [email protected] 6 points 11 months ago
[-] [email protected] 3 points 11 months ago

Your move, busta

[-] [email protected] 12 points 11 months ago

Gangsta C++, for the ammo endowed.

[-] [email protected] 6 points 11 months ago

Finally! I'm now deadass hip with the new lingo.

[-] [email protected] 5 points 11 months ago

LETTSSS GOOOOOO

[-] [email protected] 3 points 11 months ago

The count of imports or the syntax?

[-] [email protected] 3 points 11 months ago
load more comments (1 replies)
load more comments (1 replies)
load more comments
view more: next β€Ί
this post was submitted on 27 Jul 2023
1075 points (96.7% liked)

Programmer Humor

31251 readers
937 users here now

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

Rules:

founded 4 years ago
MODERATORS