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.
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.
One of the things I actually loved about Perl was its philosophy of TMTOWTDI — “There’s More Than One Way To Do It.” It made Perl incredibly expressive and powerful, but it also let you shoot yourself in the foot.
Python deliberately went almost the opposite direction: “There should be one—and preferably only one—obvious way to do it.”
That difference matters more than people sometimes realize. Perl was very much a write-first language. If you were disciplined, you could write some incredibly elegant Perl. I was always able to come back to my own code six months later and understand it. But the language didn't force much structural discipline on you, so two Perl programmers could solve the same problem in completely different ways—and neither solution necessarily looked obvious to somebody else.
Python's philosophy makes the codebase itself more consistent. You give up some of Perl's freedom and cleverness in exchange for code that is much easier for the next person to read.
As a manager, though, I'd probably choose Python. With Perl, you could end up with a codebase where understanding the software meant understanding the mindset of the developers who wrote it. Every team, site, or even individual programmer could develop its own conventions for how things were done. It was almost democratic: the language gave everyone enormous freedom, and the resulting code reflected the people who wrote it. That's great for individual expression, but terrible for organizational continuity. With Python, the language itself imposes more of the culture. There are still different ways to write Python, but the language strongly nudges everyone toward the same conventions. That means somebody can walk into a codebase without first having to learn the personality and philosophy of every developer who touched it. From a management perspective, that's a huge advantage: you aren't just managing code; you're managing the cost of replacing the people who understand it.
I also loved it because it kind of enforced most of the Pearl was in the executable. It's weird but I worked at two shops where the sis admin were terrible. Every time that I invoked python something was not properly installed where is as long as I used Perl native calls, I still could actually get my code to work. It's amazing that you had to code around the system but perl is more resistant to non-standard installations or breakages of the packages
Python originally wasn't a typed language. You didn't have to declare variables, you could just use them,
Perhaps not so ironically, this is what makes Python unsuitable for large projects. I’d rather work on large C++ codebase than large Python codebase. (Yes, I know Python has type hints, but once you start using dependencies, you discover how much of a mess type hints are).
From years of teaching and working in the industry, I've come to the conclusion that peoole think Python is easy because they use it to do easy tasks only, like college assignments
Python is easier for people to do computer science assignments in in university.
It's dogshit for anything that's enterprise at scale. I don't understand what anyone sees in it outside of university. The multithreading alone is disqualifying. Anything it does good, it does good because it's delegating to C++ libraries.
Instagram famously runs on django (python framework).
Feel free to change your thoughts on python.
Is python less effiencient than other languages? Yes, but compute for simple calcs and requests is almost free and horizontal scaling is a thing. Dev productivity is more important.
Path dependency doesn't mean it's not dogshit. Facebook runs on a PHP derivative they wrote themselves, because they were originally written in PHP. That doesn't mean PHP is good.
I don't understand what people find so easy about Python that can't be solved with a good IDE and another language. Is it just the boilerplate reduction and the terse syntax?
Okay but the multithreading... what do you do about the multithreading? For IO tasks, standard threads work fine. But for real CPU parallelism, you still have to spawn a whole new Python interpreter per worker! Because Python forces you to use separate processes instead of true threads for CPU work, you can't share memory between them seamlessly.
I'm used to leading edge Java development, and that is stuff that even 10+ year old Java 8 could do. It felt like stepping in a time machine. New Java has virtual threads, which are magic that have basically no overhead and no drawbacks.
I really have to disagree strongly with that. With hyperthreading (x2 to everything) laptops have a dozen real+virtual cores nowadays at the low end, even phones have 8 typically.
That's just performance on the table, an order of magnitude or so on the table. I hate slow applications. If you want to make something go fast nowadays the answer is multicore. We've only been inching up the single core performance the last decade.
Also, I realize not everyone does server programming or enterprise programming, but it's absolutely mandatory for that.
Yeah, I can understand it. I remember when our development shot went to python and I was trying to do embedded python and a database. It was very awkward. Doing it in Pearl was very easy.
Sometimes I feel that python went to its end and then it started trying to dig itself out of its hole especially when it came to multithreading and the GIL. Basically they said okay do everything using processes or use the async library. That was their answer to the lack of a good multi-threading capability. At least Perl did never try to play pretend it was going to be a multi-threaded language. You paint variables is being shared so that you can pass them between the heavy threads. The same way that you paint each usage of a variable with a sigil
It's basically a fork and exact underneath the covers with locking semantics so you know that it's between 2 to 50 megs per thread and you use them accordingly. This was fine because a lot of times you were reading files concurrently so this overhead wasn't too bad. Besides you were normally ssh in across different servers to get to the server that you wanted and you were escaping the command line along the way. I remember I had to nest a command maybe three or four levels deep escaping it which using substitution and regular expressions was very easy to do all in parallel
Python tried to play pretend and bit off more than it could chew and it did with threads and then at the end it now deprecates that entire library. I don't like when a languages bot genuine and it tries to play pretend like it's efficient and hides it's efficiencies
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.
The quality and stability of a lot of Perl packages was so good, and the documentation. Metacpan, docs all in one place and a good clear convention of usage examples and raw API documented. Plus all the automated testing infrastructure.
Coming from Perl, the state of the js package Eco system was so crap. Npm docs that were really poor and inconsistent, so many packages with their own bloated websites for docs. And packages like passport that only have this God damn convention / example based documentation, and don't just have an api reference. Cannot stand that.
17
u/ubd12 2d 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.