4 ms·
Which ones would that have been? Perl? Python? Java? JavaScript? Among that choice set, PHP is definitely the best contender.
by mschuster91 5y ago
Which ones would that have been? Perl? Python? Java? JavaScript?
Among that choice set, PHP is definitely the best contender.
- Gigachad 5y agoI would say that Ruby on Rails is a pretty good candidate to completely replace PHP with.
- gremlinsinc 5y agodoes rails come with a generator to create a teams based multi tenant SaaS app with authorization and authentication and job queues without extra setup? (ie without decide and sidekick?)... can rails compete with the performance of octane using swoole with 8k reqs per sec? rails is the first framework I ever learned in 2012 but I kept jumping back and forth until laravel basically started lapping rails in terms of baked in goodies.
- Gigachad 5y agoI’m not sure why this really matters. You can set all of that up in rails in under an hour. And almost every company uses exactly the same libraries for it all. It’s been so long since I even created a rails app because it’s almost always already created when you start the job.
- nucleardog 5y agoI think you (and to be fair, many people) are missing a huge part of why PHP is still popular. Saying Ruby can replace PHP sounds to me like saying that Ruby can replace Excel. It's fundamentally misunderstanding _why_ it's popular in the first place. I have a HTML page. How do I add a hit counter to it with Ruby? I can do it right now in PHP with zero dependencies and it'll fit in this comment: <html><body> <p>You are visitor number: <?php $count = file_get_contents('hit_count.txt'); $count = $count + 1; file_put_contents('hit_count.txt', $count); echo $count; ?> </p> </body></html> Is it shit? Yep. Does it (mostly) work? Yep. When you want to do something, you can just copy and paste a handful of lines of PHP into a file and rename it from .html to .php and it'll basically work anywhere. You don't need to worry about frameworks or anything. Routing is handled by the web server. Hosting is handled by someone else. Deploying is just FTP'ing a .php file off to a server somewhere and then requesting it. But when you are ready to get into "real" programming, that's all there too. PHP has a true learning _curve_. Every bit of complexity is only a small step from the previous. Getting started does not require a ton of background or knowledge. You can start out copying and pasting some code into the middle of some HTML and a year later end up working within once of the nicer, more comprehensive frameworks managing your dependencies with a relatively decent package manager... and still hosting it all on your $3/mo shared hosting. If every professional developer stopped using PHP tomorrow, we'd still end up back exactly where we are as a bunch of people found PHP as the most accessible and direct solution to the problem they have.
- Gigachad 5y agoThis example seems to be a great demo of why people do not like working with PHP. PHP makes the shit method the massively simpler way and the good method much harder. Now you open yourself up to risks like what happens if we accidentally let some user input change the file opened as well as the content written. While with rails, to do basically anything, you already have a full db ready and incrementing a counter using the ORM is even easier than opening a text file. So people avoid PHP because it most likely involves dealing with absolute crap code written with no understanding.
- wbercx 5y agoI don't find these kinds of what-ifs very useful. I haven't used Rails, but does it somehow prevent you from accepting user input and programming it to go where you say you want it to go? Isn't there an element of "holding it wrong" with any language or framework?
- Gigachad 5y agoRails actually does do a good job of treating user input as dangerous and it can often detect when user input is being used in the wrong places like directly in to sql. And with industry standard tools like brakeman, you can have CI alert you of most cases where user input is not safely handled.
- netzone 5y agoThat's way too complicated for the person just starting out and wanting to add a counter to his small website. Nobody starting out with programming today will start with Rails. They might start with Javascript, but more than likely they'll start with PHP. It's accessible and SIMPLE.
- simion314 5y ago>PHP makes the shit method the massively simpler way and the good method much harder. How it makes it harder? Or you compare PHP a language with Rails a framework? Maybe shut up if you have no idea or show us a pure Ruby code that does the same thing. Or install the most popular PHP framework, really learn that and then tell us that PHP made things harder. I don't know Ruby or rails so I can't shit on that like an idiot.