r/ProgrammerHumor • • Apr 08 '22

First time posting here wow

Post image
55.1k Upvotes

2.8k comments sorted by

View all comments

Show parent comments

2.0k

u/barkbeatle3 Apr 08 '22

To me it’s a fun language because of the weird ways you can play with pointers. It is also a terrible language because of the weird ways pointers can play with you.

213

u/mindbleach Apr 08 '22

And trying to cast a pointer to somewhere inside a multi-dimensional array is one of the torments AM inflicts on survivors in I Have No Mouth And I Must Scream.

125

u/UltraCarnivore Apr 08 '22

The Basilisk: I mean, they could have learned a little Python, a little Tensorflow, something about NLPs, but no, they chose not to. Now they're just going to debug legacy C++ for eternity

33

u/nipss18 Apr 08 '22

I got reminded of the basilisk p much all week. Stop it already, you're giving it power!

6

u/UltraCarnivore Apr 08 '22

Even in death I serve the Omnissiah

→ More replies (1)

6

u/SaintNewts Apr 08 '22

Legacy C++, legacy C, legacy Ada, legacy FORTRAN... 😭

6

u/UltraCarnivore Apr 08 '22

Documenting somebody else's Perl Regexes

→ More replies (1)

3

u/ICBanMI Apr 08 '22 edited Apr 08 '22

As a beginner, pointers and mutli-dimensional arrays suck implementing your first few times. As someone who has been using them on and off for a few years... they are easy once you understand all the sizes in bytes correctly. It's actually a nice exercise. 4/5 times when you get something wrong, the compiler complains. The other 1/5th time the program tends to crash loudly. It's painful to learn your first time-that's for sure.

I prefer these types of problems compared to the ones that never complain and set you up to have future regressions the next time someone so much as looks at the code.

→ More replies (5)

307

u/IanSho Apr 08 '22

In capitalist America, you play with pointers...

In Soviet Russia, pointers play with you...

0

u/[deleted] Apr 08 '22

[deleted]

40

u/Vlajd Apr 08 '22

You just pushed me off my chair.

7

u/RagnarokAeon Apr 08 '22
  • Things that happen when you get dereferenced

4

u/dr4conyk Apr 08 '22

Oh God oh fuck

→ More replies (2)

75

u/S0mu Apr 08 '22

TIL- I code in 100% communist C++

61

u/[deleted] Apr 08 '22

[removed] β€” view removed comment

16

u/OZLperez11 Apr 09 '22

Comrade++

6

u/someidiot332 Apr 09 '22

I thought that's what the c stood for?

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

4

u/tiddayes Apr 08 '22

Our pointers, comrade

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

16

u/PhantomNomad Apr 08 '22

When I was in university a 4th year student told me...

Follow not the null pointer, for it shall lead you to madness.

I've never forgotten those words and it has saved me many hours of debugging.

0

u/[deleted] Apr 08 '22

[deleted]

→ More replies (2)

4

u/SuitableDragonfly Apr 08 '22

Honestly, this is why I'm liking Go now. It's still got pointers but they suck much less.

4

u/tyler1128 Apr 09 '22

C++ is great, you can do so much. C++ is awful, you can do so much. C++ is amazing, it's about the only language you can do basically anything you want at compile time and optimize in amazing ways. C++ wtf, why are templates turing complete?

I love C++. It is both the best and worst. I might need to type const 7 times in a method signiture, but man do I miss when I can't type const 7 times in a function signiture to make the constraints I want.

3

u/[deleted] Apr 08 '22

I recently learned that the templating language in C++ is itself Turing complete, and that's the most C++ thing ever

3

u/xSTSxZerglingOne Apr 08 '22

Ah pointers. Both the best and worst feature of C based languages.

We used C++ almost exclusively in the school where I went and by the end, pointers were pretty damn easy to manage.

Mind you, there was nothing large scale that we did, but I feel like OS class made pretty extensive use of them.

→ More replies (14)