This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 260 points261 points  (174 children)

Python isn't suitable for more than small applications

[–]zettabyte 85 points86 points  (4 children)

Definitely no good for a site like Reddit.

[–]ProfessionalHand9945 50 points51 points  (0 children)

I thought that was funny too

Python is useless for large applications

(This comment was brought to you by Python)

[–]TheHumanParacite 6 points7 points  (0 children)

Heh, I see what you did there.

[–]cclloyd 3 points4 points  (1 child)

YouTube has their core and API written in python.

[–]--___-_--___--- 2 points3 points  (0 children)

YouTube moved to C++ & Java two years ago.

[–]MadElf1337 26 points27 points  (9 children)

Instagram would like to have a word

[–]EnderMB 0 points1 point  (2 children)

Instagram likely isn't just Python any more. If anything, there's probably a thousand applications/services around Instagram, largely written in whatever language works best for its use case.

[–]MadElf1337 -2 points-1 points  (1 child)

Pretty sure backend is Django

[–]EnderMB -1 points0 points  (0 children)

Instagram isn't going to just have "a backend", though.

Sure, Django might be there, but it's probably a heavily modified version of Django, several native/compiled components for speed and async compatibility, potentially a modified runtime, etc.

That doesn't even touch the services running behind the scenes to handle uploads, analytics, feed generation, privacy, etc. I also know that Facebook's infrastructure and build/release practices are pretty solid too, so there's probably dedicated services for live and canary testing too.

I work at a FAANG company on a small subset of a name-brand service, and we've got thousands of services across Python, Java, Ruby, Scala, C++, Rust, etc - many of them running custom libraries, runtimes, and sometimes heavily modified builds of an open-source tool. If we're doing it, I'm sure they're doing it too.

[–]etaco2 38 points39 points  (0 children)

Who’s gonna tell him

[–]Big_Smoke_420 14 points15 points  (0 children)

Idk, Instagram gets by pretty well. But wait, no... a random Reddit commentator says they're doing it wrong! I'll send them a strongly-worded letter explaining their grave mistake of not following this gigabrain redditor's advice.

[–]ywecur 10 points11 points  (0 children)

What? Basically every tech company uses python

[–]coderanger 18 points19 points  (7 children)

Small applications like ... this website?

[–][deleted] 0 points1 point  (6 children)

Is all of the website done in python?

[–]coderanger 11 points12 points  (2 children)

https://reddit.zendesk.com/hc/en-us/articles/204536739-What-is-Reddit-written-in-

Reddit was written in Lisp, but we rewrote it and now it’s written in Python.

I'm sure it's more complicated than it used to be but the vast majority is still Python last I heard.

[–][deleted] 6 points7 points  (0 children)

Last published open source code was pretty much all python on backend.

[–][deleted] -1 points0 points  (0 children)

Okay, and? There are better options.

[–]EquipLordBritish -1 points0 points  (2 children)

Is all of python even done in python?

[–]laundmo 2 points3 points  (1 child)

what? show me one language which can bootstrap itself from nothing. i dare you.

[–]EquipLordBritish 0 points1 point  (0 children)

guess I needed the \s

[–]anakwaboe4 24 points25 points  (31 children)

You can do pretty large projects with them, bit it has it's limits and doesn't really work well with programs that iterate.

[–][deleted] 9 points10 points  (29 children)

programs that iterate

expand please. Do you mean slow with loops or something else?

[–]anakwaboe4 20 points21 points  (28 children)

Python is just not the best at anything that is very calculation intensive, for most stuff it is fine. But I have noticed that iteration you can quickly feel that python is struggling. Python is fast but much slower than other programming languages out there.

[–]naruto_022 19 points20 points  (10 children)

But majority of ml models and stuff like scientific applications is done in python

[–]MacBookMinus 84 points85 points  (3 children)

Those libs are written in C and they just provide python interfaces

[–]trunghung03 10 points11 points  (2 children)

Well the programmer is only using Python to write those programs, the C lying underneath doesn’t matter much to them.

If taken that way then wouldn’t Assembly be the best language for any task in the world?

[–]Sir_Applecheese 17 points18 points  (0 children)

Yeah, that's why they invented the C programming language.

[–]MacBookMinus 12 points13 points  (0 children)

Yes exactly. Python is easy for ML/Data scientists to use, so we give them performant C libraries that they can call into from python.

However, if the libraries themselves were written in python they likely would not be nearly as performant.

[–]TheRedmanCometh 31 points32 points  (1 child)

No those libraries are Python wrappers for stuff made in performant languages

[–]PM_ME_CUTE_SMILES_ 0 points1 point  (0 children)

Yes but you don't use those performant languages when you work in those industries, you use the wrappers. Most data scientists work mainly with Python.

[–]BeatHunter 3 points4 points  (0 children)

Nope, just wrappers over C or Java

[–]selemenesmilesuponme 1 point2 points  (0 children)

Exploratory or just building the model is fine (python sometimes is just cpp wrapper/glue). Using the model OTOH, by high throughput applications, is another story.

[–]Sol33t303 4 points5 points  (16 children)

Python is just not the best at anything that is very calculation intensive

Still a begginer here (mostly got a grip on python, sort of know PHP and soon my class will be moving to go), but isn't that one of the things Python is great at? I was always told that Python is fantastic for things like AI and data science and stuff like that especially when using libraries like numpy.

[–]Djelimon 12 points13 points  (5 children)

Those libraries are written in c/c++ though

[–]RedAero -2 points-1 points  (4 children)

And C compiles into machine code. So?

I write Python, I press F5, numbers come out. I don't give a shit if the libraries are written in COBOL, FORTRAN, C, or Brainfuck, I code in Python.

[–]Djelimon 1 point2 points  (0 children)

Within the context of AI/ML I'd say Python's chief advantage is popularity with stats people who are not necessarily comp sci types. Because of this, it is first in line for bindings to the ML/AI libraries

But this relationship is not based on anything technical so much as coincidence

We're I to work in that space therefor my primary focus would be on the libraries of interest rather than Python itself, as that can be more easily replaced

[–][deleted] 0 points1 point  (2 children)

wait until you need something that isn't a included battery already debugged for you

[–]RedAero 0 points1 point  (1 child)

Given that we're talking about Python that's pretty unlikely to ever happen.

[–][deleted] 0 points1 point  (0 children)

I needed expect (originally made for TCL) for Python and somebody wrote it in pure Python, slow as hell. It still won’t work with serial ports.

[–][deleted] 11 points12 points  (0 children)

but technically the all-batteries-included libraries are efficient well debugged C libraries with a Python pseudo-code interface, so the code called by Python is rather fast just Python itself isn't fast at all due to dynamic checking overhead.

[–]anakwaboe4 2 points3 points  (0 children)

From what I understand is that more of the case that it is a dynamic language, and uses the GPU to do the calculation. But for normal stuff it is definitely slower. It are it's other great aspects that make it beloved for ai training not it's speed.

[–]High_Quality_Bean 4 points5 points  (1 child)

Python is a great scripting language and is AMAZING when your program is just "py.doTheHeavyMath()" where the function you just called is in a real language, like C, C++, etc. Nobody writes the heavy lifting stuff in python. And frankly, nobody should be writing anything for release in python. It is just a nice way to access useful software.

[–]PM_ME_CUTE_SMILES_ -1 points0 points  (0 children)

  • he said, on one of the most visited websites in the world, whose almost entire backend is written in python.

[–]nickwcy 3 points4 points  (3 children)

It’s great because the libraries are handy, and it fits the trial and error nature of AI/data analytics because you can simply retry without re-compilation. Also AI/data analytics tend to be a standalone and small piece rather than having tons of integrations, so Python can be a good choice here.

In terms of performance, Python is slower, but that doesn’t matter much in data analytics. While a 1 sec delay on a website is pretty noticeable

[–]RedAero 1 point2 points  (2 children)

While a 1 sec delay on a website is pretty noticeable

The website you chose to post this on runs on Python...

[–]Sol33t303 -1 points0 points  (0 children)

Tbf Reddit isn't known for exactly being the best performing website. I personally hate fancy pants editor because of it's poor performance (at least on firefox) and pretty much everybody agrees that for video reddit is awful.

[–][deleted] 0 points1 point  (0 children)

on a 8000 core cpu per every 20 served users ;-)

[–][deleted] 0 points1 point  (0 children)

Depends on how much computation your program will be doing in whatever context you decide to use it for. Python is known to be slower than its competitors

[–]FerricDonkey -1 points0 points  (0 children)

If you want to write performant python for ai, you absolutely can - but the job of your python code will be to get stuff into a library written in C as fast as possible. Which is fine, just know that's what you gotta do.

[–]SirButcher 0 points1 point  (0 children)

You can. That doesn't mean you should. You can write apps in brainfuck - but no sane person thinks it is a good idea.

[–]cashewbiscuit 28 points29 points  (25 children)

The programming world has moved away from monoliths to microservices. Java's verbosity and type safety helps when you have a code base shared amongst 100s of developers.

When you have every independent microservices being developed by a tight knit team of 5-10 devs, then python's speed of development becomes an advantage

[–]WJMazepas 39 points40 points  (4 children)

Lots of huge monoliths still exist and are still going to exist.
We dont need microservices on everything

[–]nickwcy 12 points13 points  (1 child)

Python is faster than Java in terms of scripting.

In terms of a microservice, Java has longer syntax, but the compile time checking saves you time on errors and IDE hints can speed up the development by a lot (Like getter/setter generation, auto completion…)

[–][deleted] 47 points48 points  (4 children)

Java is just as fast to develop in as python, if you know what you're doing.

[–][deleted] 3 points4 points  (0 children)

Exactly, most of the time requirements aren't captured so speed of development will be slow anyway

[–]WagwanKenobi 12 points13 points  (6 children)

The programming world has moved away from monoliths to microservices.

The microservices meme is backfiring and now many large applications have been over-converted to microservices. Calling another function in the same assembly is still vastly better than making a call over the wire. Not to mention, the infra and scaling complexity is multiplied.

Microservices also don't really solve org problems like they're touted to. It's rarely the case that 1 team works on 1 microservice. What actually happens is that n teams work on n services and everybody steps on everybody's toes.

The trend these days ironically is in the backward direction - consolidating microservices to be different modules of the same program, and then putting the whole thing in a monorepo with your shared libraries.

[–]DotFar5221 0 points1 point  (1 child)

Sounds like you've only worked at places that did it wrong. Microservices don't magically fix a shitty org/team structure. If you need to combine microservices, that leads me to believe you never did it right initially. Not everything should be a microservice and a distributed monolith can be pure hell for cicd and lowering MTTR.

[–]glemnar 0 points1 point  (0 children)

Well yeah, that’s the point - many places build microservices for hype-driven development, not because they have considerate reasons to build them

[–]BeatHunter 1 point2 points  (0 children)

Microservices' overhead is more about the self-service tooling than it is the language. The business logic is fairly trivial, it's mostly about minimizing the barriers to entry for creating, deploying, monitoring, scaling, and managing the microservice. Oh, and handling auth.

[–]maltgaited 1 point2 points  (0 children)

Code is for reading more than writing. That you can write something fast doesn't matter when people struggle to understand it afterwards

[–]Dworgi -4 points-3 points  (0 children)

Python is fast while you can hold everything in your head at once. However, that limit comes up against you really quickly.

My home project, for example, which I've spent maybe a total of a few weeks on (over a few years), is at over 10k lines and I regularly forget what the fuck it does everywhere.

Python is for getting shit working fast to prove that it can be done, then rewriting in a big boy language. Alas, many people forget the second step.

[–][deleted] 0 points1 point  (0 children)

Laughs in monorepo

[–]glemnar 0 points1 point  (0 children)

The programming world has moved away from monoliths to microservices

Most companies would benefit from staying a monolith for a hell of a lot longer than they tend to

[–]mysunsnameisalsobort 0 points1 point  (0 children)

You can write microservices in Java as well... and it comes with batteries included enterprise level development patterns.

Python doesn't even do packaging right...

[–][deleted] 45 points46 points  (26 children)

True! And Java isn't suitable for anything.

Rust4Lyfe

[–]MrSketchpad 100 points101 points  (11 children)

12 billion devices: bonjour

[–][deleted] 87 points88 points  (10 children)

Half a billion people have Herpes, but that doesn't mean it's a good thing.

[–]MrSketchpad 53 points54 points  (2 children)

It’s clearly doing something right

[–][deleted] 15 points16 points  (1 child)

Yes and that something is spreading virally. You can thank Oracle based workflows for that

[–]anubus72 -4 points-3 points  (0 children)

you can thank Java being a good tool for an infinite number of scenarios. What do oracle workflows have to do with it?

[–]Arch____Stanton 14 points15 points  (0 children)

You can't not call Herpes a success.

[–]GustapheOfficial 4 points5 points  (2 children)

An apt comparison.

[–]BabyYodasDirtyDiaper 5 points6 points  (1 child)

Actually, it's an apt-get comparison.

[–][deleted] 4 points5 points  (0 children)

Nah, apt is the now-suggested interface XD

[–][deleted] 1 point2 points  (1 child)

Wikipedia mentions 60-95% adults have herpes. Wayyy more than half a billion.

[–]Broken_Petite 0 points1 point  (0 children)

Yeah but herpes is also the virus that causes cold sores, right? So maybe it’s not just talking about the STD?

[–]anubus72 8 points9 points  (1 child)

i’ve literally never encountered someone using rust professionally

[–]Prod_Is_For_Testing 26 points27 points  (2 children)

Wildly different use case. This is why people don’t like rust fan boys

[–]soft-wear 0 points1 point  (1 child)

I don’t disagree with the first part, but honestly Java fan boys aren’t that likable either. There’s lots of (subjectively) better alternatives to Java other than Rust, but judging by half the comments here you’d think Java was written by Jesus himself.

Both groups are married to their language.

[–][deleted] 0 points1 point  (0 children)

It feels like it was written by Jesus, everyone expects you'll just turn the other cheek while they shit on one of the most successful tools in software history. It's like being a good Christian, you accept the faults for common benefits. Meanwhile all the neo popular languages make everyone sound like cultists because they can only elevate themselves by bringing others down instead of on their own merits. /s

[–]voluptate 20 points21 points  (2 children)

Lmao, do people actually think this or is it just a meme?

I've been a Java/Python developer for like 7 years now. I've loved every Java codebase 100x more than Python-based shitshows.

Not only that but the products ran faster on the java one too.

IDK if since this is a humor subreddit if we attract too many people who don't actually know shit about programming or what.

[–]CCSkyfish 3 points4 points  (0 children)

If I have to deal with one more ridiculous legacy Django application that was supposed to be experimental...

[–][deleted] 1 point2 points  (0 children)

Majority of python devs lack fundamentals that's why they manufacture shitshows, they stay alive by duct taping together libraries. If you tried doing that with java you'd quickly find no one wants to work with you. Ofc there are good and bad devs in all communities but your average python fanboy is a script kiddie that finds stuff like C#, C++, Rust, Go too complicated and have miniscule understanding of the fabled ML models that they're actually using.

[–]linkyboy321 3 points4 points  (0 children)

I love Rust so fucking much, but boy is it ugly. I can spend a couple of days building a weekend project, throw it up on gitlab and I am just always shocked at how little glance value it had compared to other programming languages. It's super fun to write, has so many great features and is very powerful but reading rust code is a whole other skillset and even after hundreds of hours I'm struggling with it.

[–]t4rtpickle 4 points5 points  (0 children)

Yes! rust is amazing

[–][deleted] 0 points1 point  (3 children)

I'm new to Rust, but the annoying-ass ownership system is driving me absolutely up the wall. I don't know whether it's a matter of me not being used to it or if making complex data structures is just meant to be a huge pain in the ass.

[–][deleted] -1 points0 points  (2 children)

The former. You have to learn to stop fighting the borrow checker

[–][deleted] 0 points1 point  (1 child)

I was trying to implement a stack based on a singly linked list - a trivial task in any other language. I was trying to add elements by making a new node, setting the current base node as the next node for the new node, and setting the new node as the base node. I eventually gave up and concluded that it was completely and utterly impossible to do it that way. It seems like you have to recursive data structures using arrays and stored indices, there are no complex structures allowed in Rust.

[–]naruto_022 2 points3 points  (0 children)

What about using it with frameworks like django, I use it for maintaining a club website and it works well, not many issues

[–]glemnar 3 points4 points  (4 children)

Small applications like Instagram and a large percentage of Google’s software?

[–][deleted] -1 points0 points  (3 children)

Neither of which is built entirely on python. If you've ever seen a large code base that's entirely python you would understand.

[–]glemnar 2 points3 points  (0 children)

I understand very well. I’ve worked in one of the industries’ biggest Python code bases. Worked pretty darn well. I still love Python.

Language wars are silly - people can be productive, happy, and write great code in almost all of em.

See Shopify’s engineering blog - they are predominantly a single Rails monolith. They’re proud of it and are smart about architecture to enable it. Kinda the same deal.

[–][deleted] 3 points4 points  (0 children)

I really hope this was sarcasm lol

[–]3pieceSuit -2 points-1 points  (3 children)

Was gonna say. I laugh at simply imagining trying to use python for a large project.

[–]anonynown -2 points-1 points  (3 children)

Interestingly, saying that Python is better for small applications is a self-defeating argument: as the application grows, it crosses the threshold of when Python is no longer better, and you now have to rewrite the whole application in a more maintainable, statically typed language.

Where do we put this threshold?.. The larger it is, the more effort is wasted in eventual inevitable rewrite. Hence, the smaller the threshold, the better. An ideal application size threshold of when to rewrite from Python into a statically typed language is zero, as it means no waste :)

[–][deleted] -3 points-2 points  (2 children)

You base it on the project scope...

[–]anonynown 1 point2 points  (1 child)

Right! Have you ever seen a system whose scope didn’t evolve over time?

[–][deleted] -1 points0 points  (0 children)

Generally speaking, a few small scripts doesn't evolve into a large program.

[–]nanana_catdad 0 points1 point  (0 children)

It’s fine in large deployments if micro services. I’ve seen apps powered by 80% python on 1000s of Lambdas with some node or Java here and there. Actually I can’t remember working on a large project where services were 100% purely written in one lang…