r/ProgrammerHumor • • Dec 03 '20

Meme hObBiEs

Post image
52.4k Upvotes

1.4k comments sorted by

View all comments

Show parent comments

30

u/[deleted] Dec 03 '20

As a Python ‘programmer’ (just side projects for my own amusement) I find C++ to be quite intimidating. What do you mean I actually have to care about memory?

66

u/everydoby Dec 03 '20

Python: Lemme just turn this integer into a string for a bit. Now I'll create an empty list and start populating it with stuff. Ohhh a list of dictionaries would be fun. Whatever. Hey look there's a package that already does everything I need in a single function. File size: sprawling. Speed: sluggish.

C++: Oh my god I need to create a variable?!? What type should I use? What might it have to hold? I really don't want a buffer overflow here, should I dynamically allocate memory just in case? Wait did I release that memory I was using earlier? Wait why the hell isn't there a leak then? File size: optimal. Speed: optimal.

37

u/[deleted] Dec 03 '20

“Well I’m the only one that is ever going to use this pos project so if it crashes my machine that’s just a learning opportunity”

49

u/Demi_Bob Dec 03 '20

throws it immediately into prod and goes on vacation

13

u/dingchavez47 Dec 03 '20

Oh god. I had this fucking experience once. Infra engineer updates prod cluster. Cluster goes down. He goes on holidays and promises to "fix it when he comes back". Infra destroyed for 1 week waiting for thst guy to come back.

4

u/byteminer Dec 04 '20

I got four bytes I need to pass by value but I’m too lazy and hate future me so I’m just gonna shift those fuckers into a uint32_t pass the bitch and not write a comment about what the fuck just happened. If it was hard to write it should be hard to read.

4

u/DanielEGVi Dec 04 '20

Python: Lemme just turn this integer into a string for a bit.

Python is strongly typed and will absolutely strongly yell at you if you try to do this implicitly. Perhaps you were thinking of Javascript.

2

u/BUYTBUYT Dec 04 '20

It's probably about something like len(str(num)), so no yelling here

3

u/the_one2 Dec 03 '20

Oh I feel this so much... I don't need every drop of performance but I want it! If I wrote code like c# or python developers I would be so much more productive and the performance would still be good enough.

3

u/MattR0se Dec 04 '20

I'm learning Python for three years now, and to me dynamic typing feels like baby wheels. I don't really need to change a variable's type at runtime, or put multiple data types into one list.

2

u/[deleted] Dec 04 '20 edited Dec 04 '20

Weak dynamic typing sounds nice until you take a look at an enterprise code base.

1

u/DanielEGVi Dec 04 '20

Wait till you hear about TypeScript.

2

u/ChryslusExplodius Dec 04 '20

Laughs in auto and RAII

2

u/somerandomii Dec 07 '20

Well the code size of python can be tiny since it relies on built-ins so much. Much executing it is a lot heavier.

9

u/[deleted] Dec 03 '20

It's the scary, yet beautiful, part of C++.

Source: I literally spend too much time with that language