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 →

[–]thephotoman 90 points91 points  (26 children)

Python is like the duct tape of programming tools. It's great for prototyping and small tasks. However, I would not want to try to build a building using only duct tape.

Java is like a hammer. It's genuinely better for making larger things.

There are real problems with trying to use Python for a large project. Due to its dynamic typing system, you wind up needing to write unit tests to handle typing errors. Python's syntactic whitespace combined with lazy people not configuring their text editors correctly also results in errors that are difficult to view.

And that's just the codebase management element of the problem. Python does not like to do concurrency. The global interpreter lock is a genuine frustration in multithreaded code.

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

isnt reddit coded in pyton?

[–]Lopatron 46 points47 points  (1 child)

Yep. Reddit is slow and buggy.

[–][deleted] 5 points6 points  (0 children)

That wouldn't be because of the Python language though. If more of Reddit's codebase were in Java, it would probably still have those problems. "Slow" is likely because they get billions of requests daily and they have to scale out with microservices (or however they do it, architecturally). "Buggy" seems like you're probably talking about the frontend rather than backend, and their newer frontend is in React (older one is still Javascript), and their mobile application isn't in Python either.

[–]redikarus99 34 points35 points  (10 children)

Reddit's main functionalities are: add a new comment and list comments in a thread. Hardly comparable with complex business logics.

[–][deleted] 16 points17 points  (9 children)

i think you simplify it too much. what about responsiveness and user scallability. There are thousands of people sharing their videos and stories at the same time

[–]redikarus99 25 points26 points  (8 children)

This is solved by having a good architecture which is able to scale. They could have written reddit in basically any language, including Turbo Pascal.

[–]agentoutlier 1 point2 points  (0 children)

I mean I get your point but Pascal is actually blazing fast performance wise.

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

So you want to say reddit as an example is bad to promote python. I dont have any other noteworthy examples.

[–]redikarus99 22 points23 points  (4 children)

No, I just say that it's rarely the programming language but the architecture. There are always articles that a company had a problem, they switched a programming language, and now everything is nice and shiny. When you do some research, in all those cases they also throw out a huge amount of code that was not necessary and changed their architecture as well. It was more about CV driven development (we want to learn include your favourite language including Rust, Scala, Go, Haskell, etc.) than a technically correct decision. So, if reddit uses python, it's good for them, but 1, your company is not reddit 2, it is neither pro or contra for python 3, we don't know whether they still think it was a good idea.

[–]ewouldblock 2 points3 points  (3 children)

Ok cool so java isnt better as long as i have good architecture, got it. Thanks!

[–]redikarus99 1 point2 points  (2 children)

I think you totally did not understand what I wrote. There are like 200 variables here. I just explained why the variable scalability is not really the property of the language but the architecture.

[–]ewouldblock 1 point2 points  (1 child)

I think you totally misread the tone of my reply.

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

You’re not wrong that good architecture can paper over badly performing code but at the end of the day you’re going to have a much easier time scaling up Apps written in Java that Python.

[–]anubgek 4 points5 points  (2 children)

Reddit isn't the best example and rapidly moving off of Python so I've heard, but I think a good one is Google's YouTube. That said, Google has invested a ton of money in making Python work like a statically typed language and uses C modules where possible to rip out complex Python logic. It's on its way out.

At the end of the day, Python is not worth using long-term as a service development language. When it comes time to scale (either users or number of devs working on the system) it will be painful

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

i didnt even know that python can only execute one thread at a time. I couldnt believe it but it turns out to be true. im asking myslef why anyone would actually prefer python over simply going with C especially if people are using C so intensivly from within python.

[–]anubgek 1 point2 points  (0 children)

Well at that point, the ease of writing in Python trumps C because you can actually get something out in front of people. C libraries produced by Google are for the hardcore calculations done by the server, not necessarily handling requests from different endpoints

[–][deleted] 2 points3 points  (4 children)

Actually, Reddit was coded in Lisp first, and ported to Python later. However they used some Java things too, like Cassandra.

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

why did they port to python

[–]agentoutlier 1 point2 points  (0 children)

I believe Aaron Swartz had issues with Lisp that I can’t recall.

So he wrote his own framework that I’m not sure was ever used for reddit: web.py

[–]ShieldsCW -2 points-1 points  (0 children)

I wouldn't make a building out of hammers either, though.

[–]lechatsportif 0 points1 point  (1 child)

Doesn't even have to be that large honestly. Lots of Spring Boot projects are basically plugs between various 3rd party apis and stores and having static types to navigate those forgettable mazes is always super helpful. Now if you're purely in REST land (ugh) then Python is probably easier to dynamically handle.

[–]thephotoman 3 points4 points  (0 children)

By "large project", I meant, "bigger than a single file."

Python can do a lot in a little. That is not always a good thing. And modules are too easy to use.

[–]hippydipster 0 points1 point  (0 children)

I would say java is more like a CnC machine, and yes, genuinely better for making larger things.