Page 1 of 2 12 Last
  • Jump to page:
    #1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2006
    Posts
    34
    Rep Power
    9

    Should I learn PHP or Ruby?


    I've got minimal programming experience, took C back in freshmen year of college when I was pursuing a computer science degree, but dropped out to do finance instead. I still kept on with my web design and affiliate marketing throughout my college career.

    Also learned ASP a while back as well.

    now that I've graduated, I'm thinking of picking up a programming language again to work on bigger projects that requires more than using pre-built scripts.

    What would you guys suggest I start with, PHP or Ruby? My friend is saying Ruby will eventually overtake PHP.

    What do you guys suggest? Book recommendations?

    thanks
  2. #2
  3. Permanently Banned
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jun 2006
    Location
    In a whale
    Posts
    4,147
    Rep Power
    0
    I would say go with PHP, simple, and yet, powerful. Dont get me wrong ruby is a very good language, but they all do jobs, and I dont think ruby will take over php. Seeing alot of people who love and use php, wouldnt feel right switching straight over to a new language. But that was offtopic. I say php. But that is me. As for books, w3schools and php.net have loads of information. Hope I could help!
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2006
    Posts
    34
    Rep Power
    9
    i forgot to mention that I'm looking to develop a couple unique sites that has potential to get huge amount of traffic , which language will be the fastest when it comes to lots of traffic? (think digg traffic)
  6. #4
  7. Permanently Banned
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jun 2006
    Location
    In a whale
    Posts
    4,147
    Rep Power
    0
    Its not what language, its how you use it. For web dev I say go with PHP, cause ruby on rails is very rarly found. But php isnt the only scripting language out there. ASP,Perl,etc. But I say go with php. But its up to you. Google for some examples and see which one you feel more comfortable with.
  8. #5
  9. Web Developer/Musician
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Nov 2004
    Location
    Tennessee Mountains
    Posts
    2,408
    Rep Power
    1031
    I would say definitely PHP. If you have time learn both however, because I don't think you can know too many programming languages. One thing that Ruby is known for (primarily because of Rails) is that it enforces certain conventions, especially when it comes to accessing databases. PHP on the other hand leaves it up to you for the most part unless you use a similar framework. There are many more frameworks and ways to do things in PHP.

    If I had time though I would love to dig into Ruby/Rails more than I have. I would never stop coding in PHP however.
  10. #6
  11. Null Pointer Exception
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Mar 2006
    Location
    america
    Posts
    3,355
    Rep Power
    1579
    i don't know for a fact but php i beleive has a smaller overhead.

    PHP is more designed for web based application, it has some OOPish features to it. but it was designed as a web based language for web based stuff.

    Ruby is more like C/C++ it HAS OOP stuff more of an application than a web based such thing.

    if you do a little research on both youll get the better grasp of their strengths in weaknesses. im sure if you plan to develope dynamic website you will use a combination of both (if you plan to use ruby)
  12. #7
  13. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,867
    Rep Power
    6351
    Just my $0.02.

    First of all, asking "PHP or X" on the PHP board is most likely going to get you the answer "PHP!"

    Secondly, if you want to write something that gets the traffic of the top 10 sites, look at what they write in. Slashdot uses Perl, but that's because they are all gurus and out of their mind. Penny-Arcade uses ruby, but they have a very tight layout and only 2 pages, really.
    Digg seems to use PHP, but I can't confirm that.

    If you're worried about processor time and lag visible to the user, there's two solutions:
    1) Write in a lower-level language. You could write your whole thing in C modules that plug directly into Apache. That's a terrible idea. Or you could write in Perl, which is slightly lower than PHP. DON'T write in ASP or Java.
    2) Buy a better server. Personally, I like this one, because it allows you to cheat also. If you have a server with 16 processors, you're less likely to spend inordinate amounts of time making things "perfect" for version 1.0. Better servers help you get your stuff produced faster, and faster production times get you better servers quicker. It's a self-fulfilling cycle, so kick-start it with good stuff.

    All that being said, I still am going to answer "PHP!" I've used ASP, C#, Perl, PHP, JSP, and even worked on a webserver written in the aforementioned C modules. PHP is the best for rapid development while still retaining total control over the code, and falls right in the middle of the pack in terms of processor cycles used.

    Ok, that was more like $0.25.

    -Dan
  14. #8
  15. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2005
    Posts
    102
    Rep Power
    9
    yup Digg uses php/mysql
  16. #9
  17. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2006
    Posts
    34
    Rep Power
    9
    Look like I know what language too learn then!


    thanks for the quick responds!

    Do you guys know some books I should buy?
  18. #10
  19. Permanently Banned
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jun 2006
    Location
    In a whale
    Posts
    4,147
    Rep Power
    0
    Dont waste your money. Learn online!
    www.w3schools.com/php/
    www.php.net/
    wwwgoogle.com/?q=php+tutorials
    Check em out!
  20. #11
  21. (retired)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2003
    Location
    The Laboratory
    Posts
    10,101
    Rep Power
    0
    FYI Digg's written in PHP.

    It really depends on what you want. The main selling point of Ruby for web dev. is the framework Rails which makes development very rapid. However, look around for decent php frameworks (symfony, cake) and you have that as well.

    For what it's worth, Ruby is known to be much slower and resource hungry than any of the other languages (although they're working on it a lot to speed it up & I hear that running it via mongrel speeds it up quite a lot).

    Another thing to keep in mind is that most cheap hosting plans will have PHP running, but not mod_ruby, you may be able to get it running via fastcgi or something, but again, that's not common.

    & if you've expecting digg-level traffic, then get a pro to design your app to scale properly.
  22. #12
  23. Web Developer/Musician
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Nov 2004
    Location
    Tennessee Mountains
    Posts
    2,408
    Rep Power
    1031
    Books aren't necessarily bad, but I would take heed of the articles on the web and the posts here about pitfalls (register_globals, SQL injection, mail injection, addslashes, etc.). That seems to be where some books on the subject fall down.
  24. #13
  25. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,867
    Rep Power
    6351
    The web is always the most up-to-date resource, I've found that just linking the PHP site to my searchbar in firefox speeds me up quite rapidly. Once you get the basics down you can use forums and the PHP documentation to finish anything else you need.

    If you're going to buy a book, I would recommend one of the catch-all books from publishers like O'Reilly. Don't try to get "Writing large scale PHP applications that run on IIS and use MySQL and are more than 30,000 lines and all variable names start with $fred_". Some books over specialize. Use a book to get the general feel of the language, and use the web for the specifics. Books don't have search features, after all.

    A good dev framework for PHP (which I've used to smashing success) is PRADO

    It works like .NET in practice, and everything is object-oriented. It's beautiful, and your code doesn't mix, so even if you hire a professional designer he'll never be able to screw up your PHP.

    -Dan
  26. #14
  27. Null Pointer Exception
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Mar 2006
    Location
    america
    Posts
    3,355
    Rep Power
    1579
    another thing ill throw in is php is much more popular than ruby, so if you need help youll have less trouble getting it
  28. #15
  29. No Profile Picture
    Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Jan 2005
    Posts
    1,586
    Rep Power
    275
    I would say learn both. Ruby is thinking language, where not only logic is needed, but also you need to create the real underlining code to do exactly like you want. Much like Perl, very few core based functions, but a powerful compiler so you can use your own creativity to power your application. PHP is not like that, it's function based language, with thousands of functions, that have been tested, rebuilt and tested again to give you a simple method to do something without the need to create a script based process to do what you want.

    In that sense PHP is very powerful, but that comes with a price, and that price draws in many people that don't want to learn anything, they only want to achieve something, which results in millions of trash based programs written in PHP.

    Ruby on the other hand, takes time to understand, because it's scripting based structure is not anything like C, for people to say that it's like C, don't really know anything about it. PHP structure is much closer to C, than Ruby. But with Ruby everything is OO, in that everything is object based. It has some great points, because it uses many development languages in it's core, like Perl, Smalltalk and Ada. Once you do learn how Ruby does things, you will find it's just as powerful as any development language where real thinking is needed, which in PHP, is not always the case.

    printf

    Comments on this post

    • SimonGreenhill agrees : I agree, but would replace "ruby" with "python", which is the better language :)
Page 1 of 2 12 Last
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo