4 ms·
This is going to sound like I'm trolling, but: why not just use Ruby? Like many Ruby developers, I left PHP because I saw the kind of stagnation the author des
by billybob 15y ago
This is going to sound like I'm trolling, but: why not just use Ruby?
Like many Ruby developers, I left PHP because I saw the kind of stagnation the author describes at the beginning of this article. I saw lots of good ideas originating and flourishing in the Ruby world, and sometimes trickling back to PHP. I saw a more well-thought-out language that seemed worthy of all that attention. So I hopped.
The libraries and library management tools and frameworks available to me now are awesome. Ruby itself is getting faster all the time. Is there really any reason left to stick with PHP other than inertia? (I don't mean that dismissively; if you have a massive existing code base, that's real inertia and changing would be a tall order.)
You can substitute Python or Node or whatever for Ruby here, but my point is: why fight the uphill battle to bring good tools to a language when other languages already have them?
- Mikushi 15y ago- PHP is the easiest to find hosting for, to setup and to learn. - PHP is still the best at generating web pages. - PHP offers all the tools needed to build strong applications (PHPUnit, xDebug, XHProf, ...) - PHP is not as bad as people like to say. And I could go on for hours on why I (and others probably) stick to PHP.
- qixxiq 15y agoUnfortunately the common argument is not always true. To be honest at this point in time I would say PHP is actually the hardest to find hosting for. I'm a long time PHP developer and just recently tried Heroku out -- its like magic. Best for generating web pages is a meaningless metric, and... To be honest my main issue with PHP relates to the defense that "PHP is not as bad as people like to say.". I mean, really - its true. PHP5 is significantly better language than the previous versions, and people always over-exaggerate how bad it is. The problem is that PHP is not a good language. Whenever I develop in Python/Ruby I actually enjoy the 'feel' of the language, and I'm often impressed by the power it has to do really complicated things in simple concise instructions. Most of the time when I'm working with PHP the feeling is very different. I can perform the same operations but generally theres far more cruft, and a couple manual lookups to see why functions behave differently when hashes ("arrays") have numeric indices (I'm looking at you array_merge!)
- darkstar999 15y ago> PHP is actually the hardest to find hosting for. What? No. Do you have any proof of this? I have yet to come across a "normal" shared/dedicated hosting service that doesn't support PHP. That is an insane statement.
- bradhe 15y agoHosting isn't a very good metric in the first place. In a time where PaaS is going crazy and IaaS is crazy easy to find from tons of vendors, shared hosting is an out dated model that is only marginally a better option. Although, it is way, way cheaper.
- qixxiq 15y agoThe reason for that is because your definition of normal hosting is shared. (On a dedicated host you can run both PHP and Ruby; and they're roughly the same in terms of getting set up.) In terms of actually finding website hosting for an application? Saying PHP is the hardest was likely an over-exagguration, but the market for Heroku PaaS style hosting is growing massively and its Ruby runs on it very easily. Its not hard (at all) to find hosting for either, the only reason in my mind PHP is harder is because of how beautifully PaaS works and that its free for small applications (good luck finding a reasonable free php host -- I know they exist but you'll have to dig through a whole lot of crud first)
- kijin 15y agoThe HN crowd is biased in favor of dedicated and virtual servers. But a very large number of mom-and-pop web pages and small business sites are still hosted on shared. That's what normal hosting means to a lot of people, and it's a market that developers of popular tools (like Drupal and WordPress) can't ignore.
- Mikushi 15y agoFinding hosting for PHP is not hard. If you like Heroku, check out PhpFog.com or Orchestra.io. It's like magic too. "PHP is not a good language" what is a good language? To take your example, I do enjoy the feel of PHP, it feels natural to read to me, and after years of using it I rarely have to check the documentation for function behavior (such as array_merge...).
- phawk 15y ago// PHP is the easiest to find hosting for, to setup and to learn. If you don't have PHP installed, it's probably the hardest to setup, much easier to install Java, Ruby (rvm), node.js. To learn, the easiest language is the one you already know. I do believe PHP is a good language to start on if you have had no prior development knowledge, starting out with C like syntax is always a good idea, but certainly would like to thing complete newcomers would prefer the weaker more dynamic syntax of Ruby / Python. Hosting wise, yes pretty much every server on the web hosts PHP, with the rise of platform as a service though, PHP lacks behind the other platforms offerings because of it's non-existant package management. PaaS is definitely getting a lot bigger, and takes all of the effort out of server administration, for newcomers I'd recommend PaaS, the learning curve for Sys admin is too high at the start. And in reality, heroku is one of the best offerings, just pushing up a Java app with a small dependencies file and everything gets installed for you, love to see PHP do that in the future, but in reality it just doesn't. - PHP is still the best at generating web pages. What?! - PHP offers all the tools needed to build strong applications (PHPUnit, xDebug, XHProf, ...) Testing - PHP is probably the worst language I've ever written tests in, it is horrible compared to Ruby, Java, Node, Objective-C, C#. Other languages provider far better testing tools and debuggers. xDebug is horrible to setup compared to other languages where the debugger just works. - PHP is not as bad as people like to say. I agree with this point for sure, PHP 5.3 copes with most normal object oriented stuff, but so do all the other good languages for writing web applications, only the other languages have fantastic implementations, not "not as bad as people think" implementations. If this is one of your main points in recommending a language, that is shameful.
- qixxiq 15y agoWhile python/ruby are arguable better languages in a lot of ways, they're also completely different and lacking in a lot of what PHP offers. Everyone has their own languages of preference, and personally I really dislike working with python (not too much experience in ruby) while dealing with websites. I cringe each time I'm forced to check the manual for random function behavior, but its not enough to make me move over. What I'm really looking for is an improved version of PHP. One that keeps most of its style but removing the backwards-compatible crap. It looks like HipHop may go down that path in the near future (they've already added python-style yield generator functions)
- cheald 15y agoLiterally the only thing that PHP has over Ruby/Python/whatever is ease of deployment. It is ridiculously easy to deploy a PHP application, whereas you will jump through a lot of hoops with other solutions. After a lot of thought, I've arrived at the conclusion that this is because PHP has its request handler and template language all baked into the same process. It's pretty great at that - no setup required to start slinging code. Other than that (which is significant), I'm hard-pressed to find an advantage. It's verbose, inconsistent, lacks features that've been present in other languages for years, and as the article author complains about, has no real vibrant packaging system for leveraging code re-use. Code re-use in PHP is "copy-and-paste". Yikes.
- downx3 15y agoPhp does have a pretty smart tool chain to be fair in the way of php modules.
- hellweaver666 15y agoI've been writing PHP for the best part of 10 years and have started getting into RoR in the last year or so. It's hard, because I'm not a competent programmer. I wouldn't say I have much natural ability or spare time to learn new things as I have a full time job, run my own business and have a young family that demand my attention. Luckily, my colleagues at the day job are supportive and through them, I'm slowly getting my head round Ruby, but only as much as the front-end stuff goes - starting a Rails project on my own would be a massive undertaking for me. Given the choice, I'll do things in PHP because it's quicker and I have more experience on it. Jumping ship would be like abandoning 10 years of experience so I can start from scratch - I don't have the time to do that.
- philsturgeon 15y agoThis absolutely does sound like a troll, despite the disclaimer. I use Ruby sometimes, it sure is a lovely language. That doesn't detract from the fact that PHP is still the most largely used web programming language around. I do development work in, consult about, get paid to write about and sell commercial products using... PHP. It has the biggest potential market for me so it has the most potential customers, the most potential readers and the most potential work. Besides, even if you personally decide to switch to Ruby the PHP community will still exist and still suffer the same problems. Those need to be fixed, no matter what. Please do not detract from a single topic with a random "PHP v Ruby" thread. I'm not surprised but I am disappointed.
- Seldaek 15y agoLibraries, frameworks and tooling in PHP have evolved tremendously in the last couple years. If you look at the Symfony framework and its community you'll find a ton of brand new code that is state of the art, mostly inspired and building on top of ideas from other languages, most of the time improving on them too. Node for example is lots of fun, but most of the libraries come complete with their bugs and lack of maturity. These are exciting things to work with, but not always best bang for the buck if you're aiming at being productive. As for Ruby itself getting faster, well guess what PHP itself is getting faster all the time too [1]. You left it behind and it's still evolving without you. Shocker. [1] http://www.php.net/archive/2012.php#id2012-03-01-1 http://www.php.net/archive/2012.php#id2012-03-01-1
- mikey_p 15y agoThe problem is that Ruby doesn't solve the package problem either. Gem and Bundler are a mess, and using something like rvm or rbenv to fix this is an even bigger mess (although it works). If you really want to see something a bit different you'd have to look at npm and node which really buck the system by installing everything locally by default. The ability for different versions of the same dependency at different points in the tree is also pretty amazing. This is the direction that composer is going with it's included autoloader and similar package syntax. If anything composer may go even one step farther by forcing you to document your dependencies in a manifest instead of allowing you to specify an individual installation via the install command.