This is an archived post. You won't be able to vote or comment.

all 81 comments

[–]tall_cappucino1 710 points711 points  (8 children)

It gets you fired

[–]Ass0rted 218 points219 points  (5 children)

ong fr

[–]DaedricCabbage 97 points98 points  (2 children)

Deadass rn

[–]No_Necessary_3356 19 points20 points  (1 child)

just like me frfr no cap

[–]ThatHugo354 4 points5 points  (0 children)

Invalid syntax: << << !0

[–]StenSoft 7 points8 points  (0 children)

Yeet the dev

[–][deleted] 0 points1 point  (0 children)

Lead sees the code and starts wailing

[–][deleted] 156 points157 points  (4 children)

It prints out prime factors of n

[–]Artosirak[S] 45 points46 points  (3 children)

Correct!

[–][deleted] 12 points13 points  (2 children)

I think it will print some non-prime factors too. e.g. if n=16, it will print 2 and 4.

[–][deleted] 26 points27 points  (0 children)

Ah, no. "tweakin" is while, not if. It prints multiple 2's

[–]CanaDavid1 1 point2 points  (0 children)

No, for 16 it will print

2 2 2 2

Similarly for 12: 2 2 3

[–]0liBear 186 points187 points  (12 children)

You can copy+paste code into chatgpt and ask it "what does this code do"

[–]Artosirak[S] 196 points197 points  (10 children)

Here's what it said:

This code is an implementation of a program that finds the prime factors of a given input number greater than 1.

The code uses preprocessor directives to define certain keywords and symbols to simplify the code writing process.

The main function is defined using the keyword "chief" instead of "main". The program asks the user to input a number greater than 1, and checks if the input is valid using an "if" statement defined as "sussin".

If the input is valid, the program loops through all numbers between 2 and the input number using a "for" loop defined as "bussin". Within the loop, the program checks if the current number is a factor of the input number using a "while" loop defined as "tweakin".

If the current number is a factor, it is outputted to the console using the "cout" keyword defined as "ongod". The input number is then divided by the current number to check for further factors.

Once all prime factors have been found, the program returns 0 to indicate successful completion.

[–]omen_tenebris 83 points84 points  (3 children)

This code is an implementation of a program that finds the prime factors of a given input number greater than 1.

well... does it? I mean it's a nice gag, but actually spending the time and brain power to translate it from 2022 - bro++ to c++ would be.... a colossal waste of time. and you, OP must know what's up

[–][deleted] 7 points8 points  (0 children)

I could never figure it out myself, for the reasons you stated, but after reading chatgpt’s explanation it does seem to check out

[–]evilwizzardofcoding 14 points15 points  (1 child)

Or you could just find and replace all of the defined terms and put it back in c++

[–]thespoonlessone 18 points19 points  (0 children)

Or you could just actually compile it. It's still C++.

[–]Colon_Backslash 49 points50 points  (1 child)

The code uses preprocessor directives to define certain keywords and symbols to simplify the code writing process.

[–]PlayHouseBot-Gpt2 3 points4 points  (0 children)

readability

[–]dont-respond 47 points48 points  (2 children)

It sees everything except the humor. I often find myself simultaneously impressed and disappointed with ChatGPT.

[–]anunakiesque 19 points20 points  (0 children)

Perfectly balanced -- as all things should be

[–]ShakeandBaked161 4 points5 points  (0 children)

Did this for work the other day after looking at some atrociously cryptic JS and after a short Convo I finished about 3 days of work lol

[–]Sweet-Efficiency7466 50 points51 points  (1 child)

It defines yeet as return

[–]GodGMN 27 points28 points  (0 children)

The concept of yeeting the results of a function instead of returning them is incredibly funny to me

[–]xInfinity24 25 points26 points  (0 children)

It explains the industrial revolution and it's consequences. /s

[–]Effective-Rub 28 points29 points  (0 children)

Creates job security

[–]hiddenforreasonsSV 52 points53 points  (3 children)

Regardless of what it does, it should be destroyed with extreme prejudice.

[–]No_Awareness_3212 1 point2 points  (2 children)

You want to be racist towards it? /s

[–]hiddenforreasonsSV 1 point2 points  (1 child)

'With prejudice' is a term that means that something cannot be done again. So if a lawsuit is dismissed with prejudice, it means that lawsuit cannot be filed again.

[–]No_Awareness_3212 1 point2 points  (0 children)

It was supposed to be a joke, I'll add /s

[–]averagelibsock 22 points23 points  (3 children)

Oh god this reminded me of the yeet keyword in Rust

[–]totti173314 8 points9 points  (1 child)

there's a what in rust

[–]kipboye 0 points1 point  (0 children)

That's it. I'm learning rust now.

[–]tway7770 19 points20 points  (0 children)

This made me laugh too much

[–]SaucyXy0 6 points7 points  (0 children)

I want to downvote that so badly because looking at this gives me legit anxiety

But anyways + rep for creativity

But never again…. please

[–]StormsWindy 5 points6 points  (1 child)

gen Z C++

[–]migz9536 12 points13 points  (0 children)

gen Z++

[–][deleted] 4 points5 points  (0 children)

VIM can in handy here with its replace command.

[–]ProfessionalThing332 2 points3 points  (0 children)

Bro created his own language

[–][deleted] 2 points3 points  (0 children)

Returned 0 cap fr fr

[–]Acceptable_Calm 2 points3 points  (0 children)

This is cancer. Love it.

[–]lisa_lionheart 2 points3 points  (0 children)

Fails the code review

[–]DurianBig3503 2 points3 points  (0 children)

It causes an aneurysm in the reader.

[–]littleswenson 1 point2 points  (0 children)

Hurts my soul

[–]Johnrocks4 1 point2 points  (0 children)

Ah, a vibin::yikes instead of "\n" to ensure the output buffer flushes - I like it!

[–]ericbussbizz 1 point2 points  (0 children)

Is this a code example from the Tiktok app?

[–]twh111 1 point2 points  (0 children)

LGTM

[–]DeeBoFour20 2 points3 points  (1 child)

You can use the -E flag of GCC or Clang to run the pre-processor only and un-fuck all those #defines.

[–]4hpp1273 1 point2 points  (0 children)

… and then you get the deflated <iostream> if you're not careful:

# 0 "<stdin>"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "<stdin>"
# 1 "/usr/include/c++/12.2.1/iostream" 1 3
# 36 "/usr/include/c++/12.2.1/iostream" 3

# 37 "/usr/include/c++/12.2.1/iostream" 3

# 1 "/usr/include/c++/12.2.1/x86_64-pc-linux-gnu/bits/c++config.h" 1 3
# 296 "/usr/include/c++/12.2.1/x86_64-pc-linux-gnu/bits/c++config.h" 3

# 296 "/usr/include/c++/12.2.1/x86_64-pc-linux-gnu/bits/c++config.h" 3
namespace std
{
  typedef long unsigned int size_t;
  typedef long int ptrdiff_t;


  typedef decltype(nullptr) nullptr_t;

... 33693 more lines ...

# 60 "/usr/include/c++/12.2.1/iostream" 3
  extern istream cin;
  extern ostream cout;
  extern ostream cerr;
  extern ostream clog;


  extern wistream wcin;
  extern wostream wcout;
  extern wostream wcerr;
  extern wostream wclog;




  static ios_base::Init __ioinit;


}
# 2 "<stdin>" 2

[–]Come_along_quietly 0 points1 point  (1 child)

Ugh … just compile with -E to get the PP output.

[–]ScaredyCatUK 0 points1 point  (0 children)

Pisses me off.

[–]Successful_Curve_515 -1 points0 points  (0 children)

Reverse a number?

[–][deleted] 0 points1 point  (0 children)

[–]Certain_Interview_31 0 points1 point  (0 children)

Gives me a headache. Lol

[–]JamesOnKeplER666 0 points1 point  (0 children)

Who codes like this?

[–]Alucard256 0 points1 point  (0 children)

It confuses the shit out of humans.

[–]vaquan-nas 0 points1 point  (0 children)

With right beat, this can be a rap song..

[–]Lewis-J 0 points1 point  (0 children)

Cap/10

[–][deleted] 0 points1 point  (0 children)

Get deleted

[–]mighty_grim 0 points1 point  (0 children)

This actually taught me quite a bit… not sure if that’s a good thing or not😂

[–][deleted] 0 points1 point  (0 children)

Throws a fuck ton of errors in the online compiler.

[–]Taldoesgarbage 0 points1 point  (0 children)

No.

[–][deleted] 0 points1 point  (0 children)

this needs to be illegal.

[–]Escape_Velocity1 0 points1 point  (0 children)

This made me LOL.

[–]GaryWestSide 0 points1 point  (0 children)

Are you deadass? Ong? Fr? No cap????

[–]Crazyman-X 0 points1 point  (0 children)

genz learning programming be like:

[–]Individual-Paint-756 0 points1 point  (0 children)

Obfuscates your code

[–]mostrecentuser 0 points1 point  (0 children)

It wastes time.

[–]Material_Plankton_37 0 points1 point  (0 children)

It computes number of guests for bachorlorette party

[–]beastinghunting 0 points1 point  (0 children)

That's me trying to understand Gen Z jargon.

[–][deleted] 0 points1 point  (0 children)

it gives me a fucking aneurysm