www.webdeveloper.com
Results 1 to 13 of 13

Thread: PHP vs Python and Ruby

  1. #1
    Join Date
    Feb 2012
    Posts
    18

    PHP vs Python and Ruby

    Hello,
    In recently time, I more and more listen, that Ruby or Python are bests languages that PHP.
    I interested this is correctly? If yes, to tell least one example.
    that is:
    "Python (or Ruby) can "something", but php cann't this, so, php is worse!"
    Please tell this "something".

  2. #2
    Join Date
    Feb 2012
    Posts
    18
    Its wonder, 101 viewing and 0 answer, why ?

  3. #3
    Join Date
    Jul 2003
    Location
    The City of Roses
    Posts
    2,503
    It's not an easy question. Most people will specialize in one language, and have only a passing knowledge of others. Very, *very* few will have solid knowledge in all three.
    for(split(//,'))*))91:+9.*4:1A1+9,1))2*:..)))2*:31.-1)4131)1))2*:3)"'))
    {for(ord){$i+=$_&7;grep(vec($s,$i++,1)=1,1..($_>>3)-4);}}print"$s\n";

  4. #4
    Join Date
    Jan 2007
    Location
    Wisconsin
    Posts
    2,120
    On top of that, linguistic preferences are rarely formed objectively. Taking PHP and C# as examples, I don't prefer PHP necessarily because it is "better" than C#, though I might at times claim it is. I likely prefer PHP because it suits my current coding preferences better: I can code efficient PHP more efficiently than I can code efficient C#.

    As a general trend, I might also say that PHP sites feel faster than C# sites. But, I don't have concrete numbers to back that up. Nor do I have a firm understanding of the complexities of each site so as to make an accurate comparison. Perhaps simpler sites are just built using PHP, and more complex ones with C#.

    If you're looking to get started with a new language, just pick one that's highly popular. Popularity generally ensures a good degree of community support (like this forum). But, be quick to respond to changes -- had you posed the question 10 years ago, I'd unequivocally recommended Perl. But, if you're still writing Perl today, you'd be wise to abandon it for web development purposes.
    Jon Wire

    thepointless.com | rounded corner generator

    I agree with Apple. Flash is just terrible.

    Use CODE tags!

  5. #5
    Join Date
    Nov 2002
    Posts
    2,632
    In terms of popularity, PHP runs circles around Python and Ruby.

  6. #6
    Join Date
    Feb 2012
    Posts
    18
    In terms of popularity, today PHP unequivocally is #1 and i dont understand why people say, that ruby better php? I dont understood this.
    Well, thanks for answers.

  7. #7
    Join Date
    Aug 2010
    Location
    San Diego
    Posts
    242
    Quote Originally Posted by dadli View Post
    In terms of popularity, today PHP unequivocally is #1 and i dont understand why people say, that ruby better php? I dont understood this.
    Well, thanks for answers.
    Ruby is a more modern and elegant language than is PHP. That's why some people say it is "better". Being a more consistently object oriented language, Ruby has productivity benefits if you have a good understanding of OOP.

    But PHP is much more popular, and this means
    • more people know it
    • more add-ons (e.g. WordPress) available
    • it's on more servers (a low cost host service will likely have PHP but might not have Ruby) - possibly the most important issue here

    My impression is that PHP is better for simpler projects and Ruby better for larger projects.

  8. #8
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,326
    Learn all three, though you don't need to become an expert in all three -- at least not immediately.

    Once you know language A, learning language B not only means you know a new language, but it gives you insights into the strengths and weaknesses of language A while also teaching you new ways to think about programming in general. You may continue to use language A as your primary tool, but you'll now be better with it as well as able to switch relatively easily to language B should the need arise.

    Also, the more languages you know, the easier it becomes to learn new ones when you need to.
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  9. #9
    Join Date
    Jan 2007
    Location
    Wisconsin
    Posts
    2,120
    Quote Originally Posted by handcraftedweb View Post
    Ruby is a more modern and elegant language than is PHP. That's why some people say it is "better". Being a more consistently object oriented language, Ruby has productivity benefits if you have a good understanding of OOP.

    But PHP is much more popular, and this means
    • more people know it
    • more add-ons (e.g. WordPress) available
    • it's on more servers (a low cost host service will likely have PHP but might not have Ruby) - possibly the most important issue here

    My impression is that PHP is better for simpler projects and Ruby better for larger projects.
    Ruby and PHP both surfaced in 1995.

    And I wholeheartedly disagree with the assessment that Ruby is any better for more complex projects, or that PHP is in any inadequate for complex applications. Facebook, for instance, is written in PHP.
    Jon Wire

    thepointless.com | rounded corner generator

    I agree with Apple. Flash is just terrible.

    Use CODE tags!

  10. #10
    Join Date
    Nov 2002
    Posts
    2,632
    Quote Originally Posted by handcraftedweb View Post
    Being a more consistently object oriented language, Ruby has productivity benefits if you have a good understanding of OOP.
    At this point, my default is using classes in PHP. Looking at somebody's code that is written in a procedural way just kind of makes me shake my head.

  11. #11
    Join Date
    Jan 2007
    Location
    Wisconsin
    Posts
    2,120
    Quote Originally Posted by spufi View Post
    At this point, my default is using classes in PHP. Looking at somebody's code that is written in a procedural way just kind of makes me shake my head.
    Nothing wrong with procedural development, so long as you approach it in a somewhat intelligent manner. In fact, a procedure-centric web application is often less prone to many of the inefficiencies that an OO application is -- unnecessary object instantiation being one of them! My personal projects are still written in mostly-procedural PHP -- with the exception of the client-side script, which is "OO" JavaScript.

    That said, if you're in the mood to write some strictly OO code, C#/.NET is a good route to go. It's a robust platform with a great deal of community support, it's fantastic for building and consuming web services, and it's in very high demand. And perhaps more importantly, it makes OO code make some degree of sense in a typically stateless setting by fabricating state! (Lots of overhead for doing so, though.)
    Jon Wire

    thepointless.com | rounded corner generator

    I agree with Apple. Flash is just terrible.

    Use CODE tags!

  12. #12
    Join Date
    Jan 2007
    Location
    Wisconsin
    Posts
    2,120
    Of course, my recommendation for C#/.NET comes from a lack of experience with Ruby. It's possible that Ruby performs some similar horrendously inefficient and clumsy state fabrication ...
    Jon Wire

    thepointless.com | rounded corner generator

    I agree with Apple. Flash is just terrible.

    Use CODE tags!

  13. #13
    Join Date
    Nov 2002
    Posts
    2,632
    I've already downloaded MS Express and took a quick glance at C#. It's my eventual goal to finish off my degree in CS with focusing on .NET. I really liked what I saw during my testing out phase. I just need to get some other stuff done and out of the way before I can start tackling it full force.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles