News for hackers. Stuff that matters.
Re:Old box, dumb code, few thousand connections, no big deal by bsder on Thursday May 07, 2020 @08:56PM (#23110238)
You ... are not ... Instagram.

Okay. Get over it.

Python is fine. Threads are fine. Go is fine. Clojure is fine. Java is fine. PHP is ... okay I won't go that far. :)

You fix the problem when the cost required to fix the problem is finally less than the opportunity cost of fixing something else.

Re:Old box, dumb code, few thousand connections, no big deal by anonymoushn on Thursday May 07, 2020 @09:16PM (#23110361)
I would prefer not to deal with "scaling up" for workloads that could run in a single process on commodity hardware.

I've mainly worked at companies that would be bankrupt if they used Python the way Instagram does.

Re:Old box, dumb code, few thousand connections, no big deal by bsder on Thursday May 07, 2020 @10:23PM (#23110751)
Django and Python somehow handled websites for entire newspapers on far wimpier hardware just fine--which makes me wonder if "cloud" (ie. non-deterministic memory and I/O accesses due to sharing with other tenants) isn't the problem rather than Python.

You need a market. You need paying customers. You need cashflow. You need features. You need a business plan.

You don't need scaling. Ever. To first, second and third order approximations.

Your company has a higher probability of bankruptcy than needing scaling.

Re:Old box, dumb code, few thousand connections, no big deal by earthboundkid on Thursday May 07, 2020 @11:40PM (#23111186)
Newspapers run everything behind a CDN, so Django isn’t a bottleneck. The things they do that can’t just be CDN buffered (like ad targeting and paywalls and comments) end up being supplied by outside vendors. I think Django fits well for a news org, but it’s good to understand why it fits well.
Re:Old box, dumb code, few thousand connections, no big deal by nexuist on Thursday May 07, 2020 @09:16PM (#23110362)
PHP is fine too. Check out https://laravel.com/ and tell me that doesn't look like a joy to work with.
Re:Old box, dumb code, few thousand connections, no big deal by franga2000 on Friday May 08, 2020 @05:16AM (#23112856)
I just got roped into a project with the promise of Django, but the project lead ended up deciding to go with Laravel, so I've been looking into it for a few days.

It's a resounding no from me. If you're stuck with PHP, sure, this beats the WordPress style of...well...I can't really find words to describe how bad it is..., but it's still miles behind anything else. It full of strings and other things that you just have to memorize with IDE integration even with specialised extensions still worse than other languages with standard IDEs.

Re:Old box, dumb code, few thousand connections, no big deal by zippoxer on Friday May 08, 2020 @04:49PM (#23119289)
"String-programming" is mostly optional. Modern Laravel is introducing type-safe alternatives. For instance, instead of doing validation like:

  'gender' => 'in:male,female,other'
You can now do:

  'gender' => Rule::in(['male', 'female', 'other'])
Which, coming from Go, I very much prefer.

Modern PHP is pushing for type-safety (via type-hinting) and Laravel is following this direction as well.

Re:Old box, dumb code, few thousand connections, no big deal by phreack on Thursday May 07, 2020 @09:25PM (#23110417)
How much of the old "A fractal of bad design" post would you say still applies? That one post showcased so many footguns right at the language level that it spooked me away from it forever.
Re:Old box, dumb code, few thousand connections, no big deal by smacktoward on Thursday May 07, 2020 @10:50PM (#23110919)
You can get a good sense for what "modern PHP" looks like by browsing through PHP The Right Way (https://phptherightway.com/).

PHP has grown up a lot over the last ten years.

Re:Old box, dumb code, few thousand connections, no big deal by neurostimulant on Thursday May 07, 2020 @10:26PM (#23110770)
A lot of those are still applies, but these days you can ignore those bad parts and only use the new good parts just like how you would use javascript. Still, I only use php occasionally but I wish it's not as eager in treating string as number in many cases.
Re:Old box, dumb code, few thousand connections, no big deal by RicardoLuis0 on Friday May 08, 2020 @12:22AM (#23111356)
if you have an hour to spare, this (https://www.youtube.com/watch?v=wCZ5TJCBWMg) is a great talk by Rasmus Lerdorf, the creator of PHP, on the design of the language, the reason it ended up the way it did, and the ways that it is evolving for the better.
Re:Old box, dumb code, few thousand connections, no big deal by bschwindHN on Friday May 08, 2020 @01:25AM (#23111660)
I took a look, doesn't seem like a joy to me.

It's too stringly-typed for my tastes, seems like a lot of errors you can make will only be caught at runtime.

Re:Old box, dumb code, few thousand connections, no big deal by pjmlp on Friday May 08, 2020 @08:27AM (#23114028)
And it has JIT support out of the box, while PyPy still needs to fight for adoption.