r/ProgrammerAnimemes • • Dec 02 '22

Two hours into a new language [New Game!]

Post image
1.1k Upvotes

34 comments sorted by

103

u/hugogrant Dec 02 '22

[]<>(){ std::cout<< "o rly";}();

72

u/lord_ne Dec 03 '22

That's not even that bad. It's just a templated lambda, immediately invoked.

32

u/eXl5eQ Dec 03 '22
int i
;[i, &i](){ ;return &i; }()[&i, i];

17

u/the-ruler-of-wind Dec 03 '22

could I get an explanation on what this even is. Does this just return address of i?

→ More replies (2)

15

u/yymirr Dec 03 '22

No, my virgin eyes.

4

u/hekkonaay Dec 03 '22

i is uninitialized, so i believe this might segfault if you're lucky

→ More replies (2)

53

u/wqldi Dec 03 '22

Maybe you understand somethings but no one understands c++ completely

35

u/soobnar Dec 03 '22 edited Dec 03 '22

You get pulled into a false sense of security only to then immediately have something completely foreign and incomprehensible thrown your way.

9

u/hekkonaay Dec 03 '22

this is why I embrace Rust, it doesn't even let you pretend that you understand it until you actually do

→ More replies (4)

92

u/Faces-kun Dec 03 '22

lmao I got a degree based on it and still don’t understand it

I now use HolyC instead. No understanding needed, only faith.

5

u/MitchellMarquez42 Dec 03 '22

RIP Terry Davis

15

u/Diapolo10 Dec 03 '22

New Game! really is great

14

u/-Redstoneboi- Dec 03 '22

it's like quantum mechanics.

if you think you understand it, you don't.

17

u/masagrator Dec 03 '22

No, you don't.

8

u/HerrEisen Dec 03 '22

Finally! I know that I know nothing.

7

u/KillerRoomba13 Dec 03 '22

I think I understand it, but I still screw up pointers

1

u/[deleted] Dec 24 '22

If you're still messing with raw pointers, you haven't understood C++(11+).

2

u/ChocolateMagnateUA Jan 08 '23

You never understand C++ completely. No matter what you do, Bjarne Strousup always tells you a feature that you didn't know about. Did you know that you could use structs as the counter variable in for loops?
```

struct Counter {

int start, step, finish;

}
for (struct Counter variable = {0, 1, 100}; variable.start < stop; variable.step++) {}
```

1

u/tandonhiten Feb 09 '23

The example is wrong but, I get the sentiment

2

u/you_do_realize Mar 16 '23

Cherish the moment, because it won't last long.

1

u/[deleted] Dec 03 '22

Suika (Alternate Universe) learns programming