9 ms·
The current reddit seems to be written in js/python. I can see the logic behind js since its a lot easier to find devs and thanks to all the hard work of the en
by wudangmonk 3y ago
The current reddit seems to be written in js/python. I can see the logic behind js since its a lot easier to find devs and thanks to all the hard work of the engineers behind v8 its not a slow language. I do not understand why python was chosen though. If you need more speed you would go with c++ and not python which is the slowest popular language.
Anyone got any insight into why python was chosen?.
- colordrops 3y agoI imagine because it's obviously "fast enough" performance-wise, and an order of magnitude faster dev-wise and hiring-wise.
- buildbot 3y agoNot fast enough to develop good moderation features with 2000 employees
- winrid 3y agoI would argue that's because they went the microservices + react route, so now everything is probably more difficult to implement, especially since the monolith is still in the center.
- littlestymaar 3y agoNot fast enough to keep their operational at bay though.
- _8j50 3y agoUmmm...same reason as JS? Why do you think they need more speed to the point they need c++? Do you think finding c++ devs easier than python devs?
- wiseowise 3y ago> Ummm...same reason as JS? Why do you think they need more speed to the point they need c++? Well, given complaints how much 3rd party apps cost them, they’d better off optimize their crap first.
- _8j50 3y agoIt's not really about cost, it's about convincing investors CEO dude is in control and can make reddit profitable for their planned IPO. "We spent a shitton of money migrating to C++ and hiring expensive and harder to replace C++ talent to optimize shit" is not a good selling point.
- wiseowise 3y agoI know what their plan is, just pointing out their hypocrisy.
- hickelpickle 3y agoBecause Spez can't read it, he can only parse shapes. https://www.youtube.com/watch?v=oq7DEUhr7o0 https://www.youtube.com/watch?v=oq7DEUhr7o0
- sen 3y agoI can’t tell if this is an AI fake or not, and that scares me.
- mtlmtlmtlmtl 3y agoIt was uploaded 9 years ago. Definitely real.
- dimal 3y agoThat’s not what he said. He’s actually making an interesting point about readable code. I’m not defending his current behavior, just these comments about readable code.
- winrid 3y agoIt was chosen because at the time because python was much more mature and productive. They didnt use Django, but as an example Django is still more productive than any Node framework I've tried thus far, too, and we have types now. :)
- codetrotter 3y agoNodeJS didn't even exist when Reddit started using Python, as far as I can tell. Initial release of NodeJS was May 27, 2009; 14 years ago. Swartz was involved in the development of Reddit until he departed from the company in 2007. And we know that parts of the Python code for Reddit was written by Swartz.
- littlestymaar 3y agoWow, that sounds so early to adopt Python!
- xcv123 3y agoPython was released in 1991.
- littlestymaar 3y agoAnd Ruby in 1995, but it wasn't before 2005 (and Rails) that it reached traction. In 2007, albeit 16 years old, Python was still far from mainstream, especially out of its scripting niche.
- wk_end 3y agoThat doesn’t match my recollection. I’m not sure how to prove anything, but I’ll note that Python 3.0 was released in 2008. If Python 2 wasn’t already extremely popular and well-established at that point, I doubt we’d have seen the brutal 10+ish year migration from it.
- mg 3y agoI have a theory (which nobody I ever met shares) that the visually most beautiful language is the one that long-term results in the fastest development of a project: Visual noise is like inflation. A constant tax on what you do. But you barely notice it. But it accumulates because it is constantly leading to slightly worse and more complex code. Since it is harder to focus on a noisy something in front of you, you make slightly worse decisions. Over time this accumulates. And similar to how Warren Buffet noticed that a Dollar of his youth is not even worth a penny these days, over time, exponentially more effort is needed to develop the more and more complex system. So over a longer timeframe, a visually more elegant language wins by a long shot. Python is the visually most elegant language.
- bitwize 3y agoScheme has entered the chat.
- stuaxo 3y agoAlthough now people use types with python, is it still ?
- mg 3y agoWhat other people use does not change how you can use the language. You don't have to use types. I just took a look at the 4 latest Show HNs which are written in Python. None of them uses types.
- mtlmtlmtlmtl 3y ago__visuallyelegant__
- paganel 3y agoThat should trigger the good sense of any “Zen of Python” die-hard. Not saying I haven’t used/got access to double-underscore thingies in Python in my 15+ years of writing Python code, but I always felt dirty in doing that.
- traverseda 3y agoDo you actually think CPU usage is a concern here? Database performance and optimization, horizontal scaling, cache optimization (and cache invalidation) are the big problems. Security is also a big problem. The performance critical part is the database, and that at least used to be written in Java (cassandra db). Writing the bit of glue code between your high performance database and your fronted in cpp would introduce all kinds of really bad potential bugs, scary remote code execution bugs. CPU usage of that glue code might take up 10% of your hardware budget worst case, even with a "slow" language. It's just not a concern.
- TeMPOraL 3y agoWe're not talking about 10% factors, but 10x factors between slow and fast languages. People say CPU usage doesn't matter when you're horizontally scaling, but horizontal scaling increases your ongoing operational costs, and you often are horizontally scaling precisely because your code is too slow.
- traverseda 3y agoWhat percentage of cpu time do you think would be spent in python land?
- phire 3y agoI'm not sure why python was chosen. But I contributed a tiny bit of code to reddit back when it was open source and chatted with reddit engineers on IRC, so I do know the official justification (as of 2010ish) for reddit sticking with python: Websites are mostly IO bound anyway. The hot parts like markdown formatting and templating are already c modules. So the performances gain for rewriting in a compiled language aren't large enough to justify it.
- Baeocystin 3y agoThat seems reasonable to me, even today. Am I off-base?
- vlakreeh 3y agoIncredibly reasonable. People love to trash on the performance of Python and JS saying that they're totally unsuitable for backend services with non-trivial amounts of traffic when they're usually the most cost effective solution for a business. These higher level languages are easier to hire for, much easier to prototype, allow for faster iteration, allow for substantially faster on-ramp time, and are fast enough to run these io bound workloads.
- hedora 3y agoI have had the opposite experience with every python team I have interacted with. On top of it being slow and brittle, dependencies break, needlessly destabilizing stuff. Worse, the python team ends up having the hardest job, due to self-inflicted problems, so it either ends up with junior devs that don’t know better, or bitter senior devs that could be 10x more productive doing something else. As always, it varies from company to company, but this is what I saw on four teams out of four at multiple companies.
- pphysch 3y ago> dependencies break You can abuse dependencies in every language. This doesn't sound like a Python problem but a bad tech management problem (i.e. who signed off on allowing 'randomguy69/left-pad' as a dependency).
- marcinzm 3y agoIn my experience one of the limiting factors of a language as you scale is library support. You want to do more complex things (for better or worse) or integrations (monitoring, etc.) but the development cost is very high since you have to write the whole part yourself or make tradeoffs on the limited libraries available.