572
they call it gen z c++ (sh.itjust.works)
top 50 comments
sorted by: hot top controversial new old
[-] InverseParallax@lemmy.world 68 points 1 year ago

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

[-] pastermil@sh.itjust.works 33 points 1 year ago
[-] scarilog@lemmy.world 13 points 1 year ago
[-] pastermil@sh.itjust.works 2 points 1 year ago

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

[-] chillhelm@lemmy.world 14 points 1 year ago
[-] InverseParallax@lemmy.world 10 points 1 year ago

I was fine till I hit sussin.

[-] BembelSommelier@feddit.de 59 points 1 year ago
[-] lelgenio@lemmy.ml 40 points 1 year ago

Reminder that yeet is a keyword in rust

[-] csolisr@communities.azkware.net 4 points 1 year ago

Is it synonymous with eject?

[-] moridinbg@lemmy.world 45 points 1 year ago
load more comments (1 replies)
[-] HeavenAndHell@lemmy.world 28 points 1 year ago

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

[-] kinttach@lemm.ee 27 points 1 year ago

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

[-] JoMiran@lemmy.ml 26 points 1 year ago

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

[-] swab148@lemm.ee 5 points 1 year ago

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

[-] CoolBeance@lemmy.world 25 points 1 year ago
[-] vicfic@iusearchlinux.fyi 23 points 1 year ago

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

[-] Dogeek@sh.itjust.works 8 points 1 year 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)

[-] mojo@lemm.ee 20 points 1 year ago

this had me deadass laughin fr fr no cap

[-] KpntAutismus@lemmy.world 13 points 1 year ago

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

[-] pastermil@sh.itjust.works 10 points 1 year ago

fr mf be bussin

[-] rockSlayer@lemmy.world 17 points 1 year ago

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

[-] aaaa@lemmy.world 14 points 1 year ago* (last edited 1 year 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

[-] vahtos@programming.dev 14 points 1 year 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
[-] aaaa@lemmy.world 7 points 1 year 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.

[-] scutiger@lemmy.world 11 points 1 year ago

yeet cap rn

It's right there!

[-] LoafyLemon@kbin.social 5 points 1 year ago

Returns a zero, I think.

[-] Dasnap@lemmy.world 16 points 1 year ago
[-] Dagu@sh.itjust.works 14 points 1 year ago

You could do this so much better than this

[-] gaussian_distro@iusearchlinux.fyi 28 points 1 year ago

Let's see what you got.

[-] Chadus_Maximus@lemm.ee 6 points 1 year ago
[-] isame@lemm.ee 3 points 1 year ago

Your move, busta

[-] squaresinger@feddit.de 12 points 1 year ago

That's called a Domain-specific Language.

[-] Bonehead@kbin.social 11 points 1 year ago

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

[-] red@feddit.de 7 points 1 year ago

ngl, SQL could use some rejuvenation

[-] pastermil@sh.itjust.works 8 points 1 year ago
[-] Moghul@lemmy.world 7 points 1 year ago

This feels like those boomer comics about how dumb millennials are

[-] drekly@lemmy.world 5 points 1 year ago

LETTSSS GOOOOOO

[-] BeigeAgenda@lemmy.ca 5 points 1 year 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. πŸ™„

Gangsta C++, for the ammo endowed.

[-] MonkderZweite@feddit.ch 3 points 1 year ago

The count of imports or the syntax?

load more comments (1 replies)
load more comments
view more: next β€Ί
this post was submitted on 27 Jul 2023
572 points (96.7% liked)

Programmer Humor

32069 readers
391 users here now

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

Rules:

founded 5 years ago
MODERATORS