r/ProgrammerHumor • • Apr 23 '19

Yeet!

Post image
23.9k Upvotes

547 comments sorted by

1.7k

u/Eznix Apr 23 '19

Try making a working program with this and ask someone else to fix your bugs.

769

u/x32byTe Apr 23 '19

this program actually works, try it yourself its c++

570

u/Eznix Apr 23 '19

Well i was thinking of a full-fledged application tho.

Must be a hell to maintain tbh.

431

u/pm-me_your_vimrc Apr 23 '19

Nah, you can always find-replace all the yeets

245

u/Eznix Apr 23 '19

Well thats just taking the fun out of it.

→ More replies (8)

34

u/SuperOP535 Apr 23 '19

Or you can just run it through the preprocessor (cpp -P src/file preprocessed/file). You can even use it with other languages like e.g. Java!

→ More replies (5)
→ More replies (11)

58

u/Dmium Apr 23 '19

Using a reverse equivalent of the classic Bee Movie Script c++ code this should be relatively easy to reverse.

I'm tempted to make this for yeet now though

→ More replies (6)

10

u/fieryfox67 Apr 23 '19 edited Apr 23 '19

This reminds me of Brainfuck and Whitespace.

Edit: Brainfuck, not mindfuck.

→ More replies (9)
→ More replies (6)

33

u/Pure_Decimation Apr 23 '19

Excuse me, but do you expect me to type that all out? Please copy paste it to stack overflow so that I can copy paste it from there like any sane programmer would.

21

u/cybaritic Apr 23 '19

sane programmer

There's nothing sane about this.

→ More replies (1)
→ More replies (7)

183

u/LicensedProfessional Apr 23 '19

We could uniquely identify all of the symbols in a given file using a "Binary Yeet-encoding" where lowercase is 0 and uppercase is 1, and all numbers take the form y-XXX-t, then automatically generate a bunch of macros and update the file with them.

200

u/RJCP Apr 23 '19

"binary yeet-encoding" sounds like something I was born to dedicate my life to.

I am willing to donate $5 towards the crowdfunding campaign to turn this into a reality.

117

u/thirdegree Violet security clearance Apr 23 '19

born to dedicate my life to

--

willing to donate $5

43

u/Siniroth Apr 23 '19

The real joke is that everyone here is in crippling levels of debt and being $5 in... Not .. Debt? would be a staggering improvement

→ More replies (3)
→ More replies (1)

28

u/thewildjr Apr 23 '19

The crowdfunding campaign is at https://www.paypal.me/thewildjr you can trust me

don't actually send me money

34

u/Shingo__ Apr 23 '19

Too late I’ve already sent you my entire bank account

→ More replies (2)
→ More replies (1)

23

u/Homunculus_I_am_ill Apr 23 '19

In python you can return all the functions in a module as a list of strings with dir(module). Just use that to obfuscate all the functions within a module without showing any of the define statements.

import math

counter = 0

for x in dir(math):

    definition = "foo%s = math.%s"%(counter,x)

    exec(definition)

    counter += 1

> foo42(foo36)
-1.2246467991473532e-16

foo42 was defined as math.sin and foo36 as math.pi.

Now just replace my counter with something that generates variants of Yeet and do it for a bunch of module and you're in business for a very obfuscated yeet code.

6

u/Droggl Apr 23 '19

Thanks Satan :-)

→ More replies (1)

8

u/LvS Apr 23 '19

yeEEEEeeEt yeEEeeEeEt yeEEeeEeEt yeEEEeEeet yeeEeeeeEt

→ More replies (4)

8

u/Mega_Mewthree Apr 24 '19 edited Feb 22 '21

[ENCRYPTED] U2FsdGVkX1+IuLcYB6toz/brrR2FF4jgUdbTVNvKJ7LvMuuzuKb9aJKSpn6jOthXpuRHGFzukTlYaIbNoua7lk7Fk87hXf21bzpcgHUqyVVEqa3Meb/HlonbvYO0VuuVuXRSbEex0xrzam8Gzd30f6l2ocHe5TrP1wklBEa7QJ34G0Py/Hh5opVvnIgHUtXDPQC5ZmMjnhrS6MNEwKNWlXAPN6Tdyox8eGRN9VgVOU7NIhYvoBKMbcUJ1Xy5v2j9fzBjKB5+BqFCoaHUbrrRjYRXBmSHEMkF73RSlb9uh+povsIoLYH643rVcY0RU3wjwUNtoAU5qL/eYq4PhN8Qhn/qvuUnmTYyu8/h0w1smTKsXljyvBM3hy4vYF1SnCLzJ9AVAQZhqsvEPMFTJvM4j0E45nU2fU+YbirjpOSU2lEr3iHiWGEAUUaji4h1PbKNpXmtxGp831yEJWK0F+CtKIFfX2u4AkV1F43xkKIn9V8kQtZLVFcu647herULzVrPWuuOjTV3zQzHjnmarp2iaGoL3bDt46fExHAPLlejGz1moQ5a42w3AjIOlYq6OCyey0/g/zt9LJPpI4GylUL/lmj4HgMlPb52ruYCYGrsRJZebuAOzGd63kAOodGxuiJmUSRr5PHuZ+/0GVyS2Eyxi7u1E+pZ8717EeWE5V6Iqbl0a53CCnzkN8wUqUyUsZvBIOiMJbGIPAeoIFZavpdOf1qQGfdmMalWd1tOaRw0V99bjPozDd11aENwA5e1DjLvtpSSnVJxNwpDZL7g7oPDtZ80DcCYL3PUlsaSi47j2Qk4ojVGaavrFyY6qXbCu9d3yzDK9Y053ifaErbiAmvUB0bOx1WhIsEkJJ0vR3okqHcIkJA7asr6ySOUkmEYBrYN6asCdxu1YuyUyXUSu/nNWKPCBtFFrmzLMfHOKVeIxsALnoee8XLaqha38AouJB8EWSIRKLhZfzDuAQQDIyqKUiZTmFcTX5HTrJhux7hB17YbwmyCUiGIgGFqWMWt+zWblekQn1pvdWc304oJzom2MiYCLwISCK76Bl9mfXgHcCVr0Xqj0vs0UonE3MmsxpRtzf+XoAW9O0hEYw7zg1nLDB28yjvZkerdF/XT823PRmApOx7GiyWW3VeeoDjT3Ggb66OsnPCaJOb4crI3woKRKw7fXvCVUTuAta4ZSYcjEGz+F2bp1gGmyBdda5RXC0pVw2tGV8TDYGKqnxUYsuWMcc6iGGZ/cL1IZa7nsrw6xkEsA3yq8sf3VOhcezmj0pPCY8nYMmypJeblTQ+D4jsPV1n/dkzp9wckvc1+ik+K0jlGBAqMNl6PcABTl3LAD9vVlYLAIpUd3LV6Hff6kKzPeKlETXMYb+T2xW01aeIhWd0l6dfk+Sc1fAGRE6rVkhX6

→ More replies (1)

4

u/reflectiveSingleton Apr 23 '19

Parse that syntax tree and go wild bb

→ More replies (1)

33

u/cholantesh Apr 23 '19

OP could make it worse by putting his #defines in a header file

27

u/brownpinkie Apr 23 '19

Named yeet.h

9

u/db2 Apr 23 '19

No:

include "stdio.h"

Obligatory muhaha.

→ More replies (1)

23

u/[deleted] Apr 23 '19

Ever heard of the international obfuscated C code contest? https://www.ioccc.org/

4

u/Eznix Apr 23 '19

No i havent. Thanks i'll look into it.

→ More replies (4)

9

u/EpicBomberMan Apr 23 '19

I think both gcc and clang have flags that can make it output the code after replacing macros, so it wouldn't be too bad if someone sent this code. Just looking at it though, that's evil

9

u/MakeItHappenSergant Apr 23 '19

There is a full programming language called "Hodor" that is a similar concept. Here's "Hello World":

$HODOR: hhodor? Hodor!? Hodor!? oHooodorrhodor orHodor!? d = HoDoRHoDoR () {
  hodor.hod('Hhodor? Hodor!? Hodor!? o HODOR!? orHodor!? d!');
};

hhodor? Hodor!? Hodor!? oHooodorrhodor orHodor!? d();
→ More replies (2)

7

u/jacksalssome Apr 23 '19

You just search and replace on a working program.

5

u/TigreDeLosLlanos Apr 23 '19

I would do it for college if they didn't have to look at the code for evaluation purposes.

→ More replies (7)

56

u/Typewar Apr 23 '19 edited Apr 23 '19

Lol, we had a CTF task that looked something like this just a LOT bigger

0

u/[deleted] Apr 23 '19

[deleted]

→ More replies (2)

97

u/Ivaalo Apr 23 '19

You can define anything in C++ ?

91

u/x32byTe Apr 23 '19

Yeah, almost everything

74

u/[deleted] Apr 23 '19

Correct me if I'm wrong, but it's basically a find+replace for the compiler, right?

88

u/TommiHPunkt Apr 23 '19

that's how macros work, yes

→ More replies (4)

26

u/ProgramTheWorld Apr 23 '19

A bit more complex than that - it replaces tokens and not just your usual Ctrl-F type of find and replace.

→ More replies (3)
→ More replies (3)

10

u/Ivaalo Apr 23 '19

What's the purpose of defining something to replace "int" or even ";" ?

27

u/RussianMadMan Apr 23 '19

In case of "int", base types like this usually typedef'ed to something like int32_t for compatibility reasons. Semicolon replacement is just side effect of how preprocessor works

→ More replies (1)
→ More replies (11)
→ More replies (2)

16

u/[deleted] Apr 23 '19

So a bit of background. #define is not part of the C or C++ spec; it's part of the C preprocessor (which is a separate thing) spec. You can run the C preprocessor over virtually any code in any language, as long as you want it to have transclusion, compile-time flow control, and macros. It takes in code and outputs macro-completed code.

So, technically, you can define anything in the C preprocessor and, as long as you include it in your buildchain, you can define anything in anything.

7

u/HowIsntBabbyFormed Apr 23 '19

Are all the # terms preprocessor directives? So, #include is not actually part of the c/c++ spec? Without the preprocessor c/c++ has no way to import other libraries?

5

u/[deleted] Apr 23 '19

Mostly correct. All the header transclusions are done in the preprocessor, as are the include guards (#ifdef...#endif and #pragma). Technically, the preprocessor itself is part of the spec - but the compiler itself calls the preprocessor; it doesn't know anything about preprocessor declarations itself, aside from some line number remapping the PP provides (for error reporting).

→ More replies (2)

2

u/brisk0 Apr 23 '19 edited Apr 23 '19

The macro must be a valid identifier

It can expand to anything.

→ More replies (2)
→ More replies (4)

56

u/coatsiecoates Apr 23 '19

Yeet!

This is amazing.

4

u/Burn_Stick Apr 23 '19

int main ()

{

std::cout << "Yeet!";

return 0;

}

if i'm not mistaken (also im not sure if there is spacing between yEet and yEEt (the same thing applies for yEEt and yeEt))

1

u/x32byTe Apr 23 '19

yeah that's the code

→ More replies (1)
→ More replies (2)

4

u/kres0345 Apr 23 '19

Wait... you can do that? Another reason to learn cpp

4

u/x32byTe Apr 23 '19

yeah, you can define almost everything

→ More replies (1)

595

u/embrace- Apr 23 '19

Blessed #define usage

71

u/[deleted] Apr 23 '19

The idea that you can #define language constructs is both absurdly powerful but dear god if its used wrong, the fucking mess it can cause. I don't know C well but can you do something with spaces and line breaks in define. All of the examples above had no whitespace.

105

u/Chevaboogaloo Apr 23 '19

Yeah my favorite is that you can #define true false

64

u/CosmoKram3r Apr 23 '19

Wait, that's illegal.

→ More replies (1)

46

u/[deleted] Apr 23 '19

And then #define false !true, I think?

22

u/nxqv Apr 23 '19

My brain hurts

→ More replies (1)

18

u/[deleted] Apr 23 '19

#define struct union is the best thing to put in someone's C code if you really hate them.

→ More replies (2)
→ More replies (2)

0

u/[deleted] Apr 23 '19

[deleted]

→ More replies (1)

2

u/[deleted] Apr 23 '19

Should I write a program to rewrite source code like this?

2

u/x32byTe Apr 23 '19

yeah of course! I mean imagine how funny this would be :P

→ More replies (1)

2

u/TRUEequalsFALSE Apr 23 '19

Are you writing C in Eclipse?!

2

u/x32byTe Apr 23 '19

Yeah.. i don't like visual studio...

2

u/TRUEequalsFALSE Apr 23 '19

I haven't used it, but in my experience, Eclipse doesn't play nicely with anything but Java. How'd you get this to work so well?

3

u/x32byTe Apr 23 '19

i think its called "eclipse cpp" or something like that.. it works for simple programs but i haven't figured out yet how to add external libs, etc. so i don't know if it works with more advanced stuff too.

2

u/warmCabin Apr 23 '19

I saw one like this where they got a Java hello world to compile

2

u/x32byTe Apr 23 '19

w8 what?! how?! i you find this could you send it to me? because I'm pretty good in Java (or at least I think so) and i have no clue how to do this

→ More replies (1)

2

u/trexButtbutt Apr 23 '19

Why are you using eclipse for c++?

3

u/x32byTe Apr 23 '19

I don't like visual studio very much

3

u/trexButtbutt Apr 23 '19

But even VS Code would be better

3

u/x32byTe Apr 23 '19

really? ok then.. i'll give it a try

193

u/threesixzero Apr 23 '19

what the fuck is wrong with people

93

u/e8dirqd3 Apr 23 '19

They're generously sacrificing their education for short-lived meme karma to guarantee the job security of the previous generation.

8

u/MonotonousProtocol Apr 23 '19

Short-lived? Its been 5 yrs since it came out and I still havent seen any sign of it going to fade away up until today...

291

u/NeinJuanJuan Apr 23 '19 edited Apr 23 '19

YeetScript

..is a general-purpose, imperative computer programming language, supporting structured programming, lexical variable scope and recursion, while a static type system prevents many unintended operations.

During the 2020s, YeetScript gradually gained popularity. Nowadays (in 2038), it is one of the most widely used programming languages.

36

u/6c696e7578 Apr 23 '19

2038

Yeah right, like the UNIX epoch won't kill us all.

19

u/YourAverageNutcase Apr 23 '19

Too bad the glitch is only on 32bit CPU’s. Then again, I’m sure there will still be plenty of old servers affected.

7

u/[deleted] Apr 23 '19

*Cries in Server 2003*

→ More replies (6)
→ More replies (1)

18

u/Sigmatics Apr 23 '19

The future nobody wanted

7

u/CaffeineSippingMan Apr 23 '19

Isn't that the same language as Yeet?

8

u/kyzfrintin Apr 23 '19 edited Apr 23 '19

Nah, it's a bootstrapped wrapper around pure Yeet that cross-compiles at a higher level.

I have no idea if I used any if those words correctly

→ More replies (2)
→ More replies (1)

84

u/errormaker Apr 23 '19

Can I rename throw in Java to Yeet?

93

u/errormaker Apr 23 '19

Or this (╯°□°)╯︵

63

u/Sipkab Apr 23 '19

The closest you can get is by declaring a new exception class.

class Yeet extends RuntimeException { ... }
...
throw new Yeet();

Best thing is that you can catch yeets this way.

try {
    ...
} catch (Yeet yeet) {
    //dab or something
}

Nice.

24

u/creepig Apr 23 '19

The inverse of Yeet is Yoink, FYI

14

u/ManiacalZManiac Apr 23 '19

The Lord yeeteth and the Lord yoinketh away

→ More replies (2)
→ More replies (2)

27

u/EagleOneGS Apr 23 '19

Oh my, I want a meme programming language now that utilizes as much modern slang/meme keywords as possible.

OwO (!yes) { yeet new FuckyWucky(); }

8

u/alt-of-deleted Apr 23 '19

Oh my God, yeet new FuckyWucky(); is something I need in my code right now

6

u/mehanixx Apr 23 '19

Not too modern but... http://www.lolcode.org

→ More replies (1)
→ More replies (2)

16

u/word_clouds__ Apr 23 '19

Word cloud out of all the comments.

Fun bot to vizualize how conversations go on reddit. Enjoy

13

u/[deleted] Apr 23 '19

"Yeet make define hate buffalo". This is deep. Good bot.

5

u/alt-of-deleted Apr 23 '19

why tf is buffalo so big

→ More replies (1)

26

u/dudebobmac Apr 23 '19

Time to go grind some YeetCode.

→ More replies (1)

26

u/SpareTesticle Apr 23 '19 edited Apr 23 '19

I'm curious if whitespace makes a difference

If we redefined 'yEEt' as

#define yEEt :

would we call the scope operator with

yEETyEET //or
yEEt yEEt //or
yEEt  yEEt

?

EDIT: updated the define statement from yEET to yEEt, or as the senior dev would say

git commit -m "typo"

14

u/aathma Apr 23 '19

I think the :: operator counts as one term as opposed to a conjunction of two :'s so I don't think it's possible.

8

u/ARM32 Apr 23 '19

#define yEEt ::

11

u/SpareTesticle Apr 23 '19

Thanks for the code review. This commenting feels eerily like working rather than slacking off on reddit.

→ More replies (1)
→ More replies (2)

9

u/rmrhz Apr 23 '19

Ughh my eyes

6

u/Phantom569 Apr 23 '19

so this is how esolangs are born

6

u/scrubbkt Apr 23 '19

I had a professor do something similar in Java. He replaced the 'equals' method with one he wrote using only the word main. [Proof] (https://i.imgur.com/WjQE5cc.jpg)

5

u/TK-427 Apr 23 '19

For bonus points, bury this in "stdutils.h"

4

u/the1mrx Apr 23 '19

Your scientists were so preoccupied with whether or not they could, they didn’t stop to think if they should.

4

u/PaxPlay Apr 23 '19

Missing newline, reported.

15

u/Kayshin Apr 23 '19

What the hell is yeet?

14

u/MarkoSeke Apr 23 '19

The opposite of yoink

→ More replies (3)

6

u/Samot_PCW Apr 23 '19

11

u/[deleted] Apr 23 '19

That's not the original!

Here, take this.

7

u/Iffabled Apr 23 '19

Commander Copy! Reposter Rex!

1

u/D3RPstroyer Jun 02 '19

this is beautiful, what language is it in?

6

u/Flyberius Apr 23 '19

Such a powerful language.

6

u/ScaglieDiGrana Apr 23 '19 edited Apr 23 '19

#define yEeEt #define

at the top to make it better

2

u/asdjfh Apr 23 '19

Genius.

→ More replies (1)

3

u/nielmot Apr 23 '19

At least the brackets (Yeeeet and yeeeeT) are correct

3

u/Acidictadpole Apr 23 '19

I see you use `Yeeeet`s on their own line, what a terrible waste.

5

u/_under_ Apr 23 '19

WTF. Surely you should put the opening Yeeeet in the same line.

→ More replies (1)

2

u/[deleted] Apr 23 '19

this is how brainfuck is made

2

u/soyrandom1 Apr 23 '19

If it works it's not stupid

2

u/Applebeignet Apr 23 '19

0 Warnings, 0 Errors?

Push it to production.

2

u/20Fun_Police Apr 23 '19

Why leetcode when you can yeetcode?

2

u/TheTsar Apr 23 '19 edited Apr 23 '19

Why not define those pp directives in a separate file (yeet) and then simply #include “yeet”

Edit: Why not direct the compiler to use a custom standard library or force the compiler to link against an object file with custom symbol tables analogous to your prep directives, thus eliminating the need for the #include statement. Then there would only been yeet (and derivations thereof, e.g. yEet).

Edit 2: Why not write a custom compiler (a program called yeet) that mimics the functionality of the brainfuck programming language, except instead of alpha-numeric symbols to program address and pointer shifting, there are only derivations of the word “yeet” that provide the same functionality. Then, you compile your file (yeet.yeet) with the compiler yeet as “yeet yeet.yeet” which will then print to the standard output “yeet.” The plaintext of the program, the program’s output, and the compiler used to create the program will then all be “yeet” (or derivations thereof).

Edit 3: Why not fabricate a custom processor and simple monolithic kernel of which all symbol tables, memory addresses (virtual or otherwise; including paged space), and processor operation codes were variations on the word “yeet” where the trinary number system is used to represented the three base symbols of the system, ‘y,’ ‘e,’ and ‘t.’ Then, even if a program created within this environment appeared to use symbols or words outside of the scope of “yeet,” there could be no possible fundamental execution or un-abstracted program that did not use exclusively the word “yeet” or otherwise symbolic derivations thereof, be they trinary representations or capital variations.

2

u/[deleted] Apr 23 '19
int main()
{
    std::cout<<“Yeet!”;
    return 0;
}

2

u/ree___e Apr 23 '19

show this the next time you have a job interview you're guaranteed to get the job

2

u/concious_atoms Apr 23 '19

Oh fuck no , Eclipse & yeeting please god no please stop it please delete it it's hurting my eyes ....

2

u/[deleted] Apr 23 '19

Lol, can't believe someone actually got gold for a repost

2

u/Pixelmod Apr 23 '19

I'm just gonna remind y'all that if you compile with CLang, you are allowed to use emojis just about everywhere.

Therefore you could swarm your code with #define 🔵 std or #define 🤣 int and so on... then watch the worlds burn.

2

u/Orffyreus Apr 23 '19

Writing yeeT yet yeetT is optional and executed by default at the end of the Yeet function.

2

u/Kilazur Apr 23 '19

yeet that shiet on the street

2

u/amicitas Apr 23 '19

You found something even worse to read than the BrainFuck and Ook! languages.

→ More replies (1)

2

u/cnhonker Apr 23 '19

Compiled with no warning or errors and it works! Good code!

2

u/[deleted] Apr 24 '19

this is the best post i've seen on ph in a long time. nice (if OC)

2

u/weeowey Apr 24 '19

yeet this code into the trash, it's disgusting.

2

u/AX-11 Apr 23 '19

what have you brought upon this cursed land?

2

u/youlooklikeajerk Apr 23 '19

A just question, my liege. Late is the hour in which this conjurer chooses to appear

→ More replies (1)

2

u/SynisterSnail Apr 23 '19

If only { was ye and } was et

2

u/[deleted] Apr 23 '19

define yeet throw

yeet new Exception ();

→ More replies (1)

1

u/[deleted] Apr 23 '19

cursed_c++

1

u/narfio Apr 23 '19

Code review will be so much fun.

1

u/xwoter Apr 23 '19

you dont need the newlines though, it'll look even better

1

u/NODENGINEER Apr 23 '19

Just like emojicode

1

u/fx_agte Apr 23 '19

Gentleman Pooh bear uses ‘Foo’ ‘Bar’

1

u/[deleted] Apr 23 '19

How to keep your job.

1

u/anime8 Apr 23 '19

Programming language of the gods

1

u/SubzeroNitro Apr 23 '19

I want to try this but with a different word

1

u/liuysuestc Apr 23 '19

WTF?????

1

u/Hapseleg Apr 23 '19

You make me sick! Yeet

1

u/Rodaxoleaux Apr 23 '19

Who hurt you?

1

u/WannabeStephenKing Apr 23 '19

I'm going to be physically sick

1

u/[deleted] Apr 23 '19

10 years ago, those would have been "skeet"s. How far we've advanced.

1

u/[deleted] Apr 23 '19

You should see my code...

1

u/[deleted] Apr 23 '19

This probably took way longer than it should have

1

u/Jokulhaupalypse Apr 23 '19

#define yeet throw

1

u/redtoasti Apr 23 '19

changes all keywords, operators and expressions to variations of yeet

still doesnt use "using namespace std"

I approve

1

u/mauri2580 Apr 23 '19

Cryptographers hate him!!

1

u/Kypsys Apr 23 '19

You should have renamed the iostream library ! Amateur !

1

u/Turtle_ini Apr 23 '19

Put those definitions into a separate header file with an inconspicuous name.

1

u/doctord7788 Apr 23 '19

I was really hoping for using namespace yeet;

1

u/BitPoet Apr 23 '19

Wouldn't that print "main"? Or does the C++ preprocessor skip things in quotes?

1

u/LordScoffington Apr 23 '19

Something about 'Yeet!'ing a return statement makes me smile.

1

u/shas-la Apr 23 '19

i thin my eye bleeded, should i yeet them?

1

u/kenanajkunic Apr 23 '19

Dear God what have you done!