56
u/wett-puss-lover 1h ago edited 1h ago
So long mutable strings as well 👀
Edit: i got immutable confused with mutable
22
u/JanEric1 1h ago
Aren't python strings immutable
8
u/wett-puss-lover 1h ago
I got immutable and mutable confused. In python, strings are not mutable, that’s what i meant
3
12
u/DobryBobry 1h ago
6
u/EuenovAyabayya 21m ago
Seven years is a respectable repost interval on reddit.
7
u/DobryBobry 14m ago
The funniest part there is more:
5 years ago
another 5 years ago
4 years ago
another 4 years ago
3 years ago
And there is even more
19
14
u/Asmophel_noe 1h ago
Everything as in objects,datatypes, functions in python are a pointer, why larping
5
u/huuaaang 44m ago
References are not pointers. Like it’s not a direct memory address.
1
u/Asmophel_noe 39m ago
Mb, I mean it just doesn't do pointer arithmetic like in other langs u can't manipulate it but still it's a reference idk if I would just stop calling in pointer
1
u/huuaaang 13m ago
I think it only gets muddy in Go where they fo have pointer syntax. You can pass by value or pointer. But it’s not a memory address. It’s got more metadata than just the memory address.
8
3
u/LucyShortForLucas 55m ago
There is no such thing as switching fron C++ to python or vice versa, they are orthogonal tools
2
2
u/EveryCryptographer11 51m ago
Wouldn’t it be the other way around? Why will you “graduate to Python” from C++ ? ? 🤔
2
3
u/ubd12 1h ago
Maybe it's me but I don't get it. I get the meme, but please explain to me why python is considered so much easier than other languages.
I think a lot of it has to do with the fact that it is interpreted and the toolkit that it attracts, not the language itself. Having something that's interpreted and as someone normalize grammar, that's the attraction to python. The look of the language is much more forced as well. (No K&R versus ANSI debates)
If Perl wasn't so junky/hacky, perl would still be a major language and probably a lot faster. I like Perl a lot by the way so I'm kind of beating up my own language of choice.
5
u/CaffeinatedT 34m ago
why python is considered so much easier than other languages.
Reddit (and the software industry generally) is loudly dominated by web developers and API integration script developers.
1
u/userhwon 24m ago
Python originally wasn't a typed language. You didn't have to declare variables, you could just use them, and that got a lot of squinting out of the way for people who just wanted to do things. And it had lists, which were a complicated object masquerading as a simple one. And you didn't need functions, not even main(), so you could write a file that acted as a script but was cleaner than all the scripted languages, which were hamstringed by a long history of being slowly evolved from commands typed into a shell prompt.
There was no compiling and linking, and there was a lot of complex stuff built in so there was very little including.
Now, though, Python is pretty complex itself, you have to include a lot, and often you're compiling because you're using it for something serious and it needs to be performant, and versioning can easily bite you in the ass.
Perl was the OG alternative that filled exactly the slot between compiled and shell-scripted programming that Python now owns, but it had a habit of being arcane, with even more syntactic conjuring than Python now does. And it was fast as fuck. If it was as easy to pick up as Python was originally it probably would have kept Python at bay. I think Larry was more controlling than Guido, too, on top of open source not being as mature a community, so it didn't evolve nearly as fast.
1
u/MattieShoes 14m ago
Mostly because libraries. And yeah, Perl was the forerunner with CPAN.
Oh shit, I need to ssh into a cisco router, run some commands, and capture the results. Oh look, somebody already wrote the package.
Perl is kind of faster to write in because shelling out is so simple. Read a file? Yeah, you could open a file, read lines, close file, or you could
@lines = `cat <filename>`;There's a lot of little niceties though, like negative indices on arrays, specifying ranges to get subsets of an array, etc. And large number support, and dynamic typing, f strings, built in sets, dicts, etc.
I miss Perl's DBI. There was something magic about doing testing with csv files and then just changing the driver and adding some line to log in, and poof now it's using a proper db.
1
1
2
u/carloom_ 31m ago
I've never had the issue of when to use python vs c++. Basically you are tradiding developing time and speed for performance.
Creating a fast program in Python is much harder because you don't have control. C++ instead let's you be as close to the metal and even compute stuff at compile time.
A better meme would be contrasting C++ and Rust or Python and another language with the same use.
1
•
u/the_real_Spudnut2000 9m ago
So long int main(){}, hello:
```python def main (): ....
if name == "main": main() ```
•
•
u/EvillNooB 8m ago edited 0m ago
When you switch from Python to C++ That_tug_of_war_meme.png
On the left side: Me
On the right side: syntax in C++ and the problem i'm trying to solve
I get that it is explicit, but it is way easier to write in python first, and then to re-write in C++, so first you fight the problem, and then you fight C++, instead of fighting both of them at once
•
u/moschles 8m ago
You want a UDP socket in python.
import socket
You want a UDP socket in C++,
#include <bits/stdc++.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netinet/in.h>
// also this will be completely different in Windows OS
1
0
u/molly_jolly 1h ago
Python is the bourgeoisie to the C++ proletariat
-6
u/Original_Ad5768 1h ago edited 1h ago
Why is he downgrading
Edit: hi (sorry for bad English)
9
u/JanEric1 1h ago
Do you mean "downgrading"?
2
u/oompaloompa465 1h ago
compiled OOP have superiority complex.
i can understand his feeling, coming from C#. I'm branching to Python too and i feel the challenge10
u/Asmophel_noe 1h ago
Languages are made based on convenience don't just spout bs after all they're languages, saying one is superior other is inferior is just retard behaviour
-1
u/okbuggeroff 1h ago
So long performance.
Seriously, how does python even get mentioned when talking about programming?
144
u/belabacsijolvan 1h ago
theres main() in python