Slashdot Mirror


PHP5 Vs. CakePHP Vs. RubyOnRails?

OldJavaHack writes "If you could start a website (with MySQL for persistence) from scratch and you had a choice of PHP5, CakePHP, or RubyOnRails — which would you choose and why? Things to consider in your decision: 1. Maturity of solution; 2. Features; 3. Size of community of skilled users (to build a team); 4. Complexity/ease of use (for neophytes to master); 5. Greatest strength of your choice, and the greatest weaknesses of the other two. Here is a comparison of capabilities."

469 comments

  1. Sure by dedazo · · Score: 3, Funny
    1. PHP: What people build real websites with.
    2. RoR: What people build websites with because they want to be kewl and later switch to PHP when they realize it simply does not scale, complete with acerbic "I wanted to believe" blog entry and everything

    Next?

    --
    Web2.0: I love when people Flickr my cuil and digg my boingboing until my google is reddit and I start to yahoo
    1. Re:Sure by Praedon · · Score: 2

      I completely agree. PHP5 hands down.

      --
      Just me
    2. Re:Sure by NickCatal · · Score: 5, Funny

      And the award to the quickest troll in the world goes to......

      --
      -nick
    3. Re:Sure by king-manic · · Score: 4, Funny



            1. PHP: What people build real websites with.
            2. RoR: What people build websites with because they want to be kewl and later switch to PHP when they realize it simply does not scale, complete with acerbic "I wanted to believe" blog entry and everything

      Next?


      Pfft.. Real men code websites in Java and ASP. Scalability and performance are for pussies. My server to chugs at 10 hits/minute and it likes it.

      --
      "There are more things in heaven and earth, Horatio, than are dreamt of in your philosophy."
    4. Re:Sure by Praedon · · Score: 1

      Oh yeah? Super duper real men code in Python or Perl!

      Modders, mark me as a troller if you like, but I'm just filling in the "Missing Options". I would seriously code in CNL (CowboyNeal Language).

      --
      Just me
    5. Re:Sure by outZider · · Score: 0, Offtopic

      PHP is what kids write My First Sites with. Sorry, next.

      --
      - oZ
      // i am here.
    6. Re:Sure by Max+Littlemore · · Score: 5, Funny

      And the award to the quickest troll in the world goes to......

      kdawson, for posting this absolute shit as an IT story with nothing more than a link to a wikipedia article in the summary!

      Congratulations!

      Hey, kdawson, while you're reading this, can I just grease you up about a story I want to post about how Steam will replace electricity to power the electric kettles of the future? Thanks buddy!

      --
      I don't therefore I'm not.
    7. Re:Sure by jamesh · · Score: 4, Funny

      Pfft.. Real men code websites in Java and ASP.

      I think Real Men would be more likely to build the web server and TCP stack into their web sites, for performance reasons.

      At least that's what we did in my day.

      *cough*
    8. Re:Sure by king-manic · · Score: 1

      note the sentence after. it's post about masochism not good performance.

      --
      "There are more things in heaven and earth, Horatio, than are dreamt of in your philosophy."
    9. Re:Sure by dedazo · · Score: 5, Interesting
      I should probably clarify my original post.

      I've never used Ruby or RoR, but my impression of it seems to be one of great expectations and not a lot of delivery. I've read way too many blogs by people who built web sites with RoR only to have them crash and burn under load. Also, the language itself seems to place a lot of importance on clever syntactic sugar, which being an old fart I automatically dislike.

      Now, "scale" does not mean the same thing to everyone. There's Digg and Wikipedia, and then there's the vertical business app that gets 200 hits per day. RoR might be a good choice for the latter, not so good for the former.

      Also, although my experience with PHP is limited as well, it seems to me that it's a mature enough platform with a good runtime (that tends to be confusing at times) and a *massive* user base. The amount of readily available PHP code out there is amazing. It will take Ruby quite a few years to get to that point, I think. So maybe Ruby is not a good beginner's environment, application-wise. But that's just my perception of it. PHP is more to the point. On the other hand, RoR might be more mature and stable than CakePHP, just because it's been around longer.

      The best tool for the job and all that, you know?

      Oh... and BTW, first post =)

      --
      Web2.0: I love when people Flickr my cuil and digg my boingboing until my google is reddit and I start to yahoo
    10. Re:Sure by Bogtha · · Score: 3, Insightful

      PHP is what kids write My First Sites with.

      Seeing as "Our team is familiar with..." plays no part in this decision whatsoever, I'd say that we are dealing with kids writing Their First Site. Or, looking at the peculiar phrasing and noting the date, kids who have just received their first homework assignment for a project that requires them to submit a plan first.

      --
      Bogtha Bogtha Bogtha
    11. Re:Sure by crayz · · Score: 2, Interesting

      Can you describe some of your experiences scaling Rails? I'm currently serving up to 250,000 requests per-day with a handful of Rails apps, so I'm wondering where you hit the breaking point and had to switch to the crapfest that is PHP

      There's no doubt that Ruby and Rails especially are much slower in execution time than comparable code written in PHP. That said, the PHP code would be 2-10x as verbose, take far longer to write, and be far less maintainable. With Rails you just throw more hardware at it and it will scale as far as you need to. If you're running up against real walls in Rails scaling, try Merb. If you're just a PHP n00b who wouldn't know decent OO-code if it punched you in the face, then by all means stick with the Personal Home Page language

    12. Re:Sure by Anonymous Coward · · Score: 0

      Perl, Java, JavaScript, MySQL, hand-coded HTML; on Apache, on Linux. Been working for a long time, why re-invent the wheel? Great code base, lots of knowledgeable coders, scares the hell out of coder wannabes...

    13. Re:Sure by speaker+of+the+truth · · Score: 3, Funny

      And the award to the quickest troll in the world goes to......
      --
      -nick [nickcatalano.com] Wow, I've never seen such an honest troll before. My hat off to you sir.
      --
      Using openSUSE instead of Windows since 9th of October, 2007 and liking it.
    14. Re:Sure by outZider · · Score: 1

      You do have an excellent point.

      --
      - oZ
      // i am here.
    15. Re:Sure by dedazo · · Score: 2, Interesting

      Can you describe some of your experiences scaling Rails?

      I work mostly with ASP.NET, really. Like I said in a later post, I have the impression of RoR being problematic for a lot of people, scale-wise.

      There's no doubt that Ruby and Rails especially are much slower in execution time than comparable code written in PHP. That said, the PHP code would be 2-10x as verbose, take far longer to write, and be far less maintainable.

      That is a tradeoff, of course, and it's really up to each person to decide the merits of a platform based not only on raw speed.

      If you're just a PHP n00b who wouldn't know decent OO-code if it punched you in the face

      No, not really. BTW, 250K hits per day is really not that impressive, especially with a "handful of apps". That's ~3 requests per second. I work with a single vertical application that handles roughly three times that at peak times.

      --
      Web2.0: I love when people Flickr my cuil and digg my boingboing until my google is reddit and I start to yahoo
    16. Re:Sure by Cafe+Alpha · · Score: 2, Interesting

      That may change. I'm working on a native code Ruby compiler right now.

      It's based (among other things) on the principle that you can optimize to your hearts content as long as you have the ability to de-optimize running code (and data) when something changes and your optimizations are no longer valid.

    17. Re:Sure by suv4x4 · · Score: 4, Interesting

      I've never used Ruby or RoR, but my impression of it seems to be one of great expectations and not a lot of delivery. I've read way too many blogs by people who built web sites with RoR only to have them crash and burn under load.

      You have the right idea about RoR (speaking as someone who excitedly spent /wasted/ a month learning into it). RoR has some hot ideas but it tries to be too smart and locked down for its own good.

      CakePHP is a typical PHP open source project: random code, bloated, no direction. It's also cool, in a way, but I'd never run big project on it.

      One promising framework for PHP appeared to be Mojavi, but it later stalled and was forked into Agavi. Agavi tends to try to be way too flexible for its own good (unlike RoR), and in the end is just not simple to use. There's just too much stuff in there you'll never use in a real world project, which complicates code understanding and development.

      I also find the "CakePHP vs PHP5" question to not make any sense, I'm sorry.

    18. Re:Sure by Cafe+Alpha · · Score: 1

      There are plenty of very high traffic sites based in PHP. So it is a serious tool.

    19. Re:Sure by Baddas · · Score: 3, Insightful

      You have the right idea about RoR (speaking as someone who excitedly spent /wasted/ a month learning into it). RoR has some hot ideas but it tries to be too smart and locked down for its own good.


      The beauty of Ruby is, even if you don't like it the way they do it, you can always monkey patch it. Open up the object and override the method(s) you don't like.

      Try doing that to the PHP core libs. Better know C, and love it a lot.
    20. Re:Sure by LarsWestergren · · Score: 1

      Pfft.. Real men code websites in Java and ASP. Scalability and performance are for pussies. My server to chugs at 10 hits/minute and it likes it.

      Funny, but many banks and stock markets run their trading on the Java platform. At JavaOne 2007 for instance, Anna Ewing, Nasdaq CIO talked about handling hundreds of thousands transactions per second with millisecond deadline requirements.

      --

      Being bitter is drinking poison and hoping someone else will die

    21. Re:Sure by pestilence669 · · Score: 0, Troll

      Everybody knows that these are just cheap imitations of dot-net.

    22. Re:Sure by Anonymous Coward · · Score: 1

      Is it possible to give feedback to the slashdot admins to request that kdawson be either removed or limited? I swear to god - every time I see an inane, content-free, pointless article on here lately, it seems to have kdawson as the editor who posted it. It's one thing for cmdrtaco or others to submit a dupe here and there, but kdawson is just a constant source of utter garbage.

    23. Re:Sure by saveourskyline · · Score: 2, Informative

      RoR: What people build websites with because they want to be kewl and later switch to PHP when they realize it simply does not scale, complete with acerbic "I wanted to believe" blog entry and everything

      You might want to check out YellowPages.com, Twitter.com, and OpenCongress.org.

    24. Re:Sure by creinig · · Score: 1

      RoR: What people build websites with because they want to be kewl and later switch to PHP when they realize it simply does not scale, complete with acerbic "I wanted to believe" blog entry and everything

      Don't mistale me for a RoR fanboy, but, well, it is my favorite tool for building websites and according to this presentation it can be made to scale just nicely :)

    25. Re:Sure by VirusEqualsVeryYes · · Score: 4, Funny

      this absolute shit [for] an IT story [has] nothing more than a link to a wikipedia article in the summary!
      Not to worry, you will be cured of your tendency to RTFA soon. Welcome to Slashdot.
    26. Re:Sure by dk.r*nger · · Score: 4, Insightful

      I've never used Ruby or RoR, but my impression of it seems to be one of great expectations and not a lot of delivery. I've read way too many blogs by people who built web sites with RoR only to have them crash and burn under load. Also, the language itself seems to place a lot of importance on clever syntactic sugar, which being an old fart I automatically dislike.


      You could, you know, link to those "way too many blogs" and thus let the rest of us decide for ourselves if this is incriminating evidence against Ruby.

      "I read it on a blog" does not in any way imply truth.
      "I read it on many blogs" doesn't really make it much better.

      And until then, you shall remain a troll. After you post the links, you'll have your status upgraded to "person with an opinion, willing to discuss".
    27. Re:Sure by marcello_dl · · Score: 2

      > I've never used Ruby or RoR, but my impression of it seems to be one of great expectations and not a lot of delivery.

      YMMV, as a RAD tool running a vertical app with a mostly normalized postgresql db which was created for the task, it delivered a lot to me.

      Of course the article submitter chooses mysql and website building as a task and the stupid comparison of a language vs. frameworks (no matter how powerful the library of the language, working with a framework is a different matter altogether, with pro and cons). So essentially I'm OT. But your generalization was wrong, so there.

      I Spent almost more time playing with the admin interface out of fun than coding it: plugin used is this. PHP equivalents welcome for a comparison, I never looked for any.

      To people complaining about performance: hey didn't you see the logs of your helloworld rails app? requests per second are there. Rails is slow but you discover it after 2 days, not a month. Give it up if rails features are useless to you or use a faster webserver (lighttpd, nginx all under *nix of course), make custom SQL queries instead of iterating with ruby over AR objects and relations (like you're likely to do when quickly prototyping), cache stuff if your app has lots of reads, experiment with ruby 1.9 which is going to boost performance.

      > I've read way too many blogs by people who built web sites with RoR only to have them crash and burn under load.

      Slow down to a crawl, yes, crash I honestly don't recall. I have great uptime on lighttpd and rails.

      --
      ---- MISSING MISCELLANEOUS DATA SEGMENT --- [sigdash] trolololol
    28. Re:Sure by kv9 · · Score: 0, Flamebait

      Can you describe some of your experiences scaling Rails? I'm currently serving up to 250,000 requests per-day with a handful of Rails apps, so I'm wondering where you hit the breaking point and had to switch to the crapfest that is PHP

      wow, 250k? *really*? even my shitty P2 box at home can serve *almost* 3 hits per second (not Rails shit of course, perhaps something leaner such as PHP). how many racks are you using for your Rails crapfest?

      With Rails you just throw more hardware at it and it will scale as far as you need to.

      of course, why the fuck should you write light code when you can just add more boxen. what is that, a page from the Java/Vista book?

      [apologies for feeding the troll]

    29. Re:Sure by marcello_dl · · Score: 1

      Stupid submit button.

      Correct link:
      here

      --
      ---- MISSING MISCELLANEOUS DATA SEGMENT --- [sigdash] trolololol
    30. Re:Sure by Da+Fokka · · Score: 3, Funny

      You fool! Can't you see kdawson is just an evil ploy by CmdrTaco to become more popular! By contrast, his submissions seem like an insightful breeze.

    31. Re:Sure by dedazo · · Score: 5, Informative
      Sure. Here's a quote from an interview with the guy that created Twitter:

      How has Ruby on Rails been holding up to the increased load?

      By various metrics Twitter is the biggest Rails site on the net right now. Running on Rails has forced us to deal with scaling issues - issues that any growing site eventually contends with - far sooner than I think we would on another framework.The common wisdom in the Rails community at this time is that scaling Rails is a matter of cost: just throw more CPUs at it. The problem is that more instances of Rails (running as part of a Mongrel cluster, in our case) means more requests to your database. At this point in time there's no facility in Rails to talk to more than one database at a time. The solutions to this are caching the hell out of everything and setting up multiple read-only slave databases, neither of which are quick fixes to implement. So it's not just cost, it's time, and time is that much more precious when people can['t] reach your site. None of these scaling approaches are as fun and easy as developing for Rails. All the convenience methods and syntactical sugar that makes Rails such a pleasure for coders ends up being absolutely punishing, performance-wise. Once you hit a certain threshold of traffic, either you need to strip out all the costly neat stuff that Rails does for you (RJS, ActiveRecord, ActiveSupport, etc.) or move the slow parts of your application out of Rails, or both.It's also worth mentioning that there shouldn't be doubt in anybody's mind at this point that Ruby itself is slow. It's great that people are hard at work on faster implementations of the language, but right now, it's tough. If you're looking to deploy a big web application and you're language-agnostic, realize that the same operation in Ruby will take less time in Python. All of us working on Twitter are big Ruby fans, but I think it's worth being frank that this isn't one of those relativistic language issues. Ruby is slow.

      Is that specific enough for you?

      And until then, you shall remain a troll.

      Would you like some salt to go with your crow? Let me know.

      --
      Web2.0: I love when people Flickr my cuil and digg my boingboing until my google is reddit and I start to yahoo
    32. Re:Sure by dedazo · · Score: 3, Interesting

      You might want to check out YellowPages.com, Twitter.com, and OpenCongress.org.

      Well, I "checked" Twitter. Are the authors of the other ones also on record saying the technology they chose fails to scale?

      --
      Web2.0: I love when people Flickr my cuil and digg my boingboing until my google is reddit and I start to yahoo
    33. Re:Sure by Anonymous Coward · · Score: 0

      There are plenty of very high traffic sites based in PHP. So it is a serious tool.

      No, anyone who voluntarily uses a language with create_function is a serious tool.
    34. Re:Sure by GreatBunzinni · · Score: 1

      I think Real Men would be more likely to build the web server and TCP stack into their web sites, for performance reasons.

      Pfff.... That's for pussies. Real Men write their web servers right into the operating system kernel.

      --
      Slashdot, fix your code or at least hire someone who is competent at it to do it for you.
    35. Re:Sure by LizardKing · · Score: 2, Insightful

      PHP users seem to spend inordinate amounts of time worrying about the latest exploit in the PHP engine, or how easy it is to introduce exploits at the application level thanks to the awful library functions, while RoR users end up mulling over the lack of scalability in their apps once the initial prototype is complete. Meanwhile, "boring" Java apps continue to power large scale systems with increasing reliability and maintainability. Perhaps it's because neither PHP or RoR has the depth of experience or literature on best practices that J2EE now has. That's not to say that things have always been so rosy in the Java world - EJB conventions buggered up a lot of projects until a decent set of patterns were identified and people had bought into the ideas behind lightweight frameworks such as Spring.

    36. Re:Sure by Hathor's+Dad · · Score: 1

      This is what sux about PHP frameworks & PEAR.

      FFS why should developers just adopt your framework/packages when in 12 months it will be changed and you code won't work.

      I wrote my own..it was crap
      I re-wrote my own..it was crap
      I re-wrote my own again..it was crap
      next time...OK.

      With PEAR: DB -DB2 ->MDB ->MDB2

      PHP is a great lang because it is so simple to look @ the code and work out what is going on. It has its quirks but having PEAR / Framework changes all the time it does sometimes make one feel we have to reinvent the wheel just to make sure our app will work after we retire!

    37. Re:Sure by gbjbaanb · · Score: 1

      or perhaps its because anyone who writes a J2EE application is backed by a corporate that will buy the 3 mainframes required to run it acceptably.

      Seriously though, its difficult to say "Java scales great" compared to anything because the kind of apps written in Java do run on different hardware, and almost certainly with different requirements than any apps written in PHP. If, one day, a bank decides to write its trading system in PHP, then perhaps we could compare them. Even then, the architectural choices would still mean they're not comparable.

    38. Re:Sure by ultranova · · Score: 1

      Better know C, and love it a lot.

      ...for the first time in my life, I find myself wishing that rule #34 won't hold true.

      --

      Forget magic. Any technology distinguishable from divine power is insufficiently advanced.

    39. Re:Sure by ultranova · · Score: 1

      Or, looking at the peculiar phrasing and noting the date, kids who have just received their first homework assignment for a project that requires them to submit a plan first.

      Hmmm...

      1. Identify the needs: we must write a plan and a website.
      2. Focus on our core competencies: We can beg help really well.
      3. Outsource the parts not in our core competencies to the cheapest vendor: beg for help on Slashdot.
      4. Claim the credit for the result and hope it won't explode until after the assignment credit has been received.

      Yeah, I think these kids are manager material. Or will be after they manage to insert a few paradigm shifts somethere in the plan...

      --

      Forget magic. Any technology distinguishable from divine power is insufficiently advanced.

    40. Re:Sure by GreenEnvy22 · · Score: 1

      Pfft... Real men program in Assembly. Uber-men program in direct Binary

    41. Re:Sure by oliderid · · Score: 3, Funny

      Real men don't use web server. Real men reply to HTTP GET requests manually. For security reasons.

    42. Re:Sure by Anonymous Coward · · Score: 0

      the motion of the C?

      better go anon for this.

    43. Re:Sure by CastrTroy · · Score: 4, Informative

      A bit of advice. Use PDO. Don't use MySQL or MySQLi functions. This will not only make your life a little easier if you ever need to switch database engines, but I also find that it makes doing prepared queries much easier (although it's possible with MySQLi). Being mostly a .Net developer, I find it hillarious and sad that most PHP tutorials recommend using the mysql_ functions, along with mysql_real_escape_str() function for doing database queries. One interface for all databases makes a lot more sense, and using prepared queries protects against SQL injection in a way that trying to remember to use mysql_real_escape in every query can't come close to.

      --

      Anthropic principle: We see the universe the way it is because if it were different we would not be here to see it.
    44. Re:Sure by AdamWeeden · · Score: 1

      I imagine CNL would look similar to this.

      --
      I was quoted out of context in my autobiography...
    45. Re:Sure by Reverend528 · · Score: 1

      If, one day, a bank decides to write its trading system in PHP, then perhaps we could compare them.

      What if a JSP-based social networking site is rewritten in PHP? This is what the friendster developers did when the JSP-based site ground to a halt under the load of millions of users.

    46. Re:Sure by knewter · · Score: 4, Interesting

      Well, you can get specific like that, yes. But please, follow the story to its completion. The issue was solved, and easily solvable from day one. (For a better solution to the same problem, see this link.)

      I currently write chronically non-scaling Rails apps myself. I can write apps in Rails that scale well, but it turns out there's a huge market for sites that don't need to, and that's where I'm spending some time these days. I've also worked on a nicely-scaling social network site in Rails. There are plenty of tutorials on how to make sure your Rails app scales, but here are the things I'll have to do to my company's custom CMS to make it scale:

      1. Make admins visit the site via admin.site.com
      2. Turn off page caching for admin. requests
      3. Turn on page caching for everyone else, and expire the caches every five minutes

      Oh noes! The horror! Then it's up to Apache to handle pretty much every request. Of course, my use case only has to make static content scale. As long as you're actually writing nice stateless apps on the web, in whatever language, they'll scale. If a given URL has static content across visits, they'll scale insanely well, because you don't Mb>use RoR to serve the site in those cases, you use Apache.

      --
      -knewter
    47. Re:Sure by teknopurge · · Score: 1

      shhh! How dare you bring real-word experiences and solutions to slashdot! Next you'll be telling us that Java really does run identical bytecode on multiple platforms!!!?@?!@1111**OMG!!!

    48. Re:Sure by Foofoobar · · Score: 1

      Hell even the RUBY and RUBY ON RAILS people use PHP in order to get their sites to scale

      --
      This is my sig. There are many like it but this one is mine.
    49. Re:Sure by fractoid · · Score: 1

      "I read it on a blog" does not in any way imply truth.
      "I read it on many blogs" doesn't really make it much better. The first is plagiarism. The second, research. Capiche? ;)
      --
      Rampant carbon sequestration destroyed the Dinosaurs' tropical paradise. I'm here to help repair the damage.
    50. Re:Sure by teknopurge · · Score: 1

      This comment is meaningless without a reference.

    51. Re:Sure by crawling_chaos · · Score: 1

      Of course, the paradox is that hardware is offtimes cheaper than talented programmers, particularly if the code they develop is so goddam clever that only they can maintain it. Managing clusters ain't simple either, but sometimes more powerful hardware is the answer. I've seen too much "light code" that is under-tested and riddled with security holes because all of that checking makes the code inelegant. I've also seen heavy code that suffers from the same problem. All I'm saying is that there is no panacea and you need to evaluate each potential fix on its merits and stop hurling insults.

      --
      You can only drink 30 or 40 glasses of beer a day, no matter how rich you are.
      -- Colonel Adolphus Busch
    52. Re:Sure by Anonymous Coward · · Score: 0

      (Score:6, Hilarious)

    53. Re:Sure by crayz · · Score: 1

      That's ~3 requests per second. I work with a single vertical application that handles roughly three times that at peak times.

      You compared per-day vs. peak times, nice. At peak times the highest-traffic Rails app is about 20/second. Still not very many, well gee...its more than 99.9% of web sites will ever need to do, so complaining that Rails can't scale is a little silly

    54. Re:Sure by logix218 · · Score: 1

      In this same vain for PHP frameworks I may or may not have an interesting one, though no where near mature. In the interest of full disclosure, I am one of the contributors on it. So this is more of a "sees a chance to get some very very harsh and very very hyper-critical feedback" opportunity (I know I can count on that from the ./ community =) ). http://code.google.com/p/phorm-rapid-orm/ A group of us started developing it, when we started using CakePHP. That's not to say CakePHP it's not a good piece of software, it is. We came from a more OO background and were wanting something more OO. We appreciated the Django/python approach and went from there. Knowing that PHP is not an OO language we took our own spin on things.

    55. Re:Sure by metalhed77 · · Score: 3, Interesting

      You're totally off base but so is this article.

      PHP is comparable to Ruby or ModRuby. Ruby on Rails is a framework.

      Of course there's no scaling issues with these languages because they're just programming languages. Things like load balancing are something YOU have to take into account as you build your website and manually handle. You can architect things anyway you want, so if stuff fails it's your fault. This means DB transactions, sessions, templating, etc. are all things you have to handle. The language can't be at fault for these things.

      Ruby on Rails is slower for many things because it saves you upfront development time and makes refactoring and adding features a breeze. For many people this is perfectly fine. I write intranet apps for my company in RoR all the time, and it's great. We do not handle many users, but we DO care about getting functionality fast.

      Also, for some ridiculous reason people seem to think that RoR does not scale because an out of the box RoR stack may not scale perfectly (like Twitter). RoR may be slower than a tuned PHP script in some cases, but it scales horizontally just fine.

      Lots of people may think Twitter and say RoR doesn't scale. But what they don't know is that twitter didn't scale because their DB didn't scale to handle that many writes. You can always throw more boxen at rails and get a larger pool of Rails processes to distribute the load to. You can throw Memcached at it to speed up queries as well, but at the time the whole Twitter complaint happened Rails only supported one database connection. This was fixed soon after. The fact is though, that once you have a service with so many reads and writes like twitter, out of the box ANYTHING is going to suck. Rails, however, gained the necessary functionality (Magic Multiconnections) and allows for all the custom tweaks, performancing tuning, and caching you'll need.

      --
      Photos.
    56. Re:Sure by king-manic · · Score: 1, Flamebait

      I've worked with JSP and it is okay. I don't know how scalable it is as the user base was counted on two hands. I know PHP scales pretty well as several notable projects are coded in it (Wikipedia). Having worked with JAVA applications I can attest it is not a good language to make a mission critical app in. In fact it drove a very large number of tech tickets. PHP is the flavor du jour of the net because it's widely available thus has many proficient users. JSP is niche as far as I can tell and it's the big corprate push for java that sustained it. Java script is ubiquitous but thats client side.

      --
      "There are more things in heaven and earth, Horatio, than are dreamt of in your philosophy."
    57. Re:Sure by outZider · · Score: 2, Insightful

      There's a tad of a failure in logic there. There are high profile sites written in Lasso as well, but that doesn't make it a serious tool, it just makes it a functional tool. PHP was designed to create pages with logic very easily, and it's being bent in a lot of ways now, which is cool in a way, but there's really no reason why anyone should work that freakin hard. At this point, creating an AJAX enabled site is far easier, and still scalable for a competent admin, with Java, or Perl with Catalyst, or Ruby with Rails.

      --
      - oZ
      // i am here.
    58. Re:Sure by Anonymous Coward · · Score: 0

      Why the devil did you feel you the need to correct the phrase that you quoted, you prescriptivist pig? It communicated perfectly what the original author intended, which is the sum of the existence of language!

      Death to pedants! Your version of English is no better than anyone else's. /rant

    59. Re:Sure by oliderid · · Score: 1

      Concerning the SQL injection...I've implemented a simple protection but I still wonder if it is efficient or not :-) (just experimenting)

      The concept is extremely simple :
      A simple IF statement running for every single $_GET[] variable or $_POST[] variables.
      If a regex on SELECT, ALTER, DROP, INSERT, etc is true, then the script dies.

      I put this check in a module that I include first in any "runnable" PHP pages.
      I can use such a concept because there is no "text" post through forms by users on this web site.

      Does such a concept protect against SQL injection or not?

    60. Re:Sure by Just+Some+Guy · · Score: 1

      I find it hillarious and sad that most PHP tutorials recommend using the mysql_ functions, along with mysql_real_escape_str() function for doing database queries.

      Amen. That's (literally) a firing offense at my job. Well, you won't lose your job, but I will set you on fire.

      --
      Dewey, what part of this looks like authorities should be involved?
    61. Re:Sure by Just+Some+Guy · · Score: 2, Informative

      Crud. I replied to the wrong post.

      Does such a concept protect against SQL injection or not?

      No. That is, it's not the right (and easy!) way to handle it, so you can assume that someone will invent a clever workaround that will defeat your code. Really, just use named parameters and be done with it. It's easier than building your queries by hand and far safer, so there's no reason whatsoever not to do it.

      --
      Dewey, what part of this looks like authorities should be involved?
    62. Re:Sure by tenaciousj · · Score: 2, Informative

      As pointed out a few post up, their problem with database scaling was solved quite quickly i believe:

      http://www.loudthinking.com/posts/3-scaling-to-multiple-databases-with-rails

    63. Re:Sure by GrievousMistake · · Score: 4, Funny

      Sure, just log in, go to preferences -> homepage, and uncheck the box that says 'kdawson'. The slashdot admins will instantly take notice of your preference and kick him of the team, and with any luck you'll never hear from him again.

      --
      In a fair world, refrigerators would make electricity.
    64. Re:Sure by DeionXxX · · Score: 1

      CakePHP is great for two things... for organization of files (since views go in the views directory, controllers in the controllers directory, etc), and its Bake tool (which you can hack up to hell in order to get it to output your own code). Right now my company is able to generate an entire custom built CMS system using a very highly customized Bake. The output has all of the CRUD elements, searching, custom ACL, etc... Frankly it's amazing what we're able to build within a few minutes.

      We now use it for every project, just because we have this large custom built framework, and since everything is forced into this MVC pattern, the code is highly reusable.

      Sure you can achieve the same type of things by yourself if you're a good programmer with a solid programming background, but when you're working in a team of 20 developers with ranged skill sets, having a framework which forces you to stick to a programming pattern, is a godsend.

    65. Re:Sure by CastrTroy · · Score: 2, Informative

      Sorry to tell you this, but it very much doesn't. First, and not even related to whether it protects or not, is that it very much limits when someone can post to your server. If I need to post my name, and my name is Walter, then your script is just going to die. On the question about how well it works for blocking attacks, well, like mysql_real_escape_str, is what happens when you forget to use it. With prepared queries (not talking stored procedures here, so I don't scare anyone away), it's a completely different method of creating a query, and therefore it isn't very easy to "forget" something, and leave a vulnerability. Also, there's probably a large list of words you could be fogetting to check for. Stuff like "RENAME SCHEMA" may not be in your list, but could cause a DOS attack. You wouldn't lose any data, but your database would be renamed and therefore your site inaccessible to users. Your solution would protect against a common script kiddie, but wouldn't protect against someone who is determined to bring your site down. Using prepared queries is very easy to do, makes your code easier to read and maintain, and also speeds up database access. There really is no reason not to use it.

      --

      Anthropic principle: We see the universe the way it is because if it were different we would not be here to see it.
    66. Re:Sure by cHiphead · · Score: 1

      I nominate you for score 5, Funny

      --

      This is my sig. There are many like it, but this one is mine.
    67. Re:Sure by Anonymous Coward · · Score: 0

      "Oh... and BTW, first post =)"

      Any respect you might've earned through your post vaporized with this bit of silliness at the end.

    68. Re:Sure by felipekk · · Score: 1

      I really like http://www.typo3.com/TYPO3 (based on PHP5). Fast, feature-rich (but not bloated imo) with a good user base. Extensions help with stuff you might need or, at least, coding examples. Oh, and has been here for like 8 years or something if I remember correctly.

    69. Re:Sure by tholomyes · · Score: 1

      That said, the PHP code would be 2-10x as verbose, take far longer to write, and be far less maintainable. With Rails you just throw more hardware at it and it will scale as far as you need to. If you're running up against real walls in Rails scaling, try Merb. If you're just a PHP n00b who wouldn't know decent OO-code if it punched you in the face, then by all means stick with the Personal Home Page language

      Things have changed a little since 1996. PHP-- "PHP: Hypertext Processor", these days-- has some decent OO capabilities now. Also, even the best, most workflow-oriented language in the world can produce totally unmaintainable code in the wrong hands. Maintainability has more to do with the ability of the designer(s) than the capabilities of the language, in my experience.

      --
      When did the future switch from being a promise to a threat? -C. Palahniuk
    70. Re:Sure by Tassach · · Score: 2, Insightful

      You have the right idea about RoR (speaking as someone who excitedly spent /wasted/ a month learning into it). RoR has some hot ideas but it tries to be too smart and locked down for its own good.
      I had the same experience. Right now I'm trying out Catalyst + Mason running under mod_perl.

      Catalyst takes most of the good ideas from RoR and combines them with Perl's TIMTOWTDI philosophy, rather than Rails' "our way or the highway" attitude.

      Mason is a PHP-like templating language for Perl.
      --
      Why is it that the proponents of "one nation under God" are so eager to get rid of "liberty and justice for all"?
    71. Re:Sure by Anonymous Coward · · Score: 0

      Sadly, you're absolutely right on that; I wrote my main University project in RoR (an AJAXey email client) and I spent about half the paper explaining why RoR is just not ready for production sites (this was mostly because in order to get my coolest feature - dynamic code widgets, kinda like Firefox extensions - to work, I needed Ruby to run interpreted, which is a performance nightmare).

      If you want to run serious web apps and have the server infrastructure to back it up, the Google Web Toolkit kicks all the above into touch; otherwise, while it's lovely to play with, avoid RoR for anything that actually matters.

    72. Re:Sure by jwthompson2 · · Score: 1

      I know this sort of I hate "them" and "they" hate us sort of banter is normal for Slashdot but this sort of oversimplification is just stupid.

      PHP is a good language which I've developed with extensively and which is always on the table for projects I work on. RoR is a great framework built on a great language that I also use extensively. RoR, in my opinion and experience, is better for developing many types of web application in comparison to PHP on its own. PHP frameworks such as Zend, Cake, Symphony and others make the decision between Ruby and PHP (with any of those frameworks) more a matter of preference although I still feel RoR is a superior framework.

      However, I don't develop web sites with PHP or RoR because that is just dumb, I build web applications with them. I personally do most of my web sites with Radiant which is built on RoR because I like it as a CMS. But I could just as easily use one of the many PHP alternatives. RoR apps are harder to deploy than PHP apps and for that reason RoR isn't for the newbie or person just starting out but if you are fine with having to actually work a little to get your app deployed on most common hosting systems then I think RoR is definitely worth learning and using when it meets your needs or makes programming more enjoyable.

      --
      Even if I knew that tomorrow the world would go to pieces, I would still plant my apple tree. -Martin Luther
    73. Re:Sure by the_rev_matt · · Score: 1

      Container matters a LOT. Or so I've heard. I've been stuck with WebSphere for 6 years and performance is garbage. I don't blame Java, I blame IBM. The WAS Server is a monstrous piece of bloat, coming in at several GB for a bare App Server install. On fairly nice HPUX boxes performance is molasses in winter, and our app simply isn't that huge or complex (and we're talking to DB2 on the back end, so there's no vendor finger pointing issues).

      --
      this is getting old and so are you

      blog

    74. Re:Sure by jwthompson2 · · Score: 1

      Twitter had a problem with growing real big, really quick. Scaling at the pace with which Twitter needed to would suck across the board no matter what was backing it. Sure RoR might not have made things any easier but I doubt it was incredibly worse than say CakePHP would have been under the circumstances.

      I think of sites like Basecamp and other 37signals apps that run quite well. Scaling tends to be a matter of money and foresight and trying to work with what you've got. Scaling public apps is never simple in my experience, especially when you're dealing with a multi-tiered setup; there are always trade-offs and compromises that can or must be made.

      --
      Even if I knew that tomorrow the world would go to pieces, I would still plant my apple tree. -Martin Luther
    75. Re:Sure by Tazz_ben · · Score: 1, Insightful

      I also find the "CakePHP vs PHP5" question to not make any sense, I'm sorry. Maybe just me, but that made perfect sense. One option available to a programmer at the beginning of an application is to not use a framework at all. There is a number of reasons why the person may choose to do this. Maybe none of the frameworks do what you want to do with the application, maybe you can make them more efficient not using the framework. Or maybe there is a business decision that would drive you to not use a framework. I can tell you from personal experience that when we started on Heap CRM http://heap.wbpsystems.com/ we looked at Java, some of the PHP5 frameworks, etc. And it was business decision to (in our case) to write our own internal framework.
      --
      Developer of Heap CRM and Torch Project Management (WBP SYSTEMS)
    76. Re:Sure by Anonymous Coward · · Score: 0

      Except insofar as it's more easily understood, dumbass.

    77. Re:Sure by nuzak · · Score: 2, Informative

      > Does such a concept protect against SQL injection or not?

      DROP TABLE Customers;

      You also forgot to enumerate every stored procedure that might be callable, or guard against injecting unauthorized columns in those really dynamic queries that specify columns as parameters.

      Bound parameters protect against SQL injection without having to interrogate every bit of SQL and praying that you covered every attack. With bound parameters, something that real DB APIs have supported from day 1, you don't need goofy hacks like this. Even PHP supports them for a few databases now, I think.

      They're also faster and actually easier in the long run. Really, it's only PHP and the early-90's VB folks that even have to be told this sort of thing. Everything else got with the program long ago.

      --
      Done with slashdot, done with nerds, getting a life.
    78. Re:Sure by Anonymous Coward · · Score: 0

      I haven't used any of them but I like to eat cake on birthdays so I will vote for that. Mmmmm. Cake.

    79. Re:Sure by merreborn · · Score: 1

      MDB2 is probably preferable to PDO in at least some situations, since it's a PEAR package, as opposed a PECL module, which should make installation easier on cheap webhosts.

    80. Re:Sure by nuzak · · Score: 1

      The problem is that kdawson posts a good chunk of the content of slashdot in general.

      Does that mean that he posts occasionally good stories? Sure. Would I go to a restaurant that employed a waiter that shit on only every 10th plate? No. So while I might not go back to that restaurant even if they gave that waiter the boot, if Slashdot gets rid of kdawson, they might actually get an editor that could do their job.

      Pardon me, I just had a laughing fit for a moment.

      --
      Done with slashdot, done with nerds, getting a life.
    81. Re:Sure by budgenator · · Score: 1

      Is there any proof the KDawson isn't like an psychotic hallucination of CmdrTaco? I really think KDawson is taco's invisible friend with whom he has perverted sexual fantasies.

      --
      Apocalypse Cancelled, Sorry, No Ticket Refunds
    82. Re:Sure by Anonymous Coward · · Score: 0

      He didn't correct it, as the original was grammatically fine. He edited it to enable him to quote only a small portion without damaging the sense.

    83. Re:Sure by msh104 · · Score: 1

      I work for a company in the netherlands that creates all it's sites in typo3, and I agree that it's a nice cms. takes a while to get you really started, but once your up and running its a very nice program.

    84. Re:Sure by Anonymous Coward · · Score: 0

      I think you'll find that actually it's people who use Java, perl and Python who spend inordinate amounts of time worrying about PHP bugs, not PHP users.

    85. Re:Sure by pionzypher · · Score: 1

      Browsing through the docs, this one looks interesting. I haven't played with it yet, but I will.

      --
      I'll believe in corporations having personhood when Texas executes one... - advocate_one
    86. Re:Sure by CastrTroy · · Score: 1

      I recommended PDO because I find that most webhosts that I have seen have it installed by default. Any webhost that doesn't install PDO by default is probably worth switching from.

      --

      Anthropic principle: We see the universe the way it is because if it were different we would not be here to see it.
    87. Re:Sure by Heembo · · Score: 1

      PHP: The most security vulnerable web platform in the history of the web. Real secure websites use J2EE. Next?

      --
      Horns are really just a broken halo.
    88. Re:Sure by suv4x4 · · Score: 1

      The beauty of Ruby is, even if you don't like it the way they do it, you can always monkey patch it. Open up the object and override the method(s) you don't like.

      And when you add code from someone else who also opened up the same object to monkey patch it in another way what happens.

      A broken or buggy code.

      We have enough of this hell with the patchable JS prototypes and various messy frameworks trying to patch/add methods to the core objects. There's a reason you can't just open up a class and add methods to it after the fact in the other languages.

    89. Re:Sure by shmlco · · Score: 1

      "With Rails you just throw more hardware at it..."

      Actually, that was the core of the Twitter problem, because you can only add so many servers before you start saturating your database connections.

      --
      Any sect, cult, or religion will legislate its creed into law if it acquires the political power to do so.
    90. Re:Sure by shmlco · · Score: 1

      I think Ruby would be better off if it worked like ColdFusion, whiles CFML code into Java bytecode so it can run on existing JVMs. There are literally thousands of people at hundreds of companies who do nothing else but work on ways to speed up Java runtimes and JIT compilations.

      I'd leverage those efforts.

      --
      Any sect, cult, or religion will legislate its creed into law if it acquires the political power to do so.
    91. Re:Sure by Pollardito · · Score: 1

      setting aside the fact that Alter is a not-completely-uncommon last name that someone might actually have, there are ways to do sequel injection that have nothing to do with forcing new statements. if you inject "joe' or password='test" into the $user field and it's used in a query like "select password from employee where username='$user'" then you've let someone login as any account in the system that has the test password chosen. preparing statements is handy because you're telling the database driver that you're running one statement and that the pieces of the statement that are variable should be of certain types.

    92. Re:Sure by skarphace · · Score: 1

      Try doing that to the PHP core libs. Better know C, and love it a lot.
      That's why PHP5 is nice. A lot of core libs are starting to be converted to more of an OO interface where you can extend or abstract these core libs. They've got some way to go, but it's nice anyway.
      --
      Bullish Machine Tzar
    93. Re:Sure by DerekJ212 · · Score: 0

      In February 2006 but no longer.

    94. Re:Sure by Fozzyuw · · Score: 0

      I also find the "CakePHP vs PHP5" question to not make any sense, I'm sorry.

      yes, I was very confused about this as well, which just makes me feel kdawson doesn't know what he's talking about. But I'll assume that "PHP5" he means "Zend Framework 1.0" which was recently released.

      Cheers,
      Fozzy

      --
      "The past was erased, the erasure was forgotten, the lie became truth." ~1984 George Orwell
    95. Re:Sure by PHPfanboy · · Score: 1

      Just wanted to add that according to Wikipedia:
      CakePHP is an open source web application framework written in PHP, modeled after the concepts of Ruby on Rails.

      So the discussion is great:
      RoR vs RoR copy on PHP vs PHP5 language.

      Next week we'll be comparing chalk and cheese, see you then.

      --
      29 mpg. YMMV.
    96. Re:Sure by jchennav · · Score: 1

      This http://worsethanfailure.com/Articles/Injection_Rejection.aspxarticle describes a similar attempt at preventing SQL injection by checking for certain SQL statements. Certain names such as "Seth", "Amanda", and "George" don't work too well...

    97. Re:Sure by stonemetal · · Score: 1

      Penny-arcade.com is RoR app on a scale that I would call impressive. So when dumb people pick up an easy to use tool then shoot themselves in the foot with it. I don't blame the tool.

    98. Re:Sure by fredrik70 · · Score: 1

      >CakePHP is a typical PHP open source project: random code, bloated, no direction. It's also cool, in a way, but I'd never run big project on it.

      Why don't you check out CodeIgniter, it's neat, imho.

      --
      if (!signature) { throw std::runtime_error("No sig!"); }
    99. Re:Sure by Baddas · · Score: 1

      I'd rather have it fixable, because I have near-infinite faith in my ability to fix broken things.

      Now, if you don't feel that way, then sure, you'd want it all closed up.

      Me, I've run into way more problems that were unfixable due to closed source and closed objects than I have from Ruby's metaprogramming.

    100. Re:Sure by suv4x4 · · Score: 1

      I'd rather have it fixable, because I have near-infinite faith in my ability to fix broken things.

      Now, if you don't feel that way, then sure, you'd want it all closed up.


      You have no even clue about what I'm talking about, do you. Well, too bad. One day you'll work in a team or need to integrate someone else's code, or integrate your code with someone else's, and then you'll figure it out.

    101. Re:Sure by smellotron · · Score: 1

      Pfft.. Real men code websites in Java and ASP.

      I know it's not what you mean, but the idea of Visual Basic running in some sort of homebrew VB Interpreter Servlet running inside the Servlet Container makes me weep.

    102. Re:Sure by king-manic · · Score: 1

      I know it's not what you mean, but the idea of Visual Basic running in some sort of homebrew VB Interpreter Servlet running inside the Servlet Container makes me weep.

      Real men don't weep. Real men stand next to the thousand degree CPU and like it.

      --
      "There are more things in heaven and earth, Horatio, than are dreamt of in your philosophy."
    103. Re:Sure by nostriluu · · Score: 1

      Do you mean like this?

    104. Re:Sure by smellotron · · Score: 1

      I've seen too much "light code" that is under-tested and riddled with security holes because all of that checking makes the code inelegant.

      Checking inputs for security's sake shouldn't ever be inelegant. It's a very normal part of taking HTTP-land inputs (GET/POST/cookies/session/URL/...) and transforming it into domain-land input, and anyone who'se doing it inelegantly is probably doing so mostly out of inexperience.

    105. Re:Sure by smellotron · · Score: 1

      MDB2 is probably preferable to PDO in at least some situations

      I don't think I would ever recommend MDB2 over PDO, specifically, because it's PECL instead of PEAR. Granted I've only used PEAR::DB and not PEAR::MDB2, I can state with certainty that the PHP-land driver ended up being my old company's main performance bottleneck (even the time executing SQL queries was less). PDO doesn't suffer from the same bloat issues because it spends more time in C-land instead of PHP-land. If lightweight isn't a priority, I'd go with something like ADOdb that actually does database abstraction, instead of database access abstraction.

      If your host doesn't provide you with PDO (or PHP 5), get a new host.

    106. Re:Sure by smellotron · · Score: 1

      A simple IF statement running for every single $_GET[] variable or $_POST[] variables. If a regex on SELECT, ALTER, DROP, INSERT, etc is true, then the script dies.

      Many PHP tutorials focus on the wrong side of database security. You don't want to blacklist certain content; you really want to make any content safe for the database. PDO (or other drivers that support prepared statements) gets around this by having the driver handle content escaping. No blanket loop will work for all inputs; you need to trace every input variable and individually handle it.

      You might want to re-approach your experiment with the methodology of treating every input as a dedicated datatype, where you deserialize-or-die. Something like this:

      // define these functions yourself... one function for every datatype
      $id = toId($_GET['id']);
      $ip = toIPv4($_GET['ip']);
      $macaddr = toMacAddr($_GET['mac']);
      // or make a function to wrap all of this
      $safe = cleanInputs($_GET, array('id' => 'toId', 'ip' => 'toIPv4', 'mac' => 'toMacAddr'));
      extract($safe); // $id, $ip4, $macaddr are now defined

      If you're working in PHP 5, you can use objects with constructors that perform the deserialization, and throw exceptions on failure. With PHP 4, you can at least continue using native PHP variables with normalized contents, making the functions call trigger_error() or just die on failure.

      Then, when you need to send your data to the database, then you perform whatever database escaping is necessary (again... use prepared statements if possible). While you're at it, you can do the same thing with all of the variables that you print to the screen, so a variable of '& and NULL IS NULL <script will work like a charm in SQL and HTML.

    107. Re:Sure by SCdF · · Score: 1

      [[citation needed]]

    108. Re:Sure by dedazo · · Score: 1
      "Peak time" for this app is an entire 23-hour period, since it's a monthly cycle that spans something like 14 timezones.

      Still not very many, well gee...its more than 99.9% of web sites will ever need to do, so complaining that Rails can't scale is a little silly

      Well, that's certainly true and I believe I made that point earlier.

      --
      Web2.0: I love when people Flickr my cuil and digg my boingboing until my google is reddit and I start to yahoo
    109. Re:Sure by Baddas · · Score: 1

      I have faith in my coworkers, as well.

    110. Re:Sure by shmlco · · Score: 1

      Is that the primary implementation of Ruby? Are all of the Ruby developers working on that version, or are there two, three, or six different development efforts and platforms out there?

      It's hard to make real progress when all of your horses are running off in different directions.

      --
      Any sect, cult, or religion will legislate its creed into law if it acquires the political power to do so.
    111. Re:Sure by nostriluu · · Score: 1

      Check it out - it's sponsored by Sun.

    112. Re:Sure by schamarty · · Score: 1

      never argue with someone who claims to be an old fart. Old farts have no need for posturing or trolling, and are usually being a little understated, if anything!

    113. Re:Sure by Max+Littlemore · · Score: 1

      you will be cured of your tendency to RTFA soon

      Pffft. RTFA? I just hovered my mouse over the link to figure it out. RTFA indeed.

      --
      I don't therefore I'm not.
    114. Re:Sure by Foofoobar · · Score: 1

      Follow the link... they still do

      --
      This is my sig. There are many like it but this one is mine.
    115. Re:Sure by Anonymous Coward · · Score: 0

      Have you realised what the anagram of "kdawson" is? ;-)

    116. Re:Sure by NateTech · · Score: 1

      Yeah, the kids will learn about stored procedures (and how they've been around in real RDBMS's for over a decade), someday... and that they have real uses like the ones you mention, amongst others.

      --
      +++OK ATH
  2. ... Robots in disguise ... More than meets the eye by poopdeville · · Score: 3, Funny

    Great, a link to a wikipedia article. Wonderful.

    --
    After all, I am strangely colored.
  3. Isn't this just asking for flamewars? by Anonymous Coward · · Score: 2, Insightful

    This seems to be yet another kdawson story which exists to solely promote the "my X is better than yours" bashing, trolling and flames that always seem to follow these stories. Come on, can we get a new editor already?

    1. Re:Isn't this just asking for flamewars? by Anithira · · Score: 1

      Yep. It's like comparing apples to oranges to grapefruits. All 3 have their huge strengths and all 3 have big weaknesses. It depends on the project and how it'll be worked, not the language.

      --
      ~Cassandra
    2. Re:Isn't this just asking for flamewars? by kv9 · · Score: 1

      This seems to be yet another kdawson story which exists to solely promote the "my X is better than yours" bashing my X is better than yours, motherfucker (xorg).
  4. Brrrr... by jfclavette · · Score: 2, Insightful

    I can't comment on Ruby on Rails, but PHP (yes, even PHP5) is such an horrible language. Yes, it's widely available and is pretty much the only option out there for free/cheap hosts, but I just don't understand why someone would choose to use it in any serious project.

    JSP and ASP.Net (Yes, I know, this is Slashdot) are, IMHO, much more much more powerful and pleasant to work with. If I had to pick amongst the proposed solutions, I'd pick RoR if only for the fact that Ruby is a nice language. I don't know about Rails' features but I could at least trust the language it's built on.

    1. Re:Brrrr... by Baddas · · Score: 4, Insightful

      JSP and ASP are terrible compared to rails. You really ought to pick up Agile Web Development with Ruby On Rails and go through the sample project at least.

      It'll change the way you think about development for the web.

      Or, if you're really set on Java, try Rails for Java Developers and you'll see how much more concise the exact same code is in Rails.

    2. Re:Brrrr... by pembo13 · · Score: 1

      Well at least you qualified it by saying in your opinion. Just to share mine, having used PHP and ASP.net, I rather work with PHP for free than be paid to use ASP.NET. I do use both however.

      --
      "Thanks for all the money you paid to us. We've used it to buy off ISO among other things" -Microsoft
    3. Re:Brrrr... by BladeMelbourne · · Score: 1

      That is a good book for picking up RoR and Ruby quickly.

      It hasn't converted me from my preference for PHP though ;-)

    4. Re:Brrrr... by @madeus · · Score: 4, Insightful

      Compare a straightforward Java class, with try/catch (a silly example, but obviously just to provide some syntax):

      public class DoStuff {
          protected double someNumber;

          public setSomeNumber( double number ) {
              try {
                  someNumber = number;
              } catch (Exception e) {
                  // See e.getMessage() for error
              }
          }
      }

      ... with some PHP for the same code, which would look like this:

      public class DoStuff {
          private someNumber;

          public setSomeNumber($number) {
              try {
                  $this->someNumber = $number;
              } catch (Exception $e) {
                  // See $e->getMessage() for error
              }
          }
      }

      I don't see how that's wacky syntax in the slightest. Just people people use PHP like it's Perl+Mason doesn't mean you can't use PHP for serious, scaleable, enterprise software. I know from experience that people are just as likely to write nasty Perl, Ruby or ASP as they are nasty PHP.

      Personally I think Java makes it more difficult to be wacky (even though of course it can't force people to write code that's ultimately good) and that has definite benefits in an enterprise environment, but that lack of flexibility (which scripting languages like Perl and PHP have) is also why I don't tend to want to use Java.

    5. Re:Brrrr... by Baddas · · Score: 1

      All I can say is, you haven't worked in it enough then. Solve some substantial problems 'the ruby way' and then solve the same thing in PHP. Or try translating a site from one the other... and for extra credit, back again.

    6. Re:Brrrr... by Anonymous Coward · · Score: 2, Insightful

      The problem with java is not the coding, it is the ridiculous amount of hassle you get in deploying multiple apps on a single server. Having to change XML config files buried in archives, ClassLoader problems because two apps need to use the same (or different versions of the same) library. Stupid hassles when versions upgrade which serve no real purpose (moving classes from java.what.ever to javax.what.ever).

      Java is great if you work on a single application with its own hosting environment, if you need multiple websites or webapps it quickly becomes a configuration nightmare. I think that is why a lot of experienced java developers seem to really like Ruby, because right now configuration is the single biggest hassle in the development of java websites.

    7. Re:Brrrr... by BladeMelbourne · · Score: 3, Insightful

      RoR is a framework, you can't fairly compare it to PHP, which is a language.

    8. Re:Brrrr... by shutdown+-p+now · · Score: 2, Insightful

      JSP and ASP are terrible compared to rails.
      In speed of development, yes. But what about perfomance, scalability, and reliability? How about amount and quality of available documentation?
    9. Re:Brrrr... by Baddas · · Score: 1

      Well, then, use Ruby with mod_ruby and see how that goes. At that point, it's apples to apples, and Ruby still wins.

    10. Re:Brrrr... by doktorjayd · · Score: 2, Interesting

      hmmm

      jsp as a presentation layer is fine. particularly for the i18n and heaps of readily available tag libraries which you simply include and scope.

      java as a platform for web applications should really be always said as 'java is THE platform for web applications'.

      once you step away from the 'type 1' or pure jsp ( or asp, or php ) apps and enter 'type 2' or MVC frameworks, your systems development gets a lot faster, more modularised and much more maintainable.

      try struts, springMVC or any of the dozen or so high order open source MVC frameworks. watch JSF mature over the next year or 2.

      scalablitly, speed, and available pool of talented developers... why on earth would anyone go php? ( case in point.. how many bank web systems are php based? )

    11. Re:Brrrr... by jrumney · · Score: 2, Informative

      Having to change XML config files buried in archives

      That would be a problem with a specific application's packaging, nothing to do with the language that was used to code it.

      ClassLoader problems because two apps need to use the same (or different versions of the same) library.

      J2EE specifies application specific library directories, which is how you should be deploying them. If you are deploying your libraries into a shared directory and modifying the classpath, then it is you that is at fault, not Java.

      Stupid hassles when versions upgrade which serve no real purpose (moving classes from java.what.ever to javax.what.ever).

      What version upgrade moved something from java.what.ever to javax.what.ever? I've seen packages move from com.third-party.what.ever to javax.what.ever when they were accepted as a standard library, but never something incompatibly moving within the java/javax namespace.

    12. Re:Brrrr... by dkf · · Score: 1

      JSP and ASP are terrible compared to rails.

      In speed of development, yes. But what about perfomance, scalability, and reliability? How about amount and quality of available documentation? Current evidence (OK, a quick google!) is that Ruby doesn't have real multithreading (i.e. green threads only) and that PHP's is still a painful hack. Since multithreading is a real requirement for performance and scalability these days, (threads scale for performance better than processes, and you can always have more processes too) I have to conclude that Ruby's not at all ready for prime time and won't be for years (I don't even detect agreement within the Ruby community that native threads are a goal worth pursuing) and PHP has got a lot more pain to go through before it gets there (the sheer messiness of PHP makes their job harder) especially when you add the requirement for reliability. Experience (from around 10 years ago with Tcl) indicates that it takes a lot of work to stabilize a good native threading implementation in a language, mostly because of the tendency for problems to only crop up under heavy load and never when you have decent instrumentation attached. Such problems are referred to as Heisenbugs with good reason!

      If you're serious about a performant scalable reliable rich integrated web server platform, you're probably talking about using JSP, ASP.NET or AOLserver. Of these, the last one is (IIRC) fastest, both when dealing with pages generated from DB queries and when the content is purely non-DB. The AOLserver guys are good (even if AOL users are not so highly respected...)
      --
      "Little does he know, but there is no 'I' in 'Idiot'!"
    13. Re:Brrrr... by BladeMelbourne · · Score: 1

      Ruby = language
      Rails = framework
      Ruby on Rails = framework implemented with said language.

      You can't fairly compare framework+language to another language. That's like comparing a complete bike to a bike frame.

      Don't let me discourage you from completing high school. Good luck with English comprehension.

    14. Re:Brrrr... by kripkenstein · · Score: 1

      I know from experience that people are just as likely to write nasty Perl, Ruby or ASP as they are nasty PHP.
      Ah, but what about Python? With enforced whitespace and a mob of Pythonistas ready to flame you for improper style, all Python code turns out nice and elegant ;)

      (Seriously, though, Python is the only language where it is even remotely convenient to read other people's code.)
    15. Re:Brrrr... by Dragonslicer · · Score: 1

      The reason for that is that PHP5's OO model is almost a direct copy of Java's. I'm not saying that's bad (in fact, I prefer Java's model to that of Python or Javascript), I'm just saying that's why they're similar.

    16. Re:Brrrr... by k-zed · · Score: 1

      Since multithreading is a real requirement for performance and scalability these days, (threads scale for performance better than processes, and you can always have more processes too) Misguided opinion of someone probably schooled in a Microsoft shop. Processes are expensive on VMS-descendant operating systems ('doze), but virtually free on modern Unices.
      --
      we discovered a new way to think.
    17. Re:Brrrr... by sircastor · · Score: 1

      Languages are what you make of them. Some are going to have certain strengths, and certain weaknesses, but at the end of the day, it's more how you code, than how the compiler goes about doing it's job.

    18. Re:Brrrr... by Anonymous Coward · · Score: 0

      I just don't understand why someone would choose to use it in any serious project.

      I totally agree! I mean aside from tiny projects like Facebook, Wikipedia, and just about every blog on the internet, PHP really isn't that scalable. Good call.
    19. Re:Brrrr... by rbanffy · · Score: 1

      "JSP isn't much better. It's basically the same model as PHP and ASP (web page with server-side language embedded in it)"

      I don't know where you have been using JSP, but the model 1 approach you describe, while used in very small applications is not the end-all way of doing Java.

      While I do prefer Python and Zope to build web applications, I have to admit a lot has happened in the Java front. You can do a lot with JSTL, Struts, JSF and other technologies that make it rather easy to do MVC-style web applications. I try to avoid doing Java, but I have to pay my bills.

      The problem with PHP is the non-existent entry barrier. Not only it has pretty little to attract the best and brightest, it does very little to weed out the worst and dimmest.

    20. Re:Brrrr... by @madeus · · Score: 1

      Oh yeah for sure. I should also have said they are very open about that.

      Personally I think what they have done was a smart move (and I also in the things they've deliberately done slightly differently, in that I think they are improvements that aid readability). I'm all for copying things that are deemed to be good.

    21. Re:Brrrr... by Blnky · · Score: 1

      Compare a straightforward Java class, with try/catch (a silly example, but obviously just to provide some syntax):

      public class DoStuff {
          protected double someNumber;

          public setSomeNumber( double number ) {
              try {
                  someNumber = number;
              } catch (Exception e) { // See e.getMessage() for error
              }
          }
      } ... with some PHP for the same code, which would look like this:

      public class DoStuff {
          private someNumber;

          public setSomeNumber($number) {
              try {
                  $this->someNumber = $number;
              } catch (Exception $e) { // See $e->getMessage() for error
              }
          }
      }
      For anyone looking for the Ruby comparison with the same contrived try/catch....

      class DoStuff
              def setSomeNumber(number)
                      begin
                              @number = number
                      rescue => e
                              # See e.message for error
                      end
              end
      end
    22. Re:Brrrr... by Gyver_lb · · Score: 1

      In fact, given that the code above doesn't even try to handle the exception, you could has well write:

      class DoStuff
          attr_accessor :somenumber
      end

      and automatically get:

      > o = DoStuff.new
      > o.somenumber = 15
      > puts o.somenumber
      15

      You can add the exception handling if you want to check that @somenumber is a Fixnum. But that would be so if you want to waste time programming in Ruby like you are *forced to* in Java. If you are prepared to learn more efficient coding methods, you'll use unit testing to make sure that whatever code you write using DoStuff isn't brain-damaged (including the possible somenumber problems).

    23. Re:Brrrr... by Anonymous Coward · · Score: 0

      Mono is always an option for ASP.NET work, and it's very good at it. And, of course, it's free. :)

    24. Re:Brrrr... by nuzak · · Score: 1

      Good god, the only thing I can think of that I would want to use less than PHP is JSP. Java is fine, give me Tapestry, Seam, Wicket, Struts, Stripes, Aranea, RIFE, Echo2, GWT, the list just goes on and on. JSP itself is a monstrosity and only good for variable substution, if that, and JSF is frankly little better unless you have great taglibs that go beyond the craptastic ones that ship with the reference implementation.

      --
      Done with slashdot, done with nerds, getting a life.
    25. Re:Brrrr... by aevans · · Score: 0

      Remember how Linux threads were just unnamed processes with shared memory? Because it turns out forking processes is really cheap and has alot of benefits over threading, with the one disadvantage being shared memory being also it's greatest strength. That's why prefork Apache is such a win -- if you use Linux. Now that Linux has good threads it's possible, but unnecessary to create a multithreaded server, but Apache, for instance, still isn't great that way.

    26. Re:Brrrr... by smellotron · · Score: 1

      I may as well add the Python equivalent:

      class DoStuff(object):
          def DoStuff(self):
              self.somenumber = 0 # or whatever default you want

      Then you do this:
      > o = DoStuff()
      > o.somenumber = 15
      > print o.somenumber

      Then if you want to add instrumentation to it later (validation for setter, tracking for getter), you just turn it into a property and hide the bald data:

      class DoStuff(object):
          def DoStuff(self):
              self.__somenumber = 0

          def __somenumber_getter(self):
              print "get"
              return self.__somenumber

          def __somenumber_setter(self, somenumber):
              print "set"
              self.__somenumber = somenumber

          somenumber = Property(__somenumber_getter, __somenumber_setter)
          # or we could omit the setter to make it read-only

      Client code doesn't need to change (looks to be the same with Ruby).

    27. Re:Brrrr... by smellotron · · Score: 1

      scalablitly,

      PHP + Memcache for object caching + APC for script-parse caching + some sort of distributed-session mechanism (dunno what's out there, never had to do it). Assuming you're talking about cluster-wise scaling. But there's about 10 definitions of "scalability" so I'm not sure what you mean here.

      speed,

      I don't have a lot of Java experience, but In My Experience Java servlets run at hampster-wheel speed on anything but the biggest iron machines you can get. I can make PHP scripts that use spartan database access functions that scream even on small machines. It may take longer to get something working, but it'll be faster and use less resources. If you have any tips on reducing latency for Java Servlets, let me know, because that's always been my #1 turnoff for Java.

      and available pool of talented developers...

      You definitely have a point there. Talented PHP developers cost more money, because they're so rare!

      why on earth would anyone go php? ( case in point.. how many bank web systems are php based? )

      Banks aren't exactly known for technological innovation. They tend to cluster together on some "best practices" solution regardless of whether or not it's the best choice. Banks use Java because lots of other people have used Java, and it's hard to make an argument against it (from their perspective). PLus, they'd have to pay more for a PHP solution simply on the basis that competent PHP developers are much rarer than competent Java developers.

    28. Re:Brrrr... by smellotron · · Score: 1

      Since multithreading is a real requirement for performance and scalability these days, (threads scale for performance better than processes, and you can always have more processes too)

      No! General multithreading is not the solution for extreme performance, especially on web applications. Multithreaded applications have too many locks and context-switching. You want something like a libevent driver or Python Twisted that does single-threaded event dispatching with asynchronous I/O, so you can avoid locking and context switches.

      What's more, thread concurrency is really a red herring here. You only want enough threads to keep a single CPU busy without thrashing... server farms get more concurrency simply by adding CPUs, and that is far more effective than throwing 10,000 threads onto a single server (take Google, for example). If you're writing multithreaded PHP scripts that are accessed from the web, I am sorry for whoever has to come maintain it. Much cleaner to multithread by using object, iframe, or other client-side methods of invoking multiple server-side scripts concurrently.

    29. Re:Brrrr... by doktorjayd · · Score: 1

      I don't have a lot of Java experience, but In My Experience Java

      and there you have it.

      take it from someone with years of commercial experience using a broad variety of web frameworks.

      ( perhaps its time you grabbed tomcat and a few sample servlet/jsp based web apps and took it for a spin. try confluence ( http://www.atlassian.com/software/confluence ) with the free/personal license. )

      php has its place, but that place is definately not for big, feature rich, scalable and fast web applications. ( and we'll cut php some slack and just not mention security at all ). probably the biggest flaw in the php model is the need to load the entire application up for each request. in the java model, the application is loaded and establishes listeners which handle requests immediately.

      banks make choices based on actual best practices, then select the most appropriate platform for development and deployment, which will invariably be a choice of java or .NET ( using the java clone c# ), and will usually be influenced by what other infrastructure is already in place.

      i run confluence at home on a p3 733 machine with 512 megs of ram, which also does several other java web apps, postgres, mysql, sendmail, dovecot, spamassassin, ldap, smb/nfs, and of course apache with a few php apps for good measure. confluence returns responses every bit as fast as squirrelmail and orders of magnitude faster than that pig slop sugar CRM.

      if you ever needed a case study in what not to implement in php, let me tell you sugarCRM is it.

      and of course, mod_cache is very effective for static content coming out of a java web app behind mod_jk ( or mod_proxy_ajp ), and theres a ton of open source servlet filters you can wire in to your web.xml to squeeze even more out of it. ( all this without even starting to talk about ehcache or oscache for query and db object caching within the application )

      come back when you try the above, and try tell us with a straight face that php is the better choice for just about anything past 'my first dynamic website'.

      opening up with 'i have no java experience, so let me tell you about my java experience' is really just wasting bandwidth.

      regards.

    30. Re:Brrrr... by @madeus · · Score: 1

      Thanks, that inspires me to create a page with a nice comparison of a simple app in a few languages with some stuff like that (Wikipedia has some good HelloWorld examples IIRC, but they are naturally very terse).

    31. Re:Brrrr... by smellotron · · Score: 1

      i run confluence at home on a p3 733 machine with 512 megs of ram, which also does several other java web apps, postgres, mysql, sendmail, dovecot, spamassassin, ldap, smb/nfs, and of course apache with a few php apps for good measure. confluence returns responses every bit as fast as squirrelmail and orders of magnitude faster than that pig slop sugar CRM.

      That's cool, but you didn't answer the one productive question I have about Java, so let me be more specific. I've installed stock Tomcat on Windows, Debian, an Ubuntu, and every time, the "Hello World" application is dog-slow compared to PHP apps that I've written myself (I don't doubt you that sugarCRM is crap... most popular PHP projects are). I don't care about caching solutions, because any dynamic content can be cached. I care about latency going through a single request on an unloaded server. What is so wrong with the default setup that I experience lag going to http://127.0.0.1:8080/?

    32. Re:Brrrr... by aevans · · Score: 0

      That problem comes about because of the compiling and variable typing requirements of Java. If someNumber isn't a double, there'll be hell to pay at runtime, so you have to force your config to account for that, because the compiler doesn't check your XML text files. If you want to change it to accept an integer, then you need to recompile and redeploy. Alternately, if a PHP script accepts an integer for someNumber you have to test and handle the exception.

    33. Re:Brrrr... by aevans · · Score: 0

      Just don't try to cut and paste it!

    34. Re:Brrrr... by kripkenstein · · Score: 1

      C'mon, every decent editor has indentation shortcuts... :)

    35. Re:Brrrr... by colinrichardday · · Score: 1

      java as a platform for web applications should really be always said as 'java is THE platform for web applications'.

      Does Java have the equivalent of PHP's eval() function?

    36. Re:Brrrr... by doktorjayd · · Score: 1

      What is so wrong with the default setup that I experience lag going to http://127.0.0.1:8080/?

      eh? more than likely its caused by the crack you are smoking. lets run a few timed tests to see:

      me@myhost:~/Desktop/apache-tomcat-6.0.14>./bin/startup.sh
      me@myhost:~/Desktop/apache-tomcat-6.0.14>time wget http://localhost:8080/
      --12:20:35-- http://localhost:8080/ => `index.html'
      Resolving localhost... 127.0.0.1
      Connecting to localhost|127.0.0.1|:8080... connected.
      HTTP request sent, awaiting response... 200 OK
      Length: 7,347 (7.2K) [text/html]
      100%[...] 7,347 --.--K/s
      12:20:35 (368.85 MB/s) - `index.html' saved [7347/7347]
      real 0m0.065s
      user 0m0.000s
      sys 0m0.010s

      then a subsequent ( ie: not the first ) request:

      real 0m0.004s
      user 0m0.002s
      sys 0m0.002s

      how bout compared to my apache serving up a static page?

      me@myhost:~/Desktop/apache-tomcat-6.0.14>time wget http://localhost/svnbook/
      --12:25:56-- http://localhost/svnbook/ => `index.html.2'
      Resolving localhost... 127.0.0.1
      Connecting to localhost|127.0.0.1|:80... connected.
      HTTP request sent, awaiting response... 200 OK
      Length: 51,155 (50K) [text/html]
      100%[...] 51,155 --.--K/s
      12:25:56 (243.56 MB/s) - `index.html' saved [51155/51155]
      real 0m0.006s
      user 0m0.001s
      sys 0m0.004s

      hmmm not much different eh? in fact, that says the real time to serve up content from apache was .002s slower than tomcat! perhaps we need a php page (yum install squirrelmail...) to really compare apples with apples?

      me@myhost:~/Desktop/apache-tomcat-6.0.14>time wget http://localhost/webmail/src/login.php
      --12:32:02-- http://localhost/webmail/src/login.php => `login.php'
      Resolving localhost... 127.0.0.1
      Connecting to localhost|127.0.0.1|:80... connected.
      HTTP request sent, awaiting response... 200 OK
      Length: 2,154 (2.1K) [text/html]
      100%[...] 2,154 --.--K/s
      12:32:02 (222.82 MB/s) - `login.php' saved [2154/2154]
      real 0m0.021s
      user 0m0.002s
      sys 0m0.002s

      sorry dude, but you have no leg to stand on here.

    37. Re:Brrrr... by doktorjayd · · Score: 1

      Does Java have the equivalent of PHP's eval() function?

      all that and more.

      try velocity, freemarker or any of a bunch of templating engines if you want to parse a $tokenized string and have variables inserted or macros/functions run from whats in the input.

      java as a platform provides all the building blocks you need, plus a wide variety of common libraries. the icing on the cake is the multitude of 3rd party library code ( open source and commercial ) that you can quickly integrate and use for whatever your needs are.

      ( as an aside, using php's eval() is a dirty way of writing code. http://au2.php.net/manual/en/function.eval.php#75389 for starters )

    38. Re:Brrrr... by colinrichardday · · Score: 1

      I realize that eval() is dangerous, as naive use of it could allow users to execute malicious code. I wanted to use it in mathematics, allowing the user to enter a mathematical expression and get some response. I would have limited the functions to those in the math library and limited the variable (for the one-variable case)tobe "$x".

      Thanks

  5. Rails by Baddas · · Score: 4, Interesting

    I've worked in all three, repeatedly, and there's really no contest. Rails is so much easier to get concepts out, and has so many fewer bugs (in my experience), that it's silly to use PHP at this point, unless you have overriding reasons for choosing it aside from inherent qualities.

    1. Re:Rails by astrotek · · Score: 2, Insightful

      ror is good for concepts but I haven't seen any good examples of it in production.

    2. Re:Rails by Baddas · · Score: 1

      Kongregate? That one wins it for me.

    3. Re:Rails by Baricom · · Score: 1

      http://37signals.com/, although in fairness, they had a large hand in writing Rails.

    4. Re:Rails by scsscs · · Score: 1

      All the 37signals sites, Penny Arcade, Twitter, all the 43things sites, i'm in like with you, and Jobster are a few.

    5. Re:Rails by Wite_Noiz · · Score: 1

      Interestingly, their "Signals vs Noise" blog is powered by PHP: http://www.37signals.com/svn/index.php

      (Freaky. Captcha is 'signal')

    6. Re:Rails by An+Onerous+Coward · · Score: 1

      I love Rails as much as (okay, more than) the next guy, but I don't think kongregate has a standard traffic profile. User shows up, navigates to favorite flash game, then plays it for a half hour or so (during which time the user isn't making much in the way of server requests). Most of the traffic would, I assume, come in the form of big Flash downloads, which would best be handled by Apache directly (if not put on another server altogether).

      It's a nice site, with a lot of polish, and I would certainly use it to show off the niftiness of Rails. But it's not necessarily proof of scalability.

      --

      You want the truthiness? You can't handle the truthiness!

    7. Re:Rails by Baddas · · Score: 1

      They do a lot of back and forth while in the flash game. Their chats are all hitting rails, as are the high score submissions. Just FYI.

    8. Re:Rails by mini+me · · Score: 1

      You might want to look a little closer. The Signal vs Noise blog is powered by Ruby on Rails: http://www.37signals.com/svn/posts/37-the-newish-signal-vs-noise

    9. Re:Rails by prockcore · · Score: 1

      I use php over rails because I don't like the hoops you have to jump through to make rails work with apache. (Including all the crazy behind the scenes rewrite tricks to have more than one rails app on the same host).

  6. Django. by Anonymous Coward · · Score: 0

    Django.

    1. Re:Django. by Anonymous Coward · · Score: 1, Interesting

      I also vote Django. It has been shown to scale well and can take advantage of caching and all sorts of fun stuff.

  7. I would start a News website built upon... by Anonymous Coward · · Score: 1, Insightful

    ... real journalists and good standards!

    Of course, that's just me.

  8. Errr, this is a new story by Anonymous Coward · · Score: 2, Informative

    This is more an ask slashdot post. And even so, CakePHP and RoR are frameworks while PHP is a language.
    That being said, CakePHP is fantastic and for anything past simple scripts, I am finding CakePHP speeds up development greatly.

    1. Re:Errr, this is a new story by corychristison · · Score: 4, Insightful
      I agree.

      Lately people (aka: script kiddies) seem to be losing the distinction between what is a language, and what is a framework. I cannot remember the last time I downloaded a PHP script and it required PEAR. I absolutely despise PEAR, and all other frameworks that really don't seem to have a place.

      Over the past 5 years or so (I develop websites for a living) I've developed a framework-style setup that I use for all new projects. Most sites don't share the same code as I develop project-specific. But the structure is the same, and in most cases I could grab a pile of files from one site and plop them in the next and it would work.

      Use the tool as it is meant to be used. PHP is a language. A framework is a framework. Please don't compare them on the same level.

    2. Re:Errr, this is a new story by RegularFry · · Score: 2, Insightful

      Use the tool as it is meant to be used. PHP is a language. A framework is a framework. Please don't compare them on the same level.

      Except that in this case, the comparison is valid. PHP without a framework is, if you will, the null framework. Its advantages are that there is no learning curve, deployment is trivial, and there's no runtime framework overhead to heat up your CPUs. On the other hand, it doesn't help you at all in writing the app, and once your site gets beyond a certain size you'll probably end up writing a framework anyway - as it sounds like you've done, after a fashion.
      --
      Reality is the ultimate Rorschach.
    3. Re:Errr, this is a new story by Anonymous Coward · · Score: 0

      Agreed, both RoR and CakePHP are Frameworks and they are build in top of Ruby and PHP cant be compared.

      I could say that language which you using is the best language ever. So people using .NET could say it's best and PHP worst, and up-side down - PHP Devs will say PHP is great. It's just a matter of taste.

      Personally me - I am PHP Developer :) and I am using CakePHP.

      Regards
      Nik

      http://nik.chankov.net/

    4. Re:Errr, this is a new story by Ukab+the+Great · · Score: 1

      Lately people (aka: script kiddies) seem to be losing the distinction between what is a language, and what is a framework

      Many of the people developing frameworks have this problem as well.

      They noodle about with run-time introspection and other crap to the point where the framework really stops resembling an implementation of a framework in a language and starts resembling it's own "special" language with "special" syntax and "special" keywords and "special" namespace conflicts that the original language never had.

    5. Re:Errr, this is a new story by CastrTroy · · Score: 1

      This brings up a good point. Most people will just stick with using MySQL or some other RDBMS because it does what they need it to do, and writing your own database engine specific to your project is hard, and not worth the effort. However, writing a framework is often less hard, and also, what a framework does, is usually less specific. That is, most frameworks are very broad, and very much not suited to the kind of project you want to do. You see a lot of, "we're doing it this way, because that's the restriction the framework places on us" kind of thing going one when people start using generic frameworks. However, when you build your own framework, it fits your needs perfectly, and is only as big as you need it to be. For most large projects, it makes the most sense to build your own framework for your own needs, instead of trying to cram everything into an existing framework that may not meet all your needs. As the project gets bigger, the percentage of code (relative to the whole project) that the framework takes up is very small in comparison to the rest of the project.

      --

      Anthropic principle: We see the universe the way it is because if it were different we would not be here to see it.
    6. Re:Errr, this is a new story by shark+swooner · · Score: 1

      Lately people (aka: script kiddies) seem to be losing the distinction between what is a language, and what is a framework. I cannot remember the last time I downloaded a PHP script and it required PEAR. I absolutely despise PEAR, and all other frameworks that really don't seem to have a place.

      You're losing the distinction between a framework and a library.

      PEAR isn't a framework, it's a library management tool, like CPAN is for perl. It would make no sense to say I'm building a website 'using PEAR' as much as you could build a web site 'using CPAN', but you could say I'm building a web site in PHP and I used a couple packages that I found in PEAR.

    7. Re:Errr, this is a new story by Sancho · · Score: 1

      That's actually quite an astute observation. I wish that I had mod points for you.

      Ruby on Rails suffers from this tremendously. It's like a language which has Ruby-like syntax, but all of the clever tricks they use really separate it from Ruby itself (which, minus the lack of true threading, is a pretty neat language.)

  9. Doesn't it depend on what you intend to do? by javakah · · Score: 4, Interesting

    There are different things that you can do with a website, so first of all it really depends on what you are intending. PHP5 will be great for building creating more traditional websites that are driven by HTML forms, and is probably the best thing to use for such purposes. Ruby on Rails seems to be meant for if you are planning to build AJAX apps. It's fairly easy, with a lower learning curve, but does have scalability issues. Another option that you might consider if you are looking for AJAX stuff would be GWT, the Google Web Toolkit. Larger learning curve, but very fast web apps. Really though, comparing PHP5 and RoR seems kind of like comparing apples and oranges. Just remember, figure out what you are trying to do first, then pick the language.

    1. Re:Doesn't it depend on what you intend to do? by AaronBrethorst · · Score: 4, Interesting

      I disagree. Rails is fantastic for quickly rolling database-driven forms apps. It includes some nice helpers for quickly integrating asynchronous behavior (Ajax), but it's certainly not mandatory. PHP5 doesn't include an OR mapper, and nor should it; an OR mapper should be part of a separate framework or library (just as it is with Ruby and Ruby on Rails). I think that Rails actually has a fairly steep learning curve. It has *very* specific ways of handling most things, and trying to fight against these things will only come back to hurt you in the end. Additionally, since it requires you to function in an MVC mode, there might be an additional bit of learning present as you figure out how to properly separate your app into presentation, model and controller layers.

      At the end of the day, it all comes down to need and experience. If you know how to use PHP, why not use it? If you have to integrate a new feature into an existing Rails app, then you'd better learn Rails in a hurry. Personally, I'll build Windows server-targeted web apps in ASP.NET because I know the tooling and the backend. If I'm hosting on Linux or UNIX, I'll write it in Rails because the language and frameworks are so much nicer to use than PHP.

      --
      No, but I used to work for Microsoft.
    2. Re:Doesn't it depend on what you intend to do? by misleb · · Score: 2, Insightful

      Rails for Ajax stuff? There are WAY better reasons for going with Rails than to get Ajax. A proper MVC framework, for starters. Rails is really meant for building *applications,* not necessarily "sites." If you can frame your site as an application, great, but don't expect Rails to power (well) just any old site.

      And, yeah, comparing Rails to PHP5 is kinda dumb because Rails is a framework and PHP5 is a language. The problem with using "PHP5" in any non-trivial application is that you invariably end up building your own framework(s) which can be a huge time sink. Now, comparing Rails and CakePHP would make much more sense. I haven't used CakePHP, but it looks like it has all the major framework features that Rails has. Though being based on PHP is a huge handicap, IMO. PHP is just kind of a dumb language... at least compared to Ruby. Ruby is just an awesome little language. If only it were faster. :-/

      --
      "THERE IS NO JUSTICE, THERE IS ONLY ME." -Death
    3. Re:Doesn't it depend on what you intend to do? by misleb · · Score: 1

      I think that Rails actually has a fairly steep learning curve. It has *very* specific ways of handling most things, and trying to fight against these things will only come back to hurt you in the end.


      Rails only has a steep learning curve because most people learning Rails are also learning Ruby for the first time. Learning a language and a framework simultaneously is hard. Ruby, by itself, is actually very easy to learn... principle of least surprise and all that. And if you're already know Ruby, are comfortable with MVC, unit testing, ORM, etc, Rails should be a breeze to learn.

      At the end of the day, it all comes down to need and experience. If you know how to use PHP, why not use it?


      Because if all you've known is PHP, learning a language like Ruby can be a revelation. I, for one, didn't want to so much as *look* at another line of PHP, much less write one, after learning Ruby and Rails.

      -matthew
      --
      "THERE IS NO JUSTICE, THERE IS ONLY ME." -Death
    4. Re:Doesn't it depend on what you intend to do? by __aabvlw4075 · · Score: 1

      PHP5 will be great for building creating more traditional websites that are driven by HTML forms, and is probably the best thing to use for such purposes. Actually, handling forms is one of the things frameworks like Rails (and I assume CakePHP) make really easy, so Rails definitely beats plain PHP here. If the data from the forms is going to be stored in a database, the benefit of Rails is increased significantly.

      Ruby on Rails seems to be meant for if you are planning to build AJAX apps. Rails is a framework that makes many things easier for the developer, and AJAX is just one of those many things. It is by no means a main focus of Rails. If you wanted to pick one main thing that Rails was "meant for", I'd say it's database usage. ActiveRecord (a part of the Rails framework) makes working with databases way easier than is possible in plain PHP.
  10. the answer: it depends by david_bonn · · Score: 5, Insightful
    Honestly, great websites and web applications have been written using all three of those products. What the best choice for your website will be depends a lot on what your website is. Each of those frameworks makes certain assumptions about how the world works, and you will be happiest with a framework that is closest to your pwn assumptions -- otherwise you'll spend as much time fighting the framework as writing your website.

    Any halfway skilled programmer will be able to do useful work with any of those frameworks fairly early on, but all of them are also very rich environments, so there's always more to learn.

    I've written web apps in an ungodly tangle of PHP4 and PHP 5 and Perl and using Ruby on Rails. Currently Ruby on Rails is in favor, but is far from perfect.

    Probably most of my frustration with Rails and PHP 5 has to do with Active Record. My big gripes are: (1) Schemas, entity-relationship diagrams, and queries tell me how an application works -- with Active Record this information is strewn across a whole bunch of files (especially in Rails); (2) Database-independence is a nice idea, but in reality, how often over the lifetime of your website will you migrate to a different database? Usually your database is chosen for you. Usually a switching databases involves coordinating with a lot of people who you'd usually rather not have to deal with -- those issues will take far more time and energy than differences between MySQL and Oracle; (3) a pretty common design pattern for web pages is to have a form that let's you fill in a few parameters (date, maybe geographical information) into a huge multi-table select statement -- you can do that in Active Record, but basically all you gain is a marginally fancier wrapper than you would have with DBI.

  11. PHP + Zend Framework by Anonymous Coward · · Score: 0

    http://framework.zend.com/ end of story.

    -mb

    1. Re:PHP + Zend Framework by AaronCampbell · · Score: 1

      I recently started using Zend Framework as well. It's a little new, 1.0.1, but it's pretty robust and mature for a 1.0 release. It's really well thought out, development is happening quickly, and it's got power behind it (Zend...well...they know PHP). Also, the license is great, BSD (All contributers have to submit an CLA, etc.).

  12. Focus.. by August+Lilleaas · · Score: 3, Interesting

    May I remind you all of this:

    http://www.flickr.com/photos/planetargon/1279842 54/

    Yes, that's the creator of RoR talking about what he feels about other people not liking his framework. RoR is all about pretty code, if you don't like RoR, use something else.

    So, that sorted that out. Now, troll!

    1. Re:Focus.. by August+Lilleaas · · Score: 1

      My link..

      • wasn't linked properly
      • has a space in it

      I'm used to neat 2.0 comment interfaces with 'edit' buttons!

      http://www.flickr.com/photos/planetargon/127984254 /

    2. Re:Focus.. by JAlexoi · · Score: 1

      If he and RoR disciples wouldn't slam Java so hard maybe I would take his slide seriously.
      And BTW reminding you that RoR targets Java people more than PHP.

      I like Ruby and I like RoR, but I am a Java person(J in JAlexoid stands for Java).
      Oh and BTW thanks for the link, and if someone out of RoR camp slams Java for no reason, I'll jus redirect them there.

  13. What is all that nonesnse? by Anonymous Coward · · Score: 0

    I use HTML(TM).

  14. Django by son+of+a+submariner · · Score: 2, Informative

    Django anyone ?

    --
    Son of a submariner ! They'll pay for this...
    1. Re:Django by Gordonjcp · · Score: 1

      Seconded.

    2. Re:Django by jnnnnn · · Score: 1

      I'm involved in a final year undergraduate software engineering project at the moment, to develop a CMS. We looked at Django as well as many others, and finally chose Pylons.

      Django is great if all you care about is content; if you want to develop something more flexible, I think Pylons is the way to go as it is far more customizable and powerful (although the two projects are very similar).

      Of course, they're both quite young projects, with the associated instability of the APIs.

      The best thing about Pylons is that all they're trying to do is integrate (the best) components into one framework: SQLAlchemy, Mako templates, and so on... and you can switch between the competing components easily.

    3. Re:Django by VGPowerlord · · Score: 1

      I tried Django out just recently, and it failed to do what I needed it to. The FileField and ImageField types just don't have the features I'm looking for (for a file heavy site), and knowing next to zip about Python, I'm not about to try to "fix" it to do what I want.

      --
      GLaDOS for President 2016! "Well here we are again. It's always such a pleasure." -- GLaDOS, 2011
    4. Re:Django by gambolt · · Score: 1

      and knowing next to zip about Python Python is absurdly easy to figure out if you've got just a little bit of time. It's logically consistent and pretty much does everything the way you think it should.

      You might want to take a look at TurboGears:
      http://turbogears.org/
    5. Re:Django by daeg · · Score: 2, Informative

      And Django isn't limited to blogs, wikis, etc. I run a complete medical management (medical record, inventory, staff tracking, chart/lab tracking, third party medical equipment integration) on Django quite happily out of 20 (and growing) offices across the states.

      The only negative side is the lack of Python developers. I've found a handful around here (Tampa) but they seem to be a rarity. I can find a few Ruby developers, but their extent of Ruby is only RoR tutorials, it seems.

    6. Re:Django by Max+Romantschuk · · Score: 1

      The only negative side is the lack of Python developers.
      I've always found this hard to understand. As both a programmer and a human in general I've always tried to learn new languages. My Swedish, Finnish, and English are on about equal terms. My French is pretty good, and I can manage in German and Norwegian if need be.

      Similarly, I try to learn programming languages just for the kick of it, if for nothing else to broaden my horizons. I can't understand why any programmer would want to code in just one language...
      --
      .: Max Romantschuk :: http://max.romantschuk.fi/
    7. Re:Django by daeg · · Score: 1

      It's two-fold. We have code in multiple languages, but the majority of our code is in Python. Thus I search for developers that know Python. I don't have to time or resources (small company) to spend training someone, nor do I have time to not only review every change (100% code review) and at the same time make changes to avoid Python-newbie pitfalls.

      On the other hand, developers in large organizations tend to get pushed into a single project where the code is in one language. Most universities favor one language over another, whether it's C++, Java, or .NET.

      I got pulled into Python the way that you mentioned. I am continually teaching myself new languages. Even though I'm not an expert in them all, I can take what I learn from one and apply it to another.

      My frequent calls for Python developers usually end up with 90% "PHP Developers" whose "Enterprise" experience constitutes a company newsletter that calls mail() on a database of 10,000 e-mail addresses.

    8. Re:Django by Anonymous Coward · · Score: 0

      How much are you paying? I'm in the area, but I'm not cheap ;p

    9. Re:Django by daeg · · Score: 1

      Yeah that's the other problem. We're not the only company in the area looking for Python devs. =) PT or FT / contract possible options if you're after extra cash. pytechd [a/t] gmail.com or the address in my profile. It's always nice to find local developers even if they don't end up working for you =) I'll be at the Python meetup on Wednesday as well.

    10. Re:Django by inKubus · · Score: 1

      You'll see a "Welcome to Django" page, in pleasant, light-blue pastel. It worked!

      Is this the line you're talking about?

      --
      Cool! Amazing Toys.
    11. Re:Django by An+ominous+Cow+art · · Score: 1

      Hmm, 1,200 miles north doesn't qualify as "local", does it? :-)

    12. Re:Django by daeg · · Score: 1

      Heh, no. Then again it did say 'in the area'. But we're not looking for cow artists. We're in the weight loss 'biz but we don't exactly make art out of 'em. :-)

    13. Re:Django by KevinIsOwn · · Score: 1

      You don't have the time to spend training someone? Python is so ridiculously easy to learn that anyone who can code worth a damn can learn it. I am on a co-op where they had said I would be doing C/C++ and I ended up switching to Python about half way through- I had never used Python before and didn't even realize going in that I would be doing Python. The language is pretty intuitive and easy to learn quickly. After about a week I felt pretty comfortable in Python and familiar with a good portion of the documentation- including its integration with C/C++. Maybe after undergrad I'll just move down to Tampa... Rochester is too damn cold anyway.

  15. Easy by OriginalArlen · · Score: 4, Informative

    PHP5 Vs. CakePHP Vs. RubyOnRails? Easy - mod_perl.
    --

    Everything I needed to know about life, I learnt from Blake's Seven
    1. Re:Easy by adamkennedy · · Score: 1

      Or Catalyst on adaptable drivers (cgi for devel, mod_perl, fast_cgi, cluster for production)...

    2. Re:Easy by kuzb · · Score: 1

      OK, I'll bite, even though this is an obvious trolling. Which MVC framework for perl would you suggest?

      It's rough being pushed out of the web market by other langauges, but try not to take it too hard. There are plenty of other good uses for perl.

      --
      BeauHD. Worst editor since kdawson.
    3. Re:Easy by Llarian · · Score: 2, Informative

      http://www.catalystframework.org/

      Catalyst is mature, activly supported, and being used in a lot of locations. (Sixapart's Vox being the largest example)

      So, no, we haven't been pushed out of the web market by other lauguages. Thanks for asking. =)

      (There's Jifty too, but I have no person experience with it)

    4. Re:Easy by kuzb · · Score: 1

      So, no, we haven't been pushed out of the web market by other lauguages. Thanks for asking. =)

      By "being pushed", I meant this was still in the process of happening, and from what I've seen it's not without some evidence. Please don't take this as a flame, or as me putting Perl down. I think it's a great language and is not in danger of dying any time soon. I'm just not so sure about Perl on the web.

      The charts here, if they are to be believed, suggest that there may be a downward/stunting trend in Perl's popularity. When you take in to account something like PHP is almost always associated with web development, and Perl is only asometimes associated with that, then the numbers may have a much wider gap than anticipated when talking about web related language popularity. Also, ruby is showing a healthy upward trend. For the moment, most people think rails when they hear ruby. My guess would be that it's upward trend will continue (a 1% gain over a year isn't too shabby). My comment was not meant to be malicious, it's just what I see when I talk to people, and when I examine job offerings. I see tons more offers for PHP, Java and VB, than anything else.

      If you have any other statistical sources, that are contradictory, or have a better testing method, I'd like to see them.

      --
      BeauHD. Worst editor since kdawson.
    5. Re:Easy by yes+it+is · · Score: 1

      The difference is that PHP will eventually decline due to drowning in its own cruft. Perl doesn't have the same architectural problems, and so is well poised for a resurgance. Besides there's a ton of legacy and not-so-legacy code out there, it's just that people tend to keep quiet about it for some reason (maybe commercial in confidence?)

    6. Re:Easy by rhizome · · Score: 1

      The difference is that PHP will eventually decline due to drowning in its own cruft.

      I believe this to be true for RoR right now as well.

      --
      When I was a kid, we only had one Darth.
  16. Grails or Webwork by Anonymous Coward · · Score: 0
  17. Django by Max+Romantschuk · · Score: 5, Informative

    Given complete freedom, my choice is Django: http://www.djangoproject.com/

    Check out the tutorial, and you'll know why: http://www.djangoproject.com/documentation/tutoria l01/

    --
    .: Max Romantschuk :: http://max.romantschuk.fi/
  18. Wrong Criteria, Wrong Problem, Wrong Solution by jaaron · · Score: 5, Insightful

    What about the requirements of the, you know, actual website application?

    You've provided no information on the actual website that you intend to develop. That's the important part -- the features and functionality to the customers and end users.

    Instead of considering the features of the language and framework first, how about the features of the application? How many users? Who will be supporting it? What kind of server resources are available? Do you need internationalization? What's the roadmap for the site over the next 3 to 5 years? Maybee then you can map the features of the website to the features of the framework or language, such as the maturity of the libraries directly related to your webapp.

    But picking the implementation language independent of the functionality of the website is a classic sign of solving the wrong problem. I don't care what you program it in, if you're asking these questions first, you are programming it in the wrong language.

    --
    Who said Freedom was Fair?
    1. Re:Wrong Criteria, Wrong Problem, Wrong Solution by RAMMS+EIN · · Score: 1

      I agree with you that the requirements of your application are very important to consider, but I do think the original poster's question can be answered based on the information he gave. Programming languages have strengths and limitations that apply no matter what project you are working on. Perhaps that is exactly what the poster is after: knowing what language/framework combination would be the best investment, not for a specific project with specific requirements, but in general. And there, I can say Ruby is the better language. You can adapt it to what you happen to be doing much better than PHP. And in the long run, that is going to be a win for you, because requirements will change, and you will end up developing new functionality, rather than gluing together things that others have already built.

      --
      Please correct me if I got my facts wrong.
  19. Tapestry by Anonymous Coward · · Score: 4, Insightful

    Or another Java framework, due to the maturity, scalability, availability of libraries, and number of people who know it.

    Rails just does not have a stable server. Webrick + fastCGI, or Mongrel, they both crash regularly for us. Also I've had to maintain several Rails apps written by others, and it sucks. All those neat tricks that makes it "productive" for the first programmer makes it difficult to understand and maintain for everyone else.

    1. Re:Tapestry by Anonymous Coward · · Score: 0

      I might use Tapestry more if the creator documented it better and stopped changing it so radically every few months.

    2. Re:Tapestry by whatever3003 · · Score: 2, Interesting

      dear god no. Tapestry is a pile of poo and should be skirted if ever come upon.

      I work day in and day out with this spectacularly under-documented, over engineered, verbose, often incomprehensible, brittle framework. While it is possible to do most web development you can think of in it, and it does go to great lengths to provide elaborate abstractions for the mundane tasks of forms, validation, widgets (components), parameter passing and so forth, these abstractions are often leaky and not at all extensible. This is a framework for Java enthusiasts only.

      My biggest gripe is that it is ugly ugly ugly. From the sparse documentation, to the vague naming conventions, to the horrific url's that are generated, it's even an embarrassment to have it staining my resume.

      Take a dip in the Django pool and then compare the two. Django will redefine any web developers ideas on how things should be done and how well they can be done.

      www.djangoproject.com

      --
      "Those who do not want to imitate anything, produce nothing." -- Salvador Dali
    3. Re:Tapestry by darken9999 · · Score: 1

      We have a production Mongrel server that runs just fine. In the three months that it's been running, I have never had it crash.

      And for what it's worth, there are two of us here working on it, yet it was developed by two other developers earlier this year. 5000 lines of code not including tests... It's just not that hard.

    4. Re:Tapestry by JeremyALogan · · Score: 1

      Rails just does not have a stable server.

      I wish someone would tell my Lighttpd and Apache servers that. They'd probably be really bummed to know that they aren't supposed to be hosting Rails apps.

      All those neat tricks that makes it "productive" for the first programmer makes it difficult to understand and maintain for everyone else.

      I suggest that the reason you had trouble supporting other people's code was that you didn't know the environment well enough. Rails is highly structured, so it's easy to figure it out once you know how it works.
    5. Re:Tapestry by JAlexoi · · Score: 1

      Yeah, Ruby has a problem that you can do 1 thing in 1000 different ways.
      I recently read how a guy proposed to make the nil object in Ruby something more than a nil object... Now that is horrifying maintainance HELL. Imagine if someone redefined + to mean - and - to mean + on an integer without telling you?
      ( http://coderoshi.blogspot.com/2007/08/cheap-tricks-v-pwning-nil.html )
      (For the PHP crowd nil is like undefined var)

  20. Python and Django by egrinake · · Score: 4, Informative

    How about using Python and Django? Python is a much cleaner language than both PHP and Ruby, and Django makes it a joy to build web-sites.

    I've been lead developer of a large enterprise system written in PHP for the last few years, and grown increasingly frustrated with just how ugly PHP is. Object-orientation has been tacked on as an after-thought (almost all of the API is procedural, without using exceptions for error-handling), the API is messy and inconsistent, it's somewhat inefficient (has to parse all the code for each request, unless you use an opcode cache), and the syntax is just plain ugly when compared to Python.

    Never tried Ruby on Rails, but you should at least give Django a spin before deciding.

    1. Re:Python and Django by August+Lilleaas · · Score: 3, Funny

      Python is a much cleaner language than both PHP and Ruby

      ...said egrinake, the God that Decides Which Language that Rocks More.

    2. Re:Python and Django by egrinake · · Score: 1

      Python is a much cleaner language than both PHP and Ruby
      ...said egrinake, the God that Decides Which Language that Rocks More.

      I know I'm not supposed to feed the trolls, but at least syntax-wise (and the syntax is basically the language) I'd say it is. I think you'd have a hard arguing that Python has noisier syntax than PHP at least (don't have alot of Ruby experience, but Python code seems easier to read).

    3. Re:Python and Django by macshit · · Score: 0, Flamebait

      Python is a much cleaner language than both PHP and Ruby
      ...said egrinake, the God that Decides Which Language that Rocks More.

      Seriously.

      I've seen a lot of people rag on PHP, but ruby is a fine language. Only a python fanboy would call python "much cleaner" than ruby (come to think of it though, one area where python does win big is in sheer quantity of fanboys... :-).
      --
      We live, as we dream -- alone....
    4. Re:Python and Django by August+Lilleaas · · Score: 1

      Yeah, I think we both agree that PHP is uglier than Python =)

      I've never written one line of Python, though, so I have no idea. And I was also being a troll-bitch, I guess you also know that one can't say that one language is prettier than the other (unless you're comparing with PHP, of course, harr harr), as it's pretty subjective!

    5. Re:Python and Django by ubernostrum · · Score: 2, Insightful

      Only a python fanboy would call python "much cleaner" than ruby (come to think of it though, one area where python does win big is in sheer quantity of fanboys...

      Yes, damn that Python. I mean, Ruby is so much cleaner. In Ruby, everything's an object! Wait, no, that's true in Python too. But in Python you have to prepend self to talk about an instance variable, that's ugly! Oh, wait, Ruby uses @ and has self for some cases, too. Hm. Well, Ruby's got all that metaprogramming goodness, surely you can't do that in Python! Er, no, forgot about __metaclass__ (which, by the way, doesn't have an equivalent in Ruby -- you have to monkeypatch the class object after it's created), never mind on that one.

      Etc., and so forth. Only a "fanboy" would proclaim one language or the other as being inherently superior; in the long run, the biggest difference between the two is idioms (the languages themselves are remarkably similar once you discount superficial syntax differences; see, for example, Python "fanboy" Alex Martelli explaining how Ruby and Python are far more similar than different). And in doing so you've tipped your hand.

    6. Re:Python and Django by macshit · · Score: 1

      Er, note that I made no attempt to claim the inverse to be true, I was simply decrying the original (silly) claim...

      --
      We live, as we dream -- alone....
    7. Re:Python and Django by Anonymous Coward · · Score: 1, Insightful

      (and the syntax is basically the language)

      ROFLMAO
    8. Re:Python and Django by mosch · · Score: 1

      Python is a much cleaner language than both PHP and Ruby

      PHP is a steaming pile of shit, but Ruby is a fine language for clarity. There's a pretty good comparison (written by a Python programmer) here.

      As somebody with a fair pile of Ruby code, I'd say the weakness is not in the language itself (which is excellent) but in the run-time.

    9. Re:Python and Django by Anonymous Coward · · Score: 0

      Your fatal error is that you are arguing with a fanboy.

      Fanboys may know a lot of things, but their inherent biases render them socially uselesss.

    10. Re:Python and Django by Richthofen80 · · Score: 2, Interesting

      almost all of the API is procedural,

      You're right, but is this necessarily a bad thing?

      The web itself is procedural. Unless you're a sadist, web applications are broken out into different URIs that handle different part of the applications. Administration functions might be in myapp/admin ... and I break up each edit/add/delete into its own .php file. This way, it is inherently clear what the purpose of each file/URI is, and the functionality doesn't bleed over into 50+ deep include'd files so you have to search forever to find what you need. Especially if you're a small staff with a big project, I find that encapsulating the code for the specific job ends up being procedural on the web. The web is stateless so even if you have time to populate some decently complex object, you have to manually persist the object through later requests.

      The only time I've found the web not-so-procedural is with shopping carts. Carts tend to be the kind of thing where an object makes sense $Cart->AddItemToCart(productID); makes sense to me. But on the other types of pages, like web reports, login screens, administration screens, etc? that stuff seems to be a simple branch: if POST, update database fields that map to form fields. If not, show database fields in form fields.

      --
      Reason, free market capitalism, and individualism
    11. Re:Python and Django by Anonymous Coward · · Score: 0

      > one area where python does win big is in sheer quantity of fanboys

      Sincerely you must be kidding. The degree of hype to come out of the Rails camp is no less than messianic.

    12. Re:Python and Django by nuzak · · Score: 2, Interesting

      The web itself is procedural. Unless you're a sadist, web applications are broken out into different URIs that handle different part of the applications.

      Sounds functional to me. Throw the inherent statelessness of the protocol on top for a bonus.

      --
      Done with slashdot, done with nerds, getting a life.
  21. PHP5 by mrjb · · Score: 2, Funny

    ... because I know it and I know it does the job. Also saves me the work of figuring out what CakePHP and RoR is.

    --
    Visit http://ringbreak.dnd.utwente.nl/~mrjb/growingbettersoftware to download your free copy of the book
  22. In other words... by jaaron · · Score: 4, Insightful

    I've never used Ruby or RoR... my experience with PHP is limited as well...

    In other words, you were trolling. :-)

    Having done websites in PHP, Rails, Python and Java, I can say that they all suck one way or another. Ruby and Rails are both very different from PHP and my personal unconfirmed suspicion is that a lot of the Rails problems people have are from programmers who jump over into Rails without first learning what they're getting themselves into. Deploying Rails can be very difficult and you can face a lot of issues that you would never face for PHP.

    Personally, I prefer Python or Ruby over PHP any day.

    --
    Who said Freedom was Fair?
    1. Re:In other words... by dedazo · · Score: 4, Informative

      In other words, you were trolling.

      Nope. I know enough about high-scaling distributed applications to be dangerous, since that's what I do for a living. I know PHP runs sites like Wikipedia and Digg, among others. I know I've never seen a blogger go on record to complain about PHP not scaling as he expected, while for RoR that sort of thing seemed quite common in the last year and a half or so.

      Yes, your execution can suck and so it won't really matter what language or stack you use. But the impression I have of RoR is that it falls apart a lot faster than PHP under comparable loads. Maybe the crappy internal design PHP suffers from might be an advantage in this case, because Ruby is designed better but it seems to suffer from classic bottom-heavy OO problems you see in other languages.

      Ultimately the person who submitted this might be building an accounts receivable app at a little company that gets three hundred hits per day, so it won't really matter if he writes it with Ruby, PHP or Malbolge.

      --
      Web2.0: I love when people Flickr my cuil and digg my boingboing until my google is reddit and I start to yahoo
    2. Re:In other words... by SQL+Error · · Score: 2, Interesting

      Nope. I know enough about high-scaling distributed applications to be dangerous, since that's what I do for a living. I know PHP runs sites like Wikipedia and Digg, among others. I know I've never seen a blogger go on record to complain about PHP not scaling as he expected, while for RoR that sort of thing seemed quite common in the last year and a half or so.
      PHP doesn't scale at all. It's a shared-nothing system, so whatever scaling issues you run into are, by definition, nothing to do with PHP itself; they're Apache issues or Linux issues or MySQL issues.

      I use CherryPy, which can be run as a shared-nothing system under Apache or as a standalone multi-threaded server. I haven't used Rails, but I believe it offers the same choice. If so, people running into Rails scaling problems simply weren't using it appropriately.
    3. Re:In other words... by Da+Fokka · · Score: 1

      Deploying Rails can be very difficult and you can face a lot of issues that you would never face for PHP.


      Would you like to elaborate a bit on that? I know a bit about PHP but I have no experience with Ruby on Rails and I'm kinda curious what these issues would be.

    4. Re:In other words... by bjourne · · Score: 1

      Deploying Rails can be very difficult and you can face a lot of issues that you would never face for PHP.

      Would you like to elaborate a bit on that? I know a bit about PHP but I have no experience with Ruby on Rails and I'm kinda curious what these issues would be.


      Your Ruby programmer who coded the site quits and/or your website hits a serious problem in the Ruby on Rails you have no idea to fix. Ruby programmers doesn't exactly grow on trees although those that exist are almost without exception extremely talented. A PHP programmer quitting is annoying, a Ruby programmer quitting is a major disaster.

    5. Re:In other words... by Da+Fokka · · Score: 1

      Be that as it may, the problem you're describing is not a problem of the technology, but of the currently limited userbase. GGP seemed to be describing problems pertaining the technical and architectural nature of Ruby on Rails.

    6. Re:In other words... by y86 · · Score: 0

      You can build a database driven blog site in 15 minutes in rails.

      http://http//www.rubyonrails.org/screencasts/

      I guess you can say that you'll run into "problems" with rails if people don't know what they're doing. Thats the same for any projects in any language however.

      Rails != PHP anyways, Ruby could be compared to PHP but Rails is an entire web platform (server and all!) similar to J2EE. So really your better to compare rails to J2EE or a PHP web platform like errrrrrr.... Joomla?

    7. Re:In other words... by Da+Fokka · · Score: 1

      Thanks for the link. But I've already seen it and I've seen many like it. Although I don't like the language (but that's personal, I prefer C/Java type syntax) to me RoR seems extremely elegant and productive. But the reason I was asking the GGP about the specific problems he was talking about is because I keep on reading blogs about the way RoR does not scale at all. I can only consider RoR as a serious option, IF it is possible to scale RoR applications well without losing the benefits which are all touted so enthusiastically by the RoR zealots. I want to know if the performance issues I hear so much about are because of the way RoR works, or because of the way RoR is used.

    8. Re:In other words... by Foofoobar · · Score: 5, Interesting
      I ran PHPulse, the world's fastest MVC framework for PHP with a 10 terabyte database backend gets millions of hits daily and having to send data to our team in Manila and Tijuana. PHPulse gave us near split second page loads. As for not scaling, tell that to all the companies like Disney, IBM, AT&T, MTV and others who use it on their frontend. It's the most widely deployed web language out there and there is example after example after example of it scaling.

      Hell, even the Ruby, and Ruby on Rails site http://shiflett.org/blog/2006/feb/php-easter-eggs> need PHP in order to scale

      --
      This is my sig. There are many like it but this one is mine.
    9. Re:In other words... by perlchild · · Score: 1

      I second the "use appropriately" post. There's several choices of front-ends for a ruby environment(lighttpd, mongrel, apache) with a choice of connecting as a module or through a proxy(closer to ajpv1 for java, I believe). The performance characteristics vary widely.

    10. Re:In other words... by tbannist · · Score: 1

      The issue seems to me that it is very easy to build a web site with Ruby on Rails, but when you want to go beyond what they specifically designed RoR to do you cross over into hell. I've heard of some attempts to build a web site with RoR where the expedient way to extend the functionality of the site was to start over in PHP.

      --
      Fanatically anti-fanatical
    11. Re:In other words... by JoeCommodore · · Score: 1

      Your Ruby programmer who coded the site quits and/or your website hits a serious problem in the Ruby on Rails you have no idea to fix. Ruby programmers doesn't exactly grow on trees although those that exist are almost without exception extremely talented. A PHP programmer quitting is annoying, a Ruby programmer quitting is a major disaster.

      Heh, I get the same thing when I talk about coding stuff in PHP though these people switch Ruby with PHP and PHP with some other not as flexible but popular platform (usually MS Access).

      So as I think your statement is just a rubber-stamp ignorant cop out - if you need to learn it you probably can. Now what would be a good case is more a comparison of capabilities or ease of learning the syntax. I chose PHP not only for it's flexibility but also for the readable syntax it has.

      --
      "Enjoy what you're doing! If it becomes drudgery, you're doing it wrong!" - Jim Butterfield
    12. Re:In other words... by bjourne · · Score: 1

      So as I think your statement is just a rubber-stamp ignorant cop out - if you need to learn it you probably can. Now what would be a good case is more a comparison of capabilities or ease of learning the syntax. I chose PHP not only for it's flexibility but also for the readable syntax it has.

      No really, it is not. A good techie can easily write scalable Ruby on Rails apps and it is simple to write readable and maintainable PHP code. But trying to convince your collegues who neither likes you nor your new-fangled ideas is impossible. Yes, it is politics at its worst but it is also reality, technology is easy to change, people are not.

    13. Re:In other words... by scotch · · Score: 1

      Although I don't like [ ruby syntax ] (but that's personal, I prefer C/Java type syntax)

      From this we can deduce that you like semicolons and braces? non optional parens?

      --
      XML causes global warming.
    14. Re:In other words... by outsider007 · · Score: 1

      Yes but if you manage to replace him the new programmer will have an easier time jumping into the RoR project than the spaghetti that is PHP.

      --
      If you mod me down the terrorists will have won
    15. Re:In other words... by Anonymous Coward · · Score: 1, Informative

      > PHP doesn't scale at all. It's a shared-nothing system

      It's true that PHP doesn't scale for shit (Wikipedia solves the problem through sheer brute force that costs no small amount of $$$). But shared-nothing isn't the reason for that. Shared-nothing in fact scales better than anything else, since there is no contention and no deadlock, not even temporary. Takes a lot more resources at first, but it scales out better in the long run.

      Amazon runs largely on message-passing service interfaces, for starters.

    16. Re:In other words... by Sancho · · Score: 1

      The biggest problem is not the front end, but the back. When I last looked at RoR, it simply couldn't talk to multiple databases. This means that, as sites get larger, you need more and more database power, but you're going to be limited to a single machine.

      http://www.jonathanboutelle.com/mt/archives/2007/04/scaling_rails_t.html has more information.

      That article also discusses an extension that handles multiple databases, but I have no idea how well it works.

    17. Re:In other words... by nuzak · · Score: 2, Informative

      I think the only languages you can really call "shared-nothing" would be ones like Erlang or Occam -- otherwise, it's an attribute of an architecture, not a language. PHP has built-in support for sessions, which have a larger scope than the interpreter itself. That's shared-something all right, and it kills scalability real good if you don't invent your own session management stuff on top of PHP's built in nonsense.

      I hate PHP with the power of a thousand suns, but scalability isn't one of the reasons. It's just a not very good language (to put my opinion mildly) but it has the library support for enough things from memcached to mqseries in order to build decent and very scalable architectures on. The execution speed of the language is usually adequate, at least for most apps that fit in its domain. It's other pieces of an out of the box LAMP architecture that usually fail: running apache in prefork mode is, for example, not one of the wiser scaling decisions to make.

      --
      Done with slashdot, done with nerds, getting a life.
    18. Re:In other words... by booch · · Score: 1

      The main things is that PHP comes standard on pretty much any web host and GNU/Linux distro you can find. Ruby on Rails can take some effort to install. Even after that, getting code from a workstation to the server can take some effort. Of course, I've run into similar problems with PHP. (Like a host that only supports FTP uploads, when I'm using Subversion. Or a library I need, but the host won't install it.) And the main reason for the deployment issue is that Rails encourages you to develop on your own system instead of on the server itself, which many PHP developers do.

      That said, deploying a Rails app isn't all that difficult. I was able to walk a customer through setting up a full Rails environment on a FreeBSD system. (Without any sort of FreeBSD-specific HOWTO.) There are also several Rails "stacks" available now, that come with everything you need built in. Some are VM images, others are sets of packages.

      The other thing that makes deploying Rails apps easier is Capistrano. It has a bit of a learning curve, but once you've learned it, it makes deploying a Rails app easier every time, to the point of being almost completely automated.

      --
      Software sucks. Open Source sucks less.
    19. Re:In other words... by Anonymous Coward · · Score: 0

      If you read what he said, he's saying PHP won't ever give you a problem with scaling. Any issues you see are possibly with MySQL among other things. You're arguing with the wind.

    20. Re:In other words... by Pollardito · · Score: 1

      Hell, even the Ruby, and Ruby on Rails site http://shiflett.org/blog/2006/feb/php-easter-eggs> need PHP in order to scale

      if you follow that link you'll see that the "is this site using PHP?" test fails on the Ruby On Rails website now, so apparently they're not using PHP anymore
    21. Re:In other words... by DerekJ212 · · Score: 0

      IAARoRP and I was amazed how difficult it was on both shared environments (in my experience Dreamhost, and they even support it!) as well as private servers to just get your app up and running the first time. Sure, once you figure out how to do it on a system once, you can repeat it many times, but it took hours of my time and my hosts time to set up a rather basic RoR app using a mongrel_rails cluster. Once up, however, speed is good and I go back to loving Ruby on Rails. I feel this is just a problem of immaturity. The available servers for RoR have increased dramatically over just the last year. If you ever are using RoR and have any problems, its almost certain the nice guys over at #rubyonrails on freenode.net can help you out/fix your problem.

    22. Re:In other words... by DerekJ212 · · Score: 0

      In my experience, the key to scaling RoR application is adequate power. Trying to deploy something on a shared host like many beginners would like to do (and is easy in PHP) results in extremely high page load times. If you have a dedicated DB server, speeds increase tenfold. The current best-practice scaling method now (I believe) is the mongrel_rails cluster. I have 2 sites running with 5 servers each and they run well. I could not have said the same a year ago, however, so its important to realize everything about Ruby on Rails is changing and that what you heard a year ago may or most likely may not apply today.

    23. Re:In other words... by Da+Fokka · · Score: 1

      But how would the same site running on PHP run? Dedicated servers aren't free. Right now, I'm running a site with 10.000+ unique visitors per day and it runs fine on a single dedicated server. RoR is nice technology but if I'd need 5 servers + rackspace + etc for the same site it would be prohibitively expensive.

    24. Re:In other words... by zobier · · Score: 1

      Hell, even the Ruby, and Ruby on Rails site http://shiflett.org/blog/2006/feb/php-easter-eggs> need PHP in order to scale

      if you follow that link you'll see that the "is this site using PHP?" test fails on the Ruby On Rails website now, so apparently they're not using PHP anymore Or they just set expose_php=off in their environment.
      --
      Me lost me cookie at the disco.
    25. Re:In other words... by Foofoobar · · Score: 1

      no they just turned expose_php to off. All of them use PHP to scale. Even 43things has to use PHP to scale. That's the big complaint about RUBY is that it can't scale and has to again lean on PHP in order to do that.

      --
      This is my sig. There are many like it but this one is mine.
  23. Have your cake/php/rails and eat it to by jalmond · · Score: 4, Insightful

    What we have here is another usual question that all really depends on your project type. That being said, I'll try to break from the typical, slashdot format and attempt to address your question:

    1. Maturity of Solution: 1st PHP5, then Ruby, then Cake. Shouldn't be a lot of controversy here. PHP has been around since the dinosaur age, ruby came around with all that slick don't repeate yourself talk and then cake came about and tried to add ruby like framework to PHP.
    2. Features is really going to depend on what your looking for. Rails allows you to write a lot of fairly complex stuff quickly, cake arguably has better built in security, PHP5 will scale better then any of them.
    3. Everybody and their mama knows php5, any new kid thats worth a darn is probably learning rails, and then there's cake, which has nowhere near the dev support of the other two.
    4. Rails wins here if your starting from scratch, but since so many devs already have php experience, complexity becomes sort of relative.
    5. For better or worse, if you were to poll most devs that are building commercial production apps (at least out of the three options mentioned) php5 is going to win hands down. For my company it was a simple decision that hinges on two of the points: scaling and experience. We wanted something to scale to slashdot numbers, while being able to hire a bunch of kids from college to help the dev team build it all. Typical of online startups, we wanted the most bang for the bucks, and php5 was the choice.

    P.S. A similar question of Rails vs PHP vs Java question was somewhat subjectively discussed late last year http://www.cmswire.com/cms/industry-news/php-vs-ja va-vs-ruby-000887.php

    --
    Travature.com: Hello...World
    1. Re:Have your cake/php/rails and eat it to by Raphael+Emportu · · Score: 1

      I think that a lot has been said about this subject and most people are more or less right from their point of view. What I miss in the discussion is support from ISP's. And when it comes to this I think PHP has the better options. It's widely supported by most ISP's and available on all platforms whereas my second runner up Perl usually is confined to linux hosting although there is no real reason for that. Java? Man, don't start me of on that one. Nice idea but beside's interpreter problems it's way to slow. Ruby? Up till now not interesting enough what I hear from it to investigate further. Probably one of those nice confusing geek things :-) No. straight forward and controlable. PHP rulez.

  24. Re:with MySQL, eh... so much for having a choice by Baddas · · Score: 1

    Amen. Postgres's row-level locking and schema transactions alone make it far superior, I think.

  25. Snakes and Rubies by hitchhacker · · Score: 2, Informative


    There was a good video, although outdated (2005), that had two of the main developers of Django and RoR. The video is quite long (3hrs), so I'll link to the Google Video Search. The second and third are each person's presentation, and the fourth, which I recommend, is a Q/A session.

    -metric

  26. Re:the answer: it depends by Bluesman · · Score: 2, Insightful

    "but in reality, how often over the lifetime of your website will you migrate to a different database?"

    If you told me I could pick either the database to use or the scripting language to code in, I'd pick Postgresql and let you pick the language. Most of the things people try to do in scripting languages can be handled in the database much more elegantly and scalably. Of course, most people don't realize this because they've only used MySQL and don't realize how much it's missing.

    If you told me I could pick both, I'd go with Perl, unless I were doing something very simple that's been done a thousand times before.

    PHP is decent enough for what it is. Historically there have been security problems with it, and the design is crappy. But it's quick and easy.

    I've never used Rails, but it sounds like it does a lot for you. In my experience, that can be a blessing if you're doing something textbook. If not, have fun fighting with the assumptions other people made.

    --
    If moderation could change anything, it would be illegal.
  27. Symfony by demon-cw · · Score: 1

    have you considered symfony? I've done a few sites for customers using it and it's great!!

    1. Re:Symfony by pyropunk51 · · Score: 1

      symfony rocks! Doing my first PHP project right now and using symfony saved a sh.tload of work.

      --
      double penetration; //ouch
    2. Re:Symfony by hagnat · · Score: 1

      i have been using Symfony for the past 6 months to develop this huge project at work. Frankly, it's awesome and frustrating at the same time

      it's a great framework, in only a few minutes i managed to create an almost complete backend application, and once you get used to the whole structure of the framework you can easily code stuff. It has support for scripaculous, ajax is just a line of code away, it has object orientation, you can easily re-route your pages in many ways you wish, you don't have to write a single line of PHP code to create a simple database layer, and you can easily expand it at will.

      but once you get to complex stuff things start to get frustrating. The "Definitive Guide to Symfony" it's not nearly close to definitive, there is tons of stuff missing in there that you have to look in foruns, articles and blogs (i already had to seek for answers in sites in spanish, french and japanese). AJAX is the most simple stuff to do, but try to make a simple 'select something from table where foo = bar or move = zig', the documentation tells you to use OR one way, but you have to make a whole workaround for it. This is not a concern for me, i can easily find the answers in google, but it's been a hard deal for some of my inexperienced co-workers...

      We already reached a conclusion that Symfony is like Linux: It's perfect! it's awesome! it has a great community of experienced users, but when it crashes, you better get out of the way, because only an expert will find out how to fix it.

      --
      "life is a joke, and someone is laughing at me"
    3. Re:Symfony by Anonymous Coward · · Score: 0

      Symfony is absolutely great -- it blows Cake away.

      It *is* a deep framework, and there are many things to learn. Fortunately, it is a highly-consistent code base, and the design is clear and well-documented. There are some things that are missing from the docs, but Symfony has -- by far -- the most thorough documentation from the PHP side of frameworks.

      That and its diagnostic tools are really, *really* wonderful.

      And, while Ruby itself is a good language (much nicer to read and develop in than PHP), I'm inclined towards the disposition that it's just not yet "ready" (performance & scalability wise).

      Plus, as a matter of personal opinion, Symfony (and Django) have a leg-up on project organization, as they allow for multiple applications within a project... I've inherited a number of Rails websites from external vendors, and they are organizational train wrecks, with code intended for admin functionality sprinkled in amongst code and templates from the front-end bits.

      Anyhow, largely anecdotal, and I've said perhaps more than I had originally intended to about RoR, but my main goal here was to urge you away from Cake and toward Symfony. One recommendation I would make is to use sfDoctrine ORM plugin solution, rather than Propel (which ships as the default ORM solutions with 1.0), because sfDoctrine is faster (uses PHP 5's PDO), and will replace Propel as of the 1.1 release.

    4. Re:Symfony by m0n5t3r · · Score: 1

      Symfony is cool.

      Until you'll need to use something other than MySQL (you'll find that Propel won't use the Postgresql serial type, for instance).

      Or need to, say, get some authors with their books/posts/whatever in a decent way (single query?) and find after some googling that Propel didn't implement it on purpose, because of dubious philosophical reasons, so you'll need to implement it yourself and copy & paste the code in the rest of the peer classes where you need it because there's no decent way of extending BasePeer and have changes propagate in your peer classes.

      Or want to add logging or some other processing to a bunch of models' save method (done so ellegantly using decorators in Python) and find yourself doing the same copy and paste stunt, because, of course, you can't extend BaseObject and have your models inherit it.

      Or have been happily developing on a "stable, enterprise-ready" version for 2 months and then one day find that it has been discontinued after about 3 months of life, documentation has vanished from the website, tag has vanished from SVN (not directly retrievable, that is), and the only information you can find is "upgrade, 1.0 is the stable one now, 0.6.3 never existed"; and, of course, they are not compatible and you spend a few hours hunting conversion bugs.

      I'm getting too old for this, so I moved the app to Django.

      However, for a new app that needs to also scale in human resources, PHP may still the best choice; if finding competent PHP people is hard, try finding web-savy Python or Perl hackers ;). Apart from CakePHP (which seems to make you work even more than Symfony, and uses ActiveRecord, which isn't exactly powerful), you could also try the Zend Framework. I'm currently investigating it for a freelance project and I like what I see :)

  28. Php does no have a good ide by Anonymous Coward · · Score: 0

    php does no have a good ide, ruby on rails has netbeans.

    1. Re:Php does no have a good ide by Dragonslicer · · Score: 1

      php does no have a good ide, ruby on rails has netbeans. Zend's IDE is good. I use it at work, but I'm not sure if there's a free version.

      I believe there's a PHP plugin for Visual Studio, which of course isn't free.

      I haven't used it, but KDevelop's site says that it supports PHP.
    2. Re:Php does no have a good ide by Sabathius · · Score: 1

      I've been using Komodo for years (PHP, Python). It is not free, but definitely worth the money.

    3. Re:Php does no have a good ide by Anonymous Coward · · Score: 0

      php does no have a good ide, ruby on rails has netbeans.


      Have you not heard of Eclipse...you can set it up for PHP, Ruby and Java.

    4. Re:Php does no have a good ide by ericlondaits · · Score: 1

      ActiveState Komodo IDE is very good... and not expensive. It supports PHP, Python, JScript, Ruby, TCL, PERL, and many popular frameworks and APIs.

      I find that many PHP developers don't use a debug tool (which Komodo includes), which is a disastrous way to develop.

      --
      As a Slashdot discussion grows longer, the probability of an analogy involving cars approaches one.
  29. Re:Django - Thirdeded by Anonymous Coward · · Score: 0

    Thirdeded or second second.

  30. CakePHP vs PHP5? This makes no fucking sense. by l-ascorbic · · Score: 1

    CakePHP vs PHP5? Do they think that PHP5 is a framework? Has the name not tipped them off that CakePHP is written in PHP? How can you have PHP vs. "thing written in PHP"?

    1. Re:CakePHP vs PHP5? This makes no fucking sense. by VirusEqualsVeryYes · · Score: 1

      CakePHP vs PHP5? Do they think that PHP5 is a framework?
      No. We're not comparing frameworks, we're comparing tools to create websites. You might use a scripting language, or you might use a framework, or you might even use a framework written with said scripting language. One might have preferences according to complexity, prior experience of developers, size of dev community, flexibility, and other factors.

      I personally prefer PHP5 to Rails (I have no experience with CakePHP). The latter is great for complex data models and for lots of back-end computation and interaction, at least in the sense that I wouldn't have to code very much. Ultimately, However, I feel more in control with a scripting language than with dynamically created code. This probably has much to do with the fact that I have far more experience with PHP than with Rails, but then again, I'm a purist; I always prefer writing my own code to using someone else's.

      How can you have PHP vs. "thing written in PHP"?
      Have you ever compared programming in C to programming in Python? That's how.
    2. Re:CakePHP vs PHP5? This makes no fucking sense. by l-ascorbic · · Score: 1

      No. We're not comparing frameworks, we're comparing tools to create websites. And yet TFA is a comparison of frameworks.
      I personally prefer PHP5 to Rails (I have no experience with CakePHP). The latter is great for complex data models and for lots of back-end computation and interaction, at least in the sense that I wouldn't have to code very much. Ultimately, However, I feel more in control with a scripting language than with dynamically created code. This probably has much to do with the fact that I have far more experience with PHP than with Rails, but then again, I'm a purist; I always prefer writing my own code to using someone else's.

      Have you ever compared programming in C to programming in Python? That's how. That would be a valid example if you wrote Python programs in C. The code that one write to create CakePHP sites is still PHP. Even the templates are PHP.
  31. Re:... Robots in disguise ... More than meets the by McFadden · · Score: 0, Redundant

    +1 Fucking Spot On

  32. So whatt? There's enough people who actually care by BibelBiber · · Score: 1

    As for myself it's not my homework it's my hobby and I care to read about why people think one is better than the other or what else could be thrown into the game. I think about learning Rails and Ruby so I found it quite interesting to be recommended Python and Django as well. So shut up and let people post here. The intention of Ask Slashdot is obviously not only to answer some persons question but to post a question that might be relevant to many.

  33. Re:with MySQL, eh... so much for having a choice by greg1104 · · Score: 3, Interesting

    I recently finished a long comparison of PostgreSQL and MySQL in the context of mission-critical data that gives a lot more detail on the issues you bring up here.

  34. Re:Django - Fourthed by hpoul · · Score: 2, Informative

    imho django is really the easiest web framework to develop in.. It's ORM is flexible and powerful but compared to hibernate & co so much simpler that it is just shocking ..
    i have developed in perl, php, java (webwork with hibernate and IoC containers and what-not) but with django you can get things done much faster and get cleaner results..

    (and some self-advertising - look at my project http://sct.sphene.net/ - forum & wiki applications based on django)

    --
    Find me at http://herbert.poul.at
  35. Dive into Python by hitchhacker · · Score: 3, Informative


    Whether it's Ruby on Rails, or Django, most developers will have to learn a new language. Python has a book available online: Dive into Python. I found it very easy to switch from C/C++/PHP to python. Django does have a slight learning curve though. Oh, and be aware, the Django documentation online is for their SVN version! Most likely NOT your distro's version. They are still under heavy development.

    -metric

    1. Re:Dive into Python by ubernostrum · · Score: 3, Informative

      Oh, and be aware, the Django documentation online is for their SVN version!

      Well, you can start the tutorial here for the SVN version, or you can read the big warning at the top of the page which links to documentation for the various releases, and find:

      So long as you can read large text at the top of every page, and click clearly-offered links, you can read the documentation for dev version, or for any stable release we've ever done.

    2. Re:Dive into Python by hitchhacker · · Score: 1

      So long as you can read large text at the top of every page, and click clearly-offered links, you can read the documentation for dev version, or for any stable release we've ever done. My comment was a "be aware" one, and have you ever spent time in #django before? If you have, you will know how many people miss that "large text" at the top of every page... including myself when it came to newforms.

      -metric
    3. Re:Dive into Python by ubernostrum · · Score: 1

      have you ever spent time in #django before?

      Hi, I'm Django's release manager. I'm in the IRC channel pretty much 24/7, and I know precisely how many people don't read the warning about the tutorial versions.

    4. Re:Dive into Python by MindspanConsultants · · Score: 1

      Sorry, but that page is poorly designed from a user experience perspective. The green headline just doesn't grab your attention. The first thing you see on that page is 'Documentation'... some blah blah blah that I don't want to read and then 'The Django Book' followed by 'The essential documentation', which is exactly where I would click, with no thought as to the version.

  36. Plain old C by Anonymous Coward · · Score: 0

    You should use plain old C if you want performance.
    And you can easily read the HTTP headers with the gets() function - very fast and reliable.

    1. Re:Plain old C by deniable · · Score: 1

      gets is cool. It doesn't even need to be given a buffer size. fgets has to be told how big the buffer is. What's the point of that?

      (Actually, unless you wired the socket to stdin, how would you use gets?)

    2. Re:Plain old C by Anonymous Coward · · Score: 0

      > Actually, unless you wired the socket to stdin, how would you use gets?
      A typical web server will pass the data to the CGI program via the stdin.

    3. Re:Plain old C by deniable · · Score: 1

      D'oh, I figured when this guy was talking about using gets for the headers he was talking to the port directly. I forgot all about CGI.

    4. Re:Plain old C by Anonymous Coward · · Score: 0

      Yay! IIRC amazon runs on COAL = C/Oracle/Apache/Linux

    5. Re:Plain old C by Anonymous Coward · · Score: 0

      A typical web server will pass the data to the CGI program via the stdin.

      And the headers in environment variables. I'd like to see how you would use gets() to read those.
  37. Re:Do your own homework. by tieTYT · · Score: 1
    Nothing wrong with asking for the opinions of others, especially when you don't have time to try all the choices you're asking about. After years of programming, I've learned there are some details you don't consider as factors until you've used the language for a long time.

    Besides, if the comments on this article are good enough, it will become a great reference for people who ask this question in the future.

  38. It makes little sense to say Rails doesn't scale.. by patio11 · · Score: 4, Insightful

    ... when the complaint is similar to "PHP is a really cruddy language to write a graphics driver in". This is true -- using PHP to write a graphics driver is like attempting to change a car tire with a banana, but thats hardly a knock on PHP, its just a mostly banal comment on choosing the right tool for the job. What Rails excels in is choosing the right job for the tool -- given that you have Rails, you now know with pretty good certainty that you can bang out a CRUD site in your target vertical of choice on a very nice timescale while still being feature-rich. That is a really, really nice feature for a platform to have for small software houses.

    Granted, I wouldn't write Digg in it, but *I'll never write Digg in anything*. Neither will 99% of the world's programmers, and for the 1% that are making social networking sitse with desired user numbers the size of nation states, they have the LAMP stack and God bless them for it.

    As for me, I've got one quite profitable desktop application written in Java (folks laughed at me for that -- what can I say, it got the job done) and am having a bloody ball working on a small business vertical app which, at $15 / account / month and low predicted need for users to interact with the app, would replace my day job income at about three dynamic page hits per hour. I have this funny feeling that Rails will scale that far.

  39. If you've used Rails, then CakePHP /hurts/ by MBoffin · · Score: 3, Insightful

    Sorry, can't say much more than that. If you've never used Ruby on Rails, I'm sure CakePHP would be a joy to work in. However, if you've used Ruby on Rails, then CakePHP will hurt. The Ruby language is beautifully suited to this kind of framework, and PHP is not.

    This is not to knock CakePHP. In its own right, CakePHP is an excellent framework and a lot of quality work has gone into making it what it is. It's a powerful framework.

    The move to this kind of framework can be quite a mind job, whether you're moving to Rails or CakePHP. It requires breaking down very solid foundations of ideas that you've built up over the years on how to build a web application. If PHP is your thing, then weathering that mind job will be all the more easier if you're doing it in a language already familiar to you. But if you're willing to try something new, then it's worth making the jump to Ruby on Rails.

    1. Re:If you've used Rails, then CakePHP /hurts/ by rtconner · · Score: 1

      I will agree to this. As a regular and avid CakePHP use, the worst part about CakePHP is the "PHP" part. It is such an ugly language.

      PHP however does get stuff done. I think I've seen this quote on the internet somewhere.. "PHP is one ugly mother fucker who gets shit done right away"

      It just works, it just does stuff. Anything you want to do in PHP there is a library for it and someone who has done it before you. Many many people use it and the syntax is easy to learn. I hate PHP, but it does the job well. So I am rtconner and I use PHP and CakePHP.

      --
      023AD01("Child", "Evil");
  40. None by Anonymous Coward · · Score: 0

    I would choose to not start such a website with or for you.

    Your constraints on what to think about have you already treading down the path to failure.

    You should just hire a bunch of cheap webmonkeys to code up some php, get decent designer to make it look pretty and spend the rest of your time/cash on marketing and hype. Because your preconceptions make it unlikely you will be part of anything innovative and interesting.

    Sorry to be so harsh.

  41. PHP = Assembler of web dev compared to two by unity100 · · Score: 1

    PHP5 is assembler compared to the other two. and not even like assembler compared to c - php5 is actually a everyday usable 'assembler'.

    go pro. go php5.

  42. Django. by imbaczek · · Score: 2, Informative

    They all suck anyway, django IME sucks the least.

  43. Nriyh by Anonymous Coward · · Score: 2, Informative

    Well I guess it depends what you are building. Ruby on Rails is certainly a fun framework to work with. The trouble is Ruby itself is painfully slow (see http://shootout.alioth.debian.org/ for data on this) and doesn't get Unicode. So if you're site is going to do anything large or international it would be a poor choice. If not then RoR is a lot of fun - go for it.

    PHP. People do build large apps in PHP. Having used it quite a bit it remains a mystery to me a)how and b)why. Its ugly and handles state poorly - a disaster for a web language in my view.

    Alternatives. Both Java and ASP.NET make sense for large scale applications. Beyond that it depends a lot what you're doing. I would tend to plump for Java since I like being able to pick the right framework for the job I'm doing - so for instance if I'm building a high traffic web app I'd probably go for Struts, if I was building something that needed to be more desktop like I'd probably go for JSF with Seam, and if I was after lots of Ajax bells and whistles I'd probably add GWT into the mix. I also like the richness of the Java toolbox (being able to use JMS to talk to MQ for instance, applets on the client side for certain specific duties), and the Java tools (notably IDEA) are world beating.

    1. Re:Nriyh by Qbertino · · Score: 2, Insightful

      PHP. People do build large apps in PHP. Having used it quite a bit it remains a mystery to me a)how and b)why. Its ugly and handles state poorly - a disaster for a web language in my view.

      It's difficult to understand, since PHP combines the quirkyness of Perl with the syntactic bloat of Java and does have some other shortcommings. However, it handles all web stuff very gracefully. Tons of functions in PHP are built to handle the everyday shortcommings the WWW Inet-service brings along. And they are all come in the box without any classpath or you-need-this-seperate-servlet-running-to-handle-m e crap. Oneliners convert objects to HTML characters, walk arrays or connect to a database. The God-Datatype in PHP is the PHP Array - compareable to Pythons dictionary - and offers tons of functions to handle them and do neat stuff to arrays fast. Despite (or because?) some 300+ core functions it's extremely newbie friendly - no need to add any libs or stuff just to halfway deal with webstuff. There-is-more-than-one-way-to-do-it applies to PHP as much as it applies to Perl, without PHP bugging people with a to terse but arcane syntax.

      PHP is the king of all SSI solutions because it's built for exactly that sort of task and nothing else. That's why the most successfull, non-trivial web applications are built with it. It's the best tool for the job, plain and simple.

      --
      We suffer more in our imagination than in reality. - Seneca
  44. language, framework, framework by fozzmeister · · Score: 5, Informative

    PHP5 is a language, the other two are frameworks. So it can't really be compared. The Zend Framework is a very non-limiting non-rigid framework (it's much more like a bunch of really good libraries atm) which might make the comparison viable.

  45. Resistance is futile ? by Anonymous Coward · · Score: 0

    For me it has to be PHP5 and Postgresql.

    And of course my editor of choice is VI.

    But then I can code blindfolded....

    Depends what your coders can use though and unless you were to publish the full and detailed specs of your project so we can understand it's scope this entire exercise is a complete and utter waste of time....

  46. Uh .. if you're comparing frameworks by aderuwe · · Score: 2, Informative

    If you're mostly comparing frameworks anyway (CakePHP and RoR are frameworks, PHP5 is a language) just substitute symfony for PHP5, and the answer becomes clear: use symfony... The best of PHP5 with the best practices of RoR - just make sure to use an opcode cache because symfony is not the most light-weight.

    Scalable, and loads of fun to program with.

    1. Re:Uh .. if you're comparing frameworks by VGPowerlord · · Score: 1
      and for the lazy, the easiest way to install an opcode cache for PHP is

      pear install apc
      --
      GLaDOS for President 2016! "Well here we are again. It's always such a pleasure." -- GLaDOS, 2011
  47. Perl advocates should try CATALYST by jorgegv · · Score: 4, Informative

    I find it strange that nobody yet has given a reference to Catalyst, the best MVC framework for Perl. From people that have tried both (not me), it is said to be the equivalent of RoR for Perl. I can't back that because I'm a perl monk and I don't have time for yet another language (what for, when you have already tried the best language ? ;-)

    Application skeleton and database CRUD in 30 seconds (measured!!!). Try it.

    --
    Reality is a mass hallucination due to lack of alcohol in blood. - DeadLiver
    1. Re:Perl advocates should try CATALYST by Anonymous Coward · · Score: 0

      No, Jifty is the equivalent of Rails.

      Catalyst is the OPPOSITE of Rails.

      Catalyst is the MVC and HTTP-engine glue that binds ALL the Perl ORMs and ALL the templating systems together.

      Wanna use a mix of Template Toolkit and PHP templates (via PHP::Interpreter) with Amazon S3 and LDAP as your ORM? No problem!

      And pick your server model, dedicated server, CGI, FastCGI, mod_perl, mix and match as needed.

      Rails doesn't believe you'll need integration. Catalyst IS integration.

  48. Re:Perl by Drantin · · Score: 1

    Funny thing is, PHP was originally written in Perl as a framework...

    --
    Actio personalis moritur cum persona. (Dead men don't sue)
  49. Re:Do your own homework. by Anonymous Coward · · Score: 0

    Nothing wrong with asking for the opinions of others

    There is when the reason you are asking is so you don't actually have to learn what your teacher wants you to learn.

    Look, it's early September. Kids are just going back to school. This is obviously the first assignment for a class project. The submission is clearly just rewording the assignment, right down to the list of things he should include in his answer, no doubt copied straight from the blackboard. You can spot homework questions a mile off.

    This guy should be learning how to evaluate platforms on their merits, but instead he's trolling Slashdot for things to copy down. Don't you think he should be able to figure out how to pick a platform without resorting to doing whatever anonymous Internet denizens tell him to? This is the kid who will grow up to be the luser that hassles you with FAQs and demands code to copy & paste so he doesn't get fired, and you are enabling him.

  50. MySQL, dear god by cortana · · Score: 0, Troll

    OldJavaHack writes "If you could start a website (with MySQL for persistence) FAIL
  51. Generate everything on the fly by alexibu · · Score: 2, Interesting

    The paradigm of having web pages that you serve, and that are actually files on the server only works for a short time. Mixing any of these inline scripting languages into the HTML document stinks IMO.

    As soon as your website is a bit dynamic you are better off generating everything on the fly.
    You can describe content with databases and xml and CSS and then have your server generate actual pages from that.

    I personally use c++ cgi scripts to generate all pages, as I need to do some computationally expensive crunching as well. Why learn a dodgy scripting language when you know how to do it properly anyway ? As soon as you need to do something different or slightly complex all these scripting languages start to become painfull and you need to start augmenting them anyway.

    I realise that I am not a cool web developer, and there are potential security problems with using compiled languages, but this works well for me.

    Alex

  52. Whoa, language and API confusion by Jugalator · · Score: 1

    I'm no big web developer, but I know enough to know that PHP 5 isn't a rapid web development API like Ruby on Rails, but rather a programming language. :-S

    Wouldn't comparing RoR to e.g. the Zend Framework make more sense / be more useful?

    --
    Beware: In C++, your friends can see your privates!
  53. Symfony (PHP 5 Framework), Notes on other Webkits by Qbertino · · Score: 4, Informative

    As many have pointed out allready, PHP (incl. PHP 5) is a subset of CakePHP, as it is - Tadaa! - a PHP Framework. So if you run Cake on PHP 5 (it runs on both PHP 4 and PHP 5) then you've got both.
    There are a lot of Frameworks recommended here, such as Django, Turbogears and others. They are all very neat. I'd like to add Zope (or it's superset Plone) to that list as it is the oldest and most mature of all these neat OSS Webkits.

    Rails is the first project that emphatically applied marketing tactics to make itself popular, thus the extreme hype surrounding it and the potential critical mass it has gained. It's simular to the hype Zend is putting behind it's Zend Framework right now. Which is also way overhyped with bold claims despite being less than a year old. However Rails is *not* the Framework that invented or first implemented MVC, Scaffolding or all the other concepts associated with it.

    A Webdevelopers 2 cents.

    Feature, concept and technology wise Zope (built with Python) is still unmatched by any other Framework or Appserver available, be it in Python, Ruby, Java or whatever.

    CakePHP is a good Framework - I'm using on PHP 5 it just now to build a larger custom CRM System - and the community is fun (no Forum - we all hang out on IRC) but I recommend Symfony, as it is built entirely on PHP 5 no extra work added for PHP 4 compliance, covers aspects of it job by integrating existing Projects such as Creole and Propel for the DB stuff and it has very good documentation. Including a very well written Book (free PDF version available). Symfony is mature and has been successfully used in very large scale Projects (Yahoo Bookmarks is built on it).

    Bottom Line: I'd be carefull not to blindly follow the rabid hypers of Rails or their fresh PHP equivalent, the Zend Framework bandwagon crew. Check out the Frameworks people have mentioned here and if you want to stick to PHP 5 Cake or Symfony are both fine choices.

    --
    We suffer more in our imagination than in reality. - Seneca
  54. Re:with MySQL, eh... so much for having a choice by VGPowerlord · · Score: 1

    I've begun leaning towards PostgreSQL recently, but I never trust benchmarks given to me by one of the two sides instead of being done by a neutral party.

    --
    GLaDOS for President 2016! "Well here we are again. It's always such a pleasure." -- GLaDOS, 2011
  55. Not hard by Anonymous Coward · · Score: 1, Insightful

    > PHP5 Vs. CakePHP Vs. RubyOnRails?

    One of the most visited sites with dynamically generated content, Wikipedia, is written in PHP. So, I'd say that shows it's scalable and heavy-duty.

    1. Re:Not hard by MoreDruid · · Score: 1
      One of the most visited sites with dynamically generated content, Slashdot, is written in Perl. So, I'd say that shows it's scalable and heavy-duty.

      there, fixed that for ya

      BTW it has even stood the test of time since this september Slashdot will have existed for 10 years (God I don't want to know how many wasted hours you have cost me CmdrTaco).
      --
      The best weapon of a dictatorship is secrecy, but the best weapon of a democracy should be the weapon of openness.
  56. Ruby On Rails: Size of community of skilled users by martinbtt · · Score: 1

    In terms of the Rails community see: http://www.workingwithrails.com/ There is a large number of developers from all around the world now building Rails Apps. Many for large well know organisations: http://www.workingwithrails.com/high-profile-organ isations

  57. When you have a hammer... by AlXtreme · · Score: 1

    everything looks like a nail.

    Ignoring the confusion between PHP5 and the web frameworks named, in your situation I wouldn't go with any of them. If all you want is simply an easily-maintainable website then MODx is a much better choice. It's flexible enough to wrap around most websites without writing a single line of code, most of the work goes into the actual HTML-templates. It's more of a CMS/CMF-combination, with a large amount of plugins and an active community. The tree-based folder/document structures, publication-features, multiple users for different website sections, meta-tag editing... my users love the built-in functionalities and I don't see the point in implementing them all myself (anymore).

    Don't get me wrong, I'm a Django-fan and have used it and other web frameworks for quite a few commercial projects (specialized web applications, mostly intranet stuff). Django/RoR/Cake are great for such projects, however for maintainers of websites a fully-featured CMS (like MODx has) knocks the socks off of even the auto-generated backends. If your website falls into the multiple-level/multiple-document structure then it is pointless IMHO to build your own CMS from scratch.

    And yes, MODx is buzzword-compliant (AJAX/XHTML/Web2.0/SEO), so it's an easy sell to management.

    --
    This sig is intentionally left blank
  58. PHP beats RoR on deployment by dankelley · · Score: 3, Insightful

    A key issue, in contrasting PHP with RoR, is deployment.

    Deploying PHP is easy in most environments, perhaps as much because of its age as because of its inherent character. I work in an academic environment, in which all professors and students have the ability to make PHP sites. Each of my personal computers also lets me make PHP sites with no difficulty. Deployment amounts to no more than a file copy, perhaps with a change of file permissions. (I won't mention the database work, because of course it is the same for all schemes, PHP, RoR, etc.)

    But, unless you're using a host that has been set up to server RoR, deployment may involve changing Apache configuration files, compiling new Apache modules, etc. Such changes require root access (not available to folks sharing machines), and have the potential to break the other sites on the machine.

    I think there is a reason why the RoR tutorials, books, and promoters so seldom mention deployment: it is difficult for many people in non-commercial environments that are not set up for RoR.

    Oh, and one more thing. All of this fiddling with apache is boring to those who have set out to create websites. Learning Ruby to do RoR is quite fun, actually, and it has the advantage that it lets you use Ruby for other tasks as well. But learning apache doesn't help you with anything but apache; it's a bit of a single-lane road.

    RoR has a sort of elegance about it, and you gain a great deal of functionality from the system (e.g. for logins, etc.), and so it is a terrific tool for rapid development, particularly of an evolving idea for a site. It sounds crazy, but the optimal path may be to write the site in RoR and then rewrite it in PHP, so that deployment will be easy and so that the site will scale well[*].

    * -- I've not mentioned scaling and speed because these issues are covered in other posts here. Basically, RoR is not impressive on either.

    1. Re:PHP beats RoR on deployment by joost · · Score: 1

      I think there is a reason why the RoR tutorials, books, and promoters so seldom mention deployment: it is difficult for many people in non-commercial environments that are not set up for RoR.


      Nonsense.

      PHP is just easier since it's built-in to most Apaches.... now. Took a good ten years though.

      Want to deploy a Rails application? Get mongrel (either it's already on your box, or it's a gem, aka packaged download). No compilation required. Then mongrel_rails start -d and you are done.

      Unless you wish to run as root on port 80. But hey, you need root for running PHP on port 80 too.
    2. Re:PHP beats RoR on deployment by JAlexoi · · Score: 1

      That is the same problem with Java.
      But RoR is not targeted to lure out PHP developers, but rather Java developers.
      That is why RoR deployment and env is much more similar to Java's, that is basically a separate instance needed.
      While PHP thrives in low cost hosting, since PHP needs nothing else other than PHP files to run and an apache module(witch comes installed with pretty much anything these days).

  59. Re:with MySQL, eh... so much for having a choice by Anonymous Coward · · Score: 0

    The useful thing about Greg's article is that it's all discussion, not benchmarks, with references from both projects' own documentation as support. It makes checking the conclusions yourself fairly easy.

  60. Language comparisons by LuckyStarr · · Score: 3, Insightful

    I've used PHP, Perl, Ruby and Python (in that order) and I can confirm that Python is in fact cleaner. One of the reasons being it's spartan syntax. It's one of the goals of the language. :)

    PHP is just ugly, (see grandparent) Perl and Ruby are quite fun and share the same philosophy (see TIMTOWTDI) where Python is just the opposite (although fun too).

    Python and Ruby also share their deep roots in clean object orientation, where Perl's OO syntax is - though bolted on - very flexible and even more TIMTOWTDI than Ruby's.

    Just to set things straight, I really like Perl, Ruby and Python, though I can confirm that developing web applications with Django is bliss.

    --
    Meme of the day: I browse "Disable Sigs: Checked". So should you.
    1. Re:Language comparisons by Ranger · · Score: 1

      I can confirm that developing web applications with Django is bliss.
      I'd like to believe that. I've got a lot of experience with Zope and Plone and they do have a steep learning curve. I wanted something simpler and Django sounded really exciting. I must be doing something wrong. it's not as easy as I thought it was going to be to be and is taking longer to get up to speed than I expected. It's not living up to it's slogan: "The Web framework for perfectionists with deadlines". I've gone through the tutorials and started on the Django book online.

      I hope it's just me because I don't grok Django yet. Any pointers would be appreciated.
      --
      "You'll get nothing, and you'll like it!"
    2. Re:Language comparisons by Tablizer · · Score: 1

      Hide the pets and children and make way for another langauge war....

      A lot of it is subjective preferences. People think different and different tools fit different minds better.

    3. Re:Language comparisons by Sancho · · Score: 1

      I haven't worked with Django, but from my experience, these types of frameworks are quite complicated and have a moderate-to-steep learning curve. Realistically, once you get familiar with them, they should speed up your development time tremendously (sometimes at the expense of things like scalability or reliability, of course.)

      My understanding is that Django/Rails/CakePHP are fairly different from Zope/Plone, both in design goals and implementation. I wouldn't expect experience in one to help with the other.

    4. Re:Language comparisons by LuckyStarr · · Score: 1

      A lot of it is subjective preferences. People think different and different tools fit different minds better.


      Of course it is subjective. Otherwise we would all be stuck with COBOL. It is turing complete after all!
      --
      Meme of the day: I browse "Disable Sigs: Checked". So should you.
    5. Re:Language comparisons by Anonymous Coward · · Score: 0

      I've used PHP, Perl, Ruby and Python (in that order) and I can confirm that Python is in fact cleaner. One of the reasons being it's spartan syntax. It's one of the goals of the language. :)

      I've also used both Ruby and Python. Python has a simpler *syntax*, yes. For a large class of simple problems, this will yield simpler code. But, as with most languages, beyond a certain point a simple syntax hurts more than it helps. (Extreme case: Turing machines are *really* simple, but doing anything with them is a pain.) Once you exceed what the language provides naturally, the simple syntax becomes a liability, not a benefit.

      Ruby's &block gives you the ability to do rudimentary syntactic abstraction (not as powerful as Lisp, but partway there). Once you get to doing sophisticated things in Python -- for me it took about a year and a half -- it'll be more work to hack around Python's "one way" than to use a higher-level language like Ruby where you can cut with the grain.

      Guido's a really smart guy, and I like him and Python a lot, because he made a HLL that looks really simple for a long time -- when you first learn it, it looks like you can use it forever. But eventually you will hit its limits, and will want to do things which can't be expressed simply. There's a reason that Ruby projects use Rake, and every Python programmer has at some time thought "hey, a Make system built in Python!" but nobody has written one that didn't completely suck. Python is lousy at syntactic abstraction.

      (Here's where the Python crowd will jump out and say "syntactic abstraction sucks! how do you know what anything does?". Sigh. In a well-written Lisp or Ruby program, you can tell just by looking what something is. In a poorly-written Python program you're SOL -- imagine if somebody case-flattened your Python code. Clarity is ultimately a programmer feature, not a language feature.)

      At some point, I'm sure, Ruby will seem limiting, I'll want to do things which look ugly in Ruby, and I'll graduate to a yet-higher-level language, like Lisp or Prolog or SML or what have you. I look forward to that day, and until then, Ruby is a pretty neat language.

    6. Re:Language comparisons by CopaceticOpus · · Score: 1

      I haven't tried Django, but I have tried a couple other frameworks with similar setups. They also had great promise and nice slogans. Reading the home pages of competing frameworks is a bit like browsing through vacation brochures.

      The one thing I've learned is that when I see a framework with code generation scripts, I run screaming. It's just a bad way to build code in my opinion. You end up with too many things going on behind the scenes. I was always fighting these frameworks and unsure of what to do when I wanted to make a simple change or reconfigure something I had already generated.

      The one framework I've actually enjoyed using is the Zend Framework. It doesn't have mysterious code generating scripts. The best part of it is that it's so nicely modularized. You can easily use one or two pieces of it in a project without buying in to the whole thing. Unfortunately, I wasn't too happy with their MVC implementation, so I rolled my own while still using other components of the framework.

    7. Re:Language comparisons by DragonWriter · · Score: 1

      Python and Ruby also share their deep roots in clean object orientation


      I like both Python and Ruby, but is this really true, and if so, what is meant by "clean object orientation" such that Python's roots (i.e., Python pre-"new-style" classes) featured it?
    8. Re:Language comparisons by LuckyStarr · · Score: 1

      Sorry. With "clean" I meant clean as in "designed well", opposed to "bolted on as an afterthought". And by roots I did not mean historical roots - I don't know much about those - but rather their foundational constructs... well. EINMMT. :)

      --
      Meme of the day: I browse "Disable Sigs: Checked". So should you.
  61. Re:the answer: it depends by Dragonslicer · · Score: 1

    PHP is decent enough for what it is. Historically there have been security problems with it, Security problems in PHP itself have been pretty rare. The security problems everyone hears about are in PHP scripts written by idiots that do things like use a GET or POST variable as a shell command. There's not much that any language can do to prevent all programmer stupidity before you start losing important functionality.
  62. Re:Ruby On Rails: Size of community of skilled use by Anonymous Coward · · Score: 1, Funny

    www.workingwithrails.com = 500: Internal Server Error

    Hmmmm...

  63. Re:It makes little sense to say Rails doesn't scal by Anonymous Coward · · Score: 0

    using PHP to write a graphics driver is like attempting to change a car tire with a banana, but thats hardly a knock on PHP, its just a mostly banal comment
    I would call that a bananal comment :P Thanks for the laugh.
  64. Re-Open Nominations [1] by ajs318 · · Score: 1

    Got to vote for RON here. You missed mod_perl. Yeah, we know, perl is ugly and quirky and old-fashioned. So is a Class 47, but there's no denying it gets the job done.

    If you already know PHP, you won't have a lot to learn with Perl and you'll probably think it's a bit cleaner: Perl doesn't insist for you to put round brackets around everything, and its regex syntax is built about the regular expressions first and foremost, with looking like "proper" programming language constructs a distant second. (cf. the horrible, kludgy regex syntax of Java or Python.) Once you get used to how $_ works, you probably won't even need as many variables as you thought.

    --
    Je fume. Tu fumes. Nous fûmes!
  65. Ocsigen by Cultural+Sublimation · · Score: 3, Interesting

    If you had really complete freedom and were willing to try out something radically different from existing frameworks, I would suggest you would take a look at Ocsigen. It is based on the OCaml language, which alone implies a different mindset from traditional frameworks based on imperative languages. Some of Ocsigen's cool features:

    • Extends the OCaml type-safety into the generation of XHTML. This means that producing valid XHTML is not only "nice", but actually enforced by the framework: your programme won't even compile otherwise!
    • The entire site is seen as a programme where each public URL is a function. The OCaml type-safety is extended to forms and internal links, meaning there can't be any inconsistencies whatsoever.
    • With database bindings such as PG'OCaml, you can extend the type-safety also to database access. Think about it: the compiler checks at compile-time if your programme is consistent with the database itself!
    • Functional programming is very high-level, which means rapid development and happy programmers.
    • It is fast. And by fast I mean really, really, fast. How would you like your web framework to generate native code whose speed is close to that obtained with C?

    Sorry if this sounds like a sales pitch, but I would just like to point out that there are wonderful technologies out there, if people were just willing to take a step outside the trodden path.

    1. Re:Ocsigen by Bill,+Shooter+of+Bul · · Score: 1

      Sounds cool. Always loved the language and the speed. Any idea of how well it scales?

      --
      Well.. maybe. Or Maybe not. But Definitely not sort of.
    2. Re:Ocsigen by Cultural+Sublimation · · Score: 1

      Well, the bottleneck for web apps tends to be the database, so that would depend a lot on how it is designed. Don't expect miracles if your SQL tables are a mess!

      As for Ocsigen itself, since it is based on a language (OCaml) that allows for native-code compilation and uses little memory compared with almost everything else, it should scale reasonably well. And things like caching function calls can be done in a practically transparent way using memoization (google for it).

      I don't have much experience with other web frameworks, so it is hard to make relative comparisons. On my good old machine (an Athlon at 1.5Ghz), I can easily get Ocsigen to output of a few hundred dynamic pages per second (without caching). That is fast enough for my purposes. There's even a few examples where Ocsigen can output dynamically generated pages faster than Apache can output a static version of the same page! It really is that fast.

      However, the primary advantage comes from the type-safety of using OCaml. It is very hard to generate a programme (ie, a website) that has bugs. If it compiles, you can almost be sure that it will run forever!

      The main reason why more people aren't using it is because OCaml is still a relatively obscure language. Though I reckon that will eventually change, as people realise its advantages. Take the new darling of many people, F#, for example: it is largely based on OCaml.

  66. Re:with MySQL, eh... so much for having a choice by Anonymous Coward · · Score: 0

    Yahoo finance, google and youtube use mysql. People who know a thing or two about large scale deployment.

  67. CMS? by Uzbek · · Score: 1

    Why not use a CMS for these purposes? Scalability, caching, forms, user sessions etc are all already taken care of. All you need is to customize a given CMS for your particular needs. Just start with say, Drupal CMS, and build/modify modules for your own convenience.

  68. Ruby by RAMMS+EIN · · Score: 1

    Being a programming language enthusiast, I would choose Ruby over PHP any day. There simply isn't any contest.

    While I think PHP has the edge in being an easy transition from straight HTML (no MVC or OO baggage required), it suffers from a seriously crappy design (if you can even call it that) and the implementation isn't too great, either. Ruby has its flaws, but the language is one of the most elegant I have ever worked with. I have worked extensively with both, and I can tell you from experience that PHPs shortcoming seriously start to hamper you once your project moves from "static HTML with some generated content" towards "full-blown application which emits HTML in some places".

    You can argue about frameworks until you are blue in the face, but, eventually, you will end up writing a lot of code in the language itself, and Ruby is the clear winner there. Having said that, I should add that Rails is a pretty good framework which gets a lot of things right, and the other parts are being worked on. When I worked with Rails full-time, I could almost feel the progress being made, and I trust that Rails is a lot better now than it was then. It improves quickly, because it is built using a good language. Unfortunately, I can't say anything about competing frameworks, as I have never worked with any.

    Now, you might find that Ruby programmers are scarce. You can find Java or PHP programmers on every corner of the street, or near enough, but Ruby is a language that is still mostly ignored by the mainstream, including both programmers and those who teach them. This is both a disadvantage and an advantage. It makes it more difficult, and likely more expensive, to find and hire programmers who already know Ruby, but those who do are likely to be good programmers, whereas the same isn't true of many Java and PHP programmers. Also, people who have some experience learning programming languages (i.e. everybody who knows more than one or two) should have no difficulty learning Ruby...thankfully, Ruby isn't one of those languages that is full of gotchas.

    Now, to address your points more specifically:

    1. Maturity of solution:

    Neither Ruby nor PHP are exactly stable, but both have a pretty good track record with regard to backward compatibility. Rails and its imitations are relatively new and unstable, but I would guess that Rails would be the better pick. Note, though, that this is just a guess.

    2. Features:

    PHP comes with a lot of things baked into the implementation. Ruby comes with a number of modules, and more can easily be installed. I don't know which comes out the winner, but, in my experience, there is usually a Ruby module somewhere that does what you need...and you can easily install it; no recompiling required (unlike PHP, at least back when I still used it for new projects).

    3. Size of community of skilled users:

    PHP is the clear winner here. However, I am not 100% sure that it's actually easier to find _good_ PHP programmers than _good_ Ruby programmers.

    4. Complexity, ease for neophytes to master:

    PHP is a more limited language than Ruby, and thus easier to learn completely. Learning the same things that PHP can do in Ruby should be about equally difficult, but if you are going to be working with code that others have written (and you are), you will have to learn more Ruby than that. So PHP wins this one, but I must argue that your programmers will end up writing more code (and thus costing more) in exchange for less time spent on learning.

    5. Greatest strengths and weaknesses:

    Strength of Ruby: It's actually a great programming language. If you have people who can handle it, this will be a great advantage for you.

    Weaknesses of Ruby: Few people know it. It is dog slow. It is dynamically typed, so you will spend a lot of time debugging and getting errors at run-time that could have been caught at compile time.

    Strength of PHP: Many people know it. It's pretty easy to learn. It's tailored for web pages and some a

    --
    Please correct me if I got my facts wrong.
  69. Re:It makes little sense to say Rails doesn't scal by TomMastaBlasta · · Score: 1

    patio11, this is off topic but I have an idea for an application I was planning to write/sell and it looks like its something that you already have done. Having been through it I was wondering if you would share your insight on how difficult it is to do. What I mean, you wrote an app in Java and are you seeling it on the web? If so then did you design the website that sells it yourself? Did you get legal disclaimer that goes with your app, etc. Your insight is appreciated.

  70. Static typing by Anonymous Coward · · Score: 1, Insightful

    The difference that I can see between those two examples is that the first one declares the types for its variables and parameters, and the second doesn't. So in the Java code (as in C or C++) you'll get compiler errors for many more programming errors. In my experience, this is a huge advantage.

    1. Re:Static typing by @madeus · · Score: 1

      I really like the flexibility of dynamic typing but I really wish there there was an option to force static typing in languages like PHP and Perl (although having that sort of flexibility sounds like the sort of thing Larry Wall has been hinting may be in Perl 6, whenever it arrives).

      I know I can write software that works perfectly well with dynamic typing (mostly..) and it makes development much quicker so I'd hate to not have it as an option, but on a big project with developers of varying quality it becomes a real liability and I'd gladly just do casting and sacrifice a little flexibility.

    2. Re:Static typing by aevans · · Score: 0

      It's a huge advangate when all your variables and parameters are declared as (the correct) java objects. But if they're declared in text (XML or properties) files or passed by users or other apps (things that can't be tested at compile time), then protecting the typing system gets to be a large and fragile framework around a relatively simple app, and still doesn't do as good a job as an inferred typing system like most dynamic "scripting" languages have, where only a few sanity checks like casting strings to integers or massaging ints to floats. Perl, of course, has none of these advantages.

  71. Twitter Follow-Up by jaaron · · Score: 3, Insightful

    And there's a good follow-up by one of his coworkers:

    We've been extremely happy with Rails, and make use of the multitude of helpers that it offers us - like any application on any stack, though, providing fast response times to a (rapidly) growing number of users is a challenge. The solutions are often tightly coupled to the application and its characteristics, and while scaling the most trafficked Rails site in the world, we've run into situations where existing solutions weren't enough.

    Rails is best at database baby-sitting, which is not what Twitter is about and it's understandable they would have issues. Ruby is slow and we need a good virtual machine. Nevertheless, Twitter does run on Ruby which shows that it can be made to scale. Not that Twitter is a good measure of anything other than, well, Twitter. And I'm sure someone could have done it with PHP, Python, Erlang or C.

    Which is always why blanket statements about languages and platforms is always a bad idea. Just look at the comments on this article. It's just a chance for everyone to trumpet their favorite web framework or language. Sure we have our favorite tools, but most of them suck at one thing or another.

    --
    Who said Freedom was Fair?
    1. Re:Twitter Follow-Up by Tony · · Score: 1

      Sure we have our favorite tools, but most of them suck at one thing or another.

      So, you're telling me there's no magic bullet? I want my magic bullet!

      Now. Where's that flying car I've been promised?

      --
      Microsoft is to software what Budweiser is to beer.
    2. Re:Twitter Follow-Up by dedazo · · Score: 1

      Thank you for that link, I wasn't aware that they had fixed it. It even looks elegant enough.

      --
      Web2.0: I love when people Flickr my cuil and digg my boingboing until my google is reddit and I start to yahoo
    3. Re:Twitter Follow-Up by doc_doofus · · Score: 1
      --
      Disclaimer:IANAL/MD/PhD-Just the local yokel PC "doc" ~If you're not having fun, then you are probably doing it wrong.
  72. Frameworks by dfetter · · Score: 1

    Whatever you choose in a framework, bear in mind that the first version is not an important one, and anything done to optimize its construction is overwhelmingly likely to bite you at every opportunity to do maintenance. I haven't yet found a framework which saves time in the long run, "the long run" being anything over a month.

    --
    What part of "A well regulated militia" do you not understand?
  73. Turbogears rocks! by SimHacker · · Score: 2, Interesting

    I've developed a large complex project on an earlier version of TurboGears, with CherryPy/SQLObject/Kid, and I love it.

    TurboGears is quite modular, and the newer modules are even better: SQLAlchemy instead of SQLObject (database interface), and Genshi instead of Kid (templating system).

    -Don

    --
    Take a look and feel free: http://www.PieMenu.com
  74. C# with ASP.NET instead... by notbob · · Score: 0

    Why bother with any of those techs?

    Go with C# & ASP.NET ;)

  75. Rails Scalability from Experience by Anonymous Coward · · Score: 0

    We have 3 major hosted financial applications written in RoR. Twitter (see below) gets more hits, but we have larger apps that deal with real currency. My report is:

    1. Your database will be the scalability bottleneck in Rails. To minimize this, you have a few options.
          * First, try running your RoR app from within a J2EE app server using ActiveRecord-JDBC and JRuby (we're using Glassfish). A J2EE app server can scale nicely and seems to reduce the number of database hits by using more intelligent connection pooling, etc. It's not as efficient as using JPA and EJB3 container-managed persistence with a J2EE app, but it works and has the other benefits of giving you better integration (no JVM startup wait) with JasperReports and the security of running your code within the JVM.
          * Second, consider using MySql for its "clustering" ability. I'm a PostgreSql user, but my understanding is that Twitter is using the MySql clustering.
          * As Twitter has done, use caching and read-only slaves when you hit the bottlenecks.

    2. Ruby is slow. Development in RoR is quick, though. It's a time-to-market issue. In our case we made more money by choosing a rapid development framework and delivering to customers quickly. When we run into refactoring issues, we'll have the cash to hire a team of J2EE guys, if we need it. In the future RoR may have all of its performance issues fixed.

    3. It is an excellent framework for small-medium webapp development. Building larger, integrated, "enterprise" apps introduces some frustrations, but is doable.

    1. Re:Rails Scalability from Experience by shagymoe · · Score: 1

      For the love of God, if you've actually, successfully set up a RoR server, please fill me in on how to do it. I've been trying for 3 weeks. See my rant below. shagymoe@yahoo.com

  76. Why not a hybrid approach? by AbbyNormal · · Score: 1

    I've had great success using PEAR DB Objects and Smarty templates for my new web app (blatant plug): http://everythingfreight.com./
    The abstraction that DB objects have provided has been a goodsend working on ISP with older versions of MySQL.
    The caching features of Smarty have helped out a lot, but caution should be used when learning the security implications of the actual cache files.

    --
    Sig it.
  77. Use Grails by Anonymous Coward · · Score: 0

    Use Groovy on Rails, if you want a MySQL based Website with a lot
    of database functionality. It's easier than PHP, more stable,
    clean, you can use all java libraries out there, it runs where
    java runs, etc.
    See grails.codehaus.org

  78. I learned PHP once by seebs · · Score: 3, Insightful

    Everyone talked a lot about PHP.

    I started learning it. By about a chapter into the PHP book, I was thinking "holy crap, this language is uglier than perl". It has everything you would expect from a language thrown together by people who were either ignorant of software engineering or aware of it, but aggressively hostile to it. Everything global by default? WTF?

    I have never seen a language with so many carefully crafted security holes that the developer needs to learn to avoid. Default behavior for inclusion is to allow URLs, so you can, you know, run code from any site in the world. There's a feature everyone always wanted, which is never going to be subverted!

    I made it through about two and a half PHP books. In that time I learned that the MySQL and PostgreSQL interfaces were substantively different, and of course, used differently-named functions with slightly different calling conventions. Why? Because there's no abstraction or generalization going on; just whatever features sound cool getting thrown in with some name that wasn't previously in use. I learned that this is just BASIC all over again.

    I spent several days thinking hard about bleach, and went back to programming languages that were designed with some kind of consideration given to the development of larger projects.

    Ruby's undoubtedly "slow". That's what everyone said about perl and awk, too. Come to think of it, I've had people tell me that C was too slow. But Ruby has the amazing, shining, virtue that it is not a stupidly-designed or ugly language. I spent a while working with Ruby, and some helpful people pointed out that, in fact, the language does have a gotcha to watch out for. One. Not so many that you have to buy whole books full of things that you'd obviously try that don't work, open your site up to XSS, or behave erratically. No, just the one.

    Can PHP work? Sure. But the tacked-on afterthoughts provided to allow you to, in theory, if you remember to and want to put in the work, use basic software engineering principles, are not enough. The language provides a huge array of runtime functionality, with a function for everything. It doesn't provide the basic tools you want for engineering large projects, meaning that the workload of maintaining big stuff in PHP is exponential, not just quadratic.

    It can be made to work, but it really is that badly considered, and I wish people would stop doing things in it. Life is easy enough for the botnet people already, we don't need a language in which you have to be warned not to set the flag that lets remote sites set every global variable in your program.

    --
    My blog: http://www.seebs.net/log/ --- My iPhone/iPad app: http://www.seebs.net/seebsfrac/
    1. Re:I learned PHP once by quag7 · · Score: 1

      I'm not sure if this is specifically what you're referencing, but in case it is, I agree that it was a questionable decision to previously leave it on by default. However, it has changed (if this is what you mean):

      http://us2.php.net/register_globals

      "Chapter 29. Using Register Globals

      Perhaps the most controversial change in PHP is when the default value for the PHP directive register_globals went from ON to OFF in PHP 4.2.0. Reliance on this directive was quite common and many people didn't even know it existed and assumed it's just how PHP works. This page will explain how one can write insecure code with this directive but keep in mind that the directive itself isn't insecure but rather it's the misuse of it.

      When on, register_globals will inject your scripts with all sorts of variables, like request variables from HTML forms. This coupled with the fact that PHP doesn't require variable initialization means writing insecure code is that much easier. It was a difficult decision, but the PHP community decided to disable this directive by default. When on, people use variables yet really don't know for sure where they come from and can only assume. Internal variables that are defined in the script itself get mixed up with request data sent by users and disabling register_globals changes this"

    2. Re:I learned PHP once by seebs · · Score: 1

      Yes, I know it's been "fixed".

      That the option ever existed, at all, is the malware equivalent of asking whether someone lying naked on a bed, legs spread, covered with lube, with pornographic videos playing, and a big neon sign pointing at the applicable orifice, is trying to suggest something to you. To call it an "invitation" to attacks is like claiming that war is "sometimes unpleasant".

      Now imagine someone who, at some point, not only thought such a feature should exist, but turned it on by default.

      And now imagine saying "yes, I think I should run huge quantities of code in a language designed by this person on my server".

      It's dumb. It's ridiculous. It makes NO SENSE AT ALL.

      --
      My blog: http://www.seebs.net/log/ --- My iPhone/iPad app: http://www.seebs.net/seebsfrac/
    3. Re:I learned PHP once by quag7 · · Score: 3, Funny

      I think your problem is you don't do enough coding in seedy desert motels doing lines off of methamphetamine-crazed prostitutes, with a tubfull of radiator moonshine, a closet of AR-15 knockoffs and the latest high capacity polymer-grip Europistols, balancing towers of ice buckets full of jacketed hollowpoints.

      You probably sit in some comfortable chair in an air conditioned office somewhere going, "oh, oh, globals, oh no, don't hack me, please!"

      Some of us are too busy balancing our RAD needs while fighting off bikini-clad ninja chicks with harpoons and barbed-wire dildoes to be concerned to get our panties in a bunch over globals.

      Please, you're standing on my dick.

    4. Re:I learned PHP once by quag7 · · Score: 1

      I forgot to head "...while blasting Motorhead, and not just the poser anthem Ace of Spades either, but like deep album cuts, B-sides, and Motorhead-like songs Lemmy wrote at the tail-end of his time with Hawkwind."

      Thought that might be relevant. I want to be clear here.

    5. Re:I learned PHP once by nuzak · · Score: 1

      It has everything you would expect from a language thrown together by people who were either ignorant of software engineering or aware of it, but aggressively hostile to it.

      Having spent a good deal of time on IRC with the PHP devs themselves, I think you summed it up as succinctly as I've ever heard: they're a mix of both.

      For some real entertainment, check out the semantics of the === operator. I was there for its birth, educating Zeev on what the concept of "object identity" was, and saw as they got the semantics of the operator so completely opposite to what I was actually asking for (something like lisp's 'eq' or javascript's own triple-equals operator). And it lives on in PHP to this day.

      --
      Done with slashdot, done with nerds, getting a life.
    6. Re:I learned PHP once by Tablizer · · Score: 1

      It has everything you would expect from a language thrown together by people who were either ignorant of software engineering or aware of it

      Software engineering is an art, not a science. Everybody defines it and describes it differently.

      I have never seen a language with so many carefully crafted security holes that the developer needs to learn to avoid. Default behavior for inclusion is to allow URLs, so you can, you know, run code from any site in the world. There's a feature everyone always wanted, which is never going to be subverted!

      This appears to be because they made no distinction between file resources and web resources. You complained about lack of abstraction later in your rant, but here it is in the form of resource specification neutrality, and you are fussing about it. If a resource requester interface is going to look different for different resources, then you are hard-wiring implementation and hardware issues.

      As far as turning it off by default, there are various pro's and con's. Some want to lock down everything and others want to have flexibility without having to tweak settings.

      I made it through about two and a half PHP books. In that time I learned that the MySQL and PostgreSQL interfaces were substantively different, and of course, used differently-named functions with slightly different calling conventions. Why? Because there's no abstraction or generalization going on;

      Those are generally low-level interfaces. If you want higher-level interfaces, then you can get or write your own wrappers. You are not stuck with them. If they tried to funnel everything thru a more generic interface, then people would complain about lack of access to vendor-specific optimization features. Can't please everybody out-of-the-box.

      I spent several days thinking hard about bleach, and went back to programming languages that were designed with some kind of consideration given to the development of larger projects.

      I find it best to avoid large projects if possible, and split things into smaller projects/apps. For example, it may make sense to divide the reporting portion of a project from the data entry portion. The One Big EXE approach is asking for trouble IMO. Java projects tend to be like this, and turn into bloated messes.

      Life is easy enough for the botnet people already, we don't need a language in which you have to be warned not to set the flag that lets remote sites set every global variable in your program.

      That has been remedied in newer versions, as somebody stated.

    7. Re:I learned PHP once by seebs · · Score: 1

      Thank you. That really helps explain what they were thinking. I'd been wondering.

      I think the killer for me was some clash between things you could do with user-written functions and things you could do with builtins.

      My current solution is to write things in C, perl, ruby, sh, or awk. I've been thinking about relearning Icon just because it was a pretty language.

      Going from PHP to Ruby was an astounding experience, I must say.

      --
      My blog: http://www.seebs.net/log/ --- My iPhone/iPad app: http://www.seebs.net/seebsfrac/
    8. Re:I learned PHP once by seebs · · Score: 1

      I don't think you understood my point at all.

      I didn't talk about, suggest, or even hint at "the One Big EXE" approach. I haven't written code that way since the late 80s. However, PHP's entire design favors insane levels of cohesion between units, and discourages clean designs.

      Yes, it's good to divide reporting from data entry. However, it'd also be good to have code which really is the same shared, so that it's impossible for them to get out of sync, and PHP's support for this is dismal. It exists, sorta.

      And yes, I know that register_globals was "fixed". But having ever implemented it at all was crazy, even having it as an option is crazy, and having had it on by default is the programming equivalent of being a repeat sex offender; you should get clear notification whenever anyone who would do such a thing writes any code, and be given ample opportunity to avoid contact with such code.

      Mostly, though, you're just confirming my belief that this is all built on hand-waving by people who don't want to actually think through the pros and cons, just state that there are some, and assume that all pros and all cons are inherently of equivalent weight.

      This is why I don't like or trust PHP. I know there's some stuff that was written in it.... And time and time again, they get bitten by it. Wordpress can't do postgresql because PHP's database support hardcodes implementation quirks; you can't just write SQL and trust the server to implement it.

      --
      My blog: http://www.seebs.net/log/ --- My iPhone/iPad app: http://www.seebs.net/seebsfrac/
    9. Re:I learned PHP once by Tablizer · · Score: 1

      However, PHP's entire design favors insane levels of cohesion between units, and discourages clean designs.

      How about some specific examples. Everbody has different criteria for weighing "clean design". In the end, clean design is usually "how I like my code".

      Yes, it's good to divide reporting from data entry. However, it'd also be good to have code which really is the same shared, so that it's impossible for them to get out of sync, and PHP's support for this is dismal. It exists, sorta.

      Most of such depends on the framework or library *implimentor* in my experience, not so much the underlying language. I often find trying to write The Ultimate Generic Foo nearly hopeless for the same reason that the Soviets could not factor their economy such that the duplication found in capitalism was eliminted enuf to outperform capitalism. Perfect factoring is a pipe dream. Thus, I will now customize my libraries for each project without worrying much about ultimate genericness.

      And yes, I know that register_globals was "fixed". But having ever implemented it at all was crazy

      It is a holdover from the beggining of the dot-com days. In the mid 90's much of what we take for granted was experimental and new. PHP indeed does have some historic oddities. Any language older than like 5 years will. For example, C# learned from some of Java's bad ideas, and future languages will learn from C#'s mistakes, etc. Does this mean we should switch languages every 5 years; or take advantage of the experience, support, and libraries gained from time.

      Mostly, though, you're just confirming my belief that this is all built on hand-waving by people who don't want to actually think through the pros and cons, just state that there are some, and assume that all pros and all cons are inherently of equivalent weight.

      So all these years my design choices have been random and arbitrary? I have an urge to say something non-pleasent to you, but I resist.

      Wordpress can't do postgresql because PHP's database support hardcodes implementation quirks; you can't just write SQL and trust the server to implement it.

      One product written in PHP going south does not mean all is bad. If you want to find problems in any language/tool you can. PHP is one of the most heavily-used internet languages, so there are bound to be some gone-bad stories.

    10. Re:I learned PHP once by seebs · · Score: 1

      The thing is, I can't point to anything that PHP did well. It's full of catastrophically bad decisions (the mere existence of register_globals, for instance), and crazy stuff (see the nearby comment about ===). Register globals was not a decent idea in the 90s. It was catastrophically stupid then, too. It's not as though buffer overruns and other bugs which allowed users to overwrite variables were not well known already.

      PHP is the Windows of web programming. Everyone uses it because so many other people used it and did stuff with it.

      You claim that it's up to the library implementor... but I don't think it's possible to do the job sanely.

      Yes, a lot of that is learning curve. When a language is entirely defined by the learning curve of inexperienced people who either don't know about engineering or distrust it, the language ends up sucking. Yes, they're better now. If Rasmus wrote a new language, from scratch, today, it might be quite good. However, PHP is now in the same bin as BASIC. You can't fix it without breaking everything, and it's not at all clear that there'd be any reason to; the language's winning feature is widespread adoption. An upgrade which fixed the bugs would break that.

      It solves no problem that needs solving. It's a bunch of accretions and bags on the side of the first template language that everyone invents. I wrote one of these too, maybe fifteen years ago. Mine was crap too.

      --
      My blog: http://www.seebs.net/log/ --- My iPhone/iPad app: http://www.seebs.net/seebsfrac/
    11. Re:I learned PHP once by Tablizer · · Score: 1

      The thing is, I can't point to anything that PHP did well. It's full of catastrophically bad decisions

      To prove your original point, that is not the job that needs to be done. You need to provide some examples of current big *problems* with the language. You are just repeating your original points (which I responded to). I would like a substance-based debate, but I need problem scenarios to investigate your allegations.

      So far I see no solid evidence that it has more or bigger problem areas than its competitors.

      (Note that I don't love PHP, but I don't think its nearly as bad as you say.)

    12. Re:I learned PHP once by Saint+Aardvark · · Score: 1

      That is the funniest thing I expect to read all month. Thank you.

    13. Re:I learned PHP once by Anonymous Coward · · Score: 0

      I want this guy as President of the Earth.

      -- pythonista

    14. Re:I learned PHP once by Anonymous Coward · · Score: 0

      This reminds me of the church of Christ. Have you ever had one of them try to convert you?

      YOU: "No thanks, I disagree with your beliefs."
      THEM: "Really? Well what, specifically, do you disagree with?"
      YOU: "Well, I mean.. you guys think you're the only ones who are right.."
      THEM: "OK, just turn in your Bible to *insert verse* and you'll see why you are wrong..."

      Point being, when the overall theme or principles upon which something is based are wrong, there's nothing to be gained by debating each little point. That, I believe, is what the OP has done. He has stated, quite well in my opinion, why php sucks, and he did so on a high level. If the high level sucks, then the details don't matter much.

    15. Re:I learned PHP once by Tablizer · · Score: 1

      Point being, when the overall theme or principles upon which something is based are wrong, there's nothing to be gained by debating each little point.

      Having a few relatively minor rough spots does not make a tool/language bad, for they ALL have rough spots. I could rant on and on about how spaces and tabs can get switched in editors to make Python useless, but those who work with it get used to it and know to be careful there. You either have to show a high quantity of small rough spots, *or* show a few very bad spots. Neither has been done. A few small problems have been exaggerated, and repeating them over and over does not turn a molehill into a mountain.

    16. Re:I learned PHP once by Tablizer · · Score: 1

      I want this guy as President of the Earth.

      But his logic is more like the current president of the US.

    17. Re:I learned PHP once by CopaceticOpus · · Score: 1

      PHP used to stand for "Personal Home Page". It used to be someone's little hobby project, filled with lots of security holes and bad decisions. But with PHP 4.2 it started becoming more serious, and with PHP 5 it is very solid and well-considered. Don't think of it as a seedy background, think of it as a rags-to-riches story about the little language that could.

      Nobody uses the mysql_* functions anymore. Use database abstraction. PDO is the most common, though I really like the database stuff built into the new Zend Framework myself.

      Criticisms of PHP based on how it used to be 5-10 years ago are becoming very tiresome.

    18. Re:I learned PHP once by cortana · · Score: 1

      Nobody uses the mysql_* functions anymore. Use database abstraction. PDO is the most common, though I really like the database stuff built into the new Zend Framework myself. Nonsense. Far too many projects still use the mysql (4.0! DEAR GOD WITHOUT EVEN PLACEHOLDERS IN QUERIES) module's functions. They can't use anything newer because it will break compatibility with most of their user base who are still using PHP 4.

      Similarly we have the laughable register_globals situation; plenty of web applications written in PHP have "fixed" themselves to be compatible with installations where register_globals is turned off... by manually registering all GET, POST and cookie variables in the global namespace themselves ...

      Even if PHP grew a pair and obliterated php.ini altogether, making it secure by default in the process, the idiots who write web apps in it would still continue to manually open up huge security holes in this manner, rather than learn how to write code properly.
    19. Re:I learned PHP once by CopaceticOpus · · Score: 1

      Sure, there are plenty of examples of poor practices. Sure, there are stick-in-the-mud projects that refuse to upgrade. But that doesn't mean you have to code that way or use those projects. I guess I should have said "nobody doing high quality, modern PHP development is using the mysql_* functions."

      The important question is whether a competent developer can choose to write good, secure PHP code. Does PHP provide the tools? The answer is yes. The actions of 100 other idiots don't change that fact.

  79. Seriously rethinking RoR by shagymoe · · Score: 2, Interesting

    All the posts I've seen so far complain about RoR's scalability. These people have obviously not worked with RoR because, while scalability might be an issue, if they'd really worked with RoR, they would know that DEPLOYMENT is what kills rails.

    I jumped on the RoR bandwagon full bore and have been developing my app for over 1 year. The Ruby language is awesome and the framework takes the messiness out of web development. When I look at PHP code now I was to puke. With that said, I can deploy a PHP application is seconds...literally. Rails on the other hand, has had me working almost full time for 3 weeks trying to get a fucking test (not production...test) server up and running. It is completely fucking ridiculous to get a server set up that you could seriously test with or, God forbid, move into production.

    I've been a Systems Admin for over 7 years and a programmer for 6 years and using Linux for at least 8 years so I'm no newbie or idiot. I've tried setting up everything manually as well as using Capistrano and Capistrano/Deprec and still haven't had success getting a server setup.

    It is unbelievable how many crazy little nuances and bizarre configuration parameters you will encounter. In a short period of time you are just copying and pasting any random crap someone posted on the net that claims to have a working server. I've followed countless tutorials TO THE LETTER and this shit still doesn't work.

    I even purchased the "Deploying Rails Applications" book from Pragmatic Programmers and STILL CAN'T FUCKING GET SOMETHING DEPLOYED!!! Possibly the worst written book ever and claims to give you everything you need to get the Rails stack set up on Ubuntu Dapper Drake and has almost zero setup commands. What a load of crap. Anyone could have written this book since he just lifted it all from internet posts. Good job asshole, thanks for nothing.

    You know what happens to people who can successfully set up a Rails application? They start a fucking hosting company and make a shitload of money because hardly anyone else can do it. EngineYard, SliceHost, and RailsMachine are all examples of Rails programmers who started hosting companies because they actually made something work. It really just shouldn't be that hard.

    Maybe someday Rails will be easy to deploy, but right now it is a fucking nightmare. It totally ruins all of the great things about Ruby and Rails. I'm starting to think it's all a conspiracy and Rails was just some kind of carrot to lure us all into purchasing expensive hosting.

    The hype about Rails' faster development time is true right up until implementation and then it's a load of shit. Implementing a PHP app is like 2nd grade math, whereas implementing a Rails app is like quantum physics.

    I've never been so fucking frustrated about anything computer related in all my life. If you don't have a high tolerance for wading through tons of bullshit, then I don't recommend trying to implement a Rails app at this time.

    1. Re:Seriously rethinking RoR by Radhruin · · Score: 1

      It is completely fucking ridiculous to get a server set up that you could seriously test with or, God forbid, move into production.

      That's strange... one thing I really like about rails is how it's extremely easy to load up a test server with either Mongrel, lighttpd, or *shudder* if you must, Webrick. The benefit of using mongrel is that it's production ready with the "pack-o-mongrels" approach.

      As someone who has deployed a few Rails-based web applications in production, I simply can't fathom what your problems are a result of. I've never had to edit obscure configuration parameters - I don't even know where you'd go to find them. Perhaps you could share with us some of your specific problems? What did you have to configure, etc? Why doesn't "script/server" as a testing server (using Mongrel, Lighttpd, or Webrick) work for you?

    2. Re:Seriously rethinking RoR by shagymoe · · Score: 1

      Your results are not in line with most people's. In fact, here is text from the "Deploying Rails Applications" book from an "expert".

      "I quickly discovered after the joy of development, deployment was a real
      drag. All of those waves of euphoria completely disintegrated against
      the endless stream of crash logs, Rails error pages, and futile install
      scripts. I spent hours wading through the Rails wikis, blogs, and books
      for answers, but each one gave me a mere fragment of what I needed.
      Much of the information I found was contradictory or flat out wrong."


      My intent is to build a server that can be used for testing and then replicated and moved into production. Yes, I know that I could set up a test server and run Webrick, but there is no way you could go to production like that. My requirements are: Ubuntu 6.06 LTS, Apache 2.2.4, Mongrel, Subversion 1.4.4, WebDAV, Openssl, Openssh, MySQL5, and Capistrano. I had everything working great right up until I tried to implement Mogrel and found out that Apache 2.2.4 was required. (I started off with 2.0) At that point I basically had to scrap everything and start over by compiling Apache a thousand times using different "configure" options. I never have gotten the magic formula right to get WebDAV working, much less mongrel. Apache 2.2.4 doesn't seem to load it's files in the same directories as an apt-get install does on Ubuntu, which causes more confusion.

      Then I found DepRec which supposedly has all the necessary commands to build a Ubuntu 6.06 server from scratch. That worked great until I did the svn setup and it blew up. I looked at the source and I think I know why the error happens, but don't know to fix it.

      I'm surprised that you haven't found any obscure errors or config options during this process. Have you seen the tutorials for setting all this up? My current setup script is over 600 lines of commands. Change the config in this file, run these ten commands, change the config in that file, run 20 more commands.

    3. Re:Seriously rethinking RoR by Radhruin · · Score: 1

      At least to me, it doesn't sound like you are having problems with Rails but instead with compiling Apache to work with mod_proxy_balancer and getting subversion set up on Ubuntu? Apache can be a pain to configure and compile correctly, but I hardly see how you can fault Rails for that.

      Incidentally, your requirements are very similar to mine, and I just today set up almost that exact thing on a dedicated Solaris box. Compiling apache was the most "difficult" part, but it's just a matter of figuring out what you want in advance and configuring that stuff in. Specifically for proxy balancer you want enable-proxy, enable-proxy-html, and enable-proxy-balancer. This is all in the apache docs. You could also try Nginx, I hear a lot of people have a better experience there when your requirements don't include php and the like and instead you are just proxying to mongrels or something.

      The only configs relevant to a rails application should be those in your config directory. Everything else is in the realm of system administration, in my opinion. Your qualms seem mostly with compiling specific software on a linux platform.

    4. Re:Seriously rethinking RoR by shagymoe · · Score: 1

      Like I said, I love Rails, but what it takes to get it set up, at least for me, is difficult. Perhaps I'm asking for too much, but I want everything working correctly and together. Are you using WebDAV, ssl, ssh, apache and mongrel?

      I'd be interested to see your set up script.

    5. Re:Seriously rethinking RoR by Radhruin · · Score: 1

      If you wanted all that stuff, minus rails, plus PHP it'd be the same difficulty to get set up, though, so I fail to see how this is relevant to the topic at hand. That's my only confusion with this, I guess.

      Anyway, as for a setup script, I don't have one. I just compile and configure each individual piece of software by itself. It only needs to be done once, so a script doesn't seem necessary. Maybe I'm misunderstanding what you mean.

      I am using WebDAV and SSL with apache. To compile those two in you need enable-dav and enable-ssl as configure flags. This is all in the Apache configure docs. Those plus the ones I mentioned previously for proxy balancer and you should be good to go. SSH is easily set up on debian-like machines with apt-get (apt-get install ssh). Mongrel is installed as a rubygem, and is actually far better than webrick as a testing server.

    6. Re:Seriously rethinking RoR by shagymoe · · Score: 1

      Why doesn't "script/server" as a testing server (using Mongrel, Lighttpd, or Webrick) work for you?

      Because I feel that the testing server should be exactly what you are going to put into production.

    7. Re:Seriously rethinking RoR by Radhruin · · Score: 1

      So install mongrel then. If you have mongrel installed, script/server runs mongrel by default :)

  80. Grails by fils · · Score: 1

    I'd use none of the above and opt for Grails http://grails.org/ which gives me the java app servers (jboss, glassfish, tomcat, etc), the huge Java class libraryand the Groovy dynamic language. Seriously, if you are looking at these technologies do yourself a favor and be sure to check out Grails.

    1. Re:Grails by Anonymous Coward · · Score: 0

      Grails is great. It is built on spring and hibernate and leverages my Java knowledge. It also borrows a lot of useful concept from Ruby on Rails.
      Groovy is also a kick ass language that's both statically and dynamically typed.

  81. Re:with MySQL, eh... so much for having a choice by Anonymous Coward · · Score: 0

    > Yahoo finance, google and youtube use mysql. People who know a thing or two about large scale deployment.

    Sure, so does my department at ibm. Of course, we prefer postgresql, db2, oracle and sql server. But...if a vendor product requires mysql we will reluctantly install this - the least ansi-compliant database management system on the market.

    So, go ahead and add ibm as well as a mysql user.

  82. Re:the answer: it depends by jbwiv · · Score: 1

    (1) Schemas, entity-relationship diagrams, and queries tell me how an application works -- with Active Record this information is strewn across a whole bunch of files (especially in Rails);

    Um...somehow, I seriously doubt your claim to have actually used RoR for anything substantial. If you had, you'd know that, while migrations allow you to define your schema it separate files (usefully so), these files are used to generate the file db/schema.rb, which contain the entire database definition in ruby syntax. If you wish to have the DDL, again, it's very very easy. Simple issue "rake db:structure:dump" from your project root. How difficult is that?

    (2) Database-independence is a nice idea, but in reality, how often over the lifetime of your website will you migrate to a different database? Usually your database is chosen for you. Usually a switching databases involves coordinating with a lot of people who you'd usually rather not have to deal with -- those issues will take far more time and energy than differences between MySQL and Oracle;

    Again, bullshit. I've heard this argument again and again, but we have many customers, each of which have their own preferred database. We typically develop and use PostgreSQL ourselves, but being able to offer MySQL, Oracle or MSSQL support to our customers, so that they can leverage existing resources, is invaluable. If you live in your own closed-wall little world, then perhaps you'll only ever use one database. Or, if you're developing a web app which will remain under your complete control. BUT, if you have paying customers and distribute your app to them, database independence becomes extremely important.

    (3) a pretty common design pattern for web pages is to have a form that let's you fill in a few parameters (date, maybe geographical information) into a huge multi-table select statement -- you can do that in Active Record, but basically all you gain is a marginally fancier wrapper than you would have with DBI.

    huge multi-table select statement versus sending objects messages? I know which I'd choose.

    This entire discussion is pretty entertaining. As a developer of PHP since the later versions of 2, I can safely say from experience that it just is an AWFUL, hacked together language. Anything you develop ends up being hacked together as well (hacks are contagious). It works, sure, but as with all dirty hacks, you suffer pretty quickly. The hacks spread, the ugliness grows, and pretty soon you feel guilty even opening up the source and looking at the crap you've been encouraged to write.

    Ruby on Rails has warts here and there, sure, but it does encourage you to write clean code. And, Ruby, more than Rails, gives you such immense flexibility that you find yourself having to unlearn bad habits you were forced to follow by PHP.

    Trust me, PHP's days are numbered. Sure, it'll hang around like a bad rash for some years (even COBOL is still widely used), but only because the cost of migrating far outweighs the value in the legacy. Folks using PHP for greenfield applications today, when options like RoR, Grails, or even Django exist, should really check if their heads are on straight.

  83. Watch video... by Anonymous Coward · · Score: 0
  84. Ruby for Monolithic apps only by sseremeth · · Score: 1

    Single-threaded (Ruby) = hard to scale unless you are building one massive app.

    Have seen single-threaded rails apps in the same environment not scale well. I guess if you have Microsoft's/Google's datacenter budgets to throw hardware at the problem this is slightly less of an issue, but I wouldn't recommend going there if you intend to deploy many ruby apps to the same environment.

  85. Any opinions on Zope3? by Anomalyst · · Score: 1

    I'm sure this is just adding fuel to the fire, nevertheless, I am legitimately curious and while TFA is a lame link to a Wikipedia entry, it seems to be bringing out people knowledgeable in this area.

    Zope looks to have similar features/capabilities, anyone using it in real life?
    Does it scale well?
    Any particular annoying quirks?
    There appears to be an additional "grok" wrapper, does it really help?

    --
    There is no right to feel safe thru security vaudeville at the expense of everyone's freedom, privacy and tax money.
  86. none by Anonymous Coward · · Score: 0

    I don't know if I'll see one before I die but I'd love a script language that:
    Has strict type define like lets say a byte (all scripts)

    has all forms of types like unsigned (php) no I don't want a float for a large number.

    has a switch statement (python)

    does not have nulls or is something other then a extension to regex

    and embeds into server applications without the use of a push pop stack

  87. Scalability is a red hering by macurmudgeon · · Score: 1

    Not ever envisioning writing the next social app mega hit I find comparisons to Twitter a bit amusing. I just finished my first Rails site, an intranet calendar that may see a couple of thousand visits a day if the entire company uses the thing to its full potential, which isn't likely. Even taking into account the time learning RoR it took me about as long as it would have had I done it in PHP. That's amazing. I bid the job on my old time scale and got paid for on the job training. From now on out I should be able to do more work in less time. That's the scalability I'm interested in, the kind that makes me more productive and brings home more income.

    Like many self taught web designer/developers I started with CGI/Perl then moved to PHP, now Rails. Each move has been in the direction of increased productivity. I'm a just good enough programmer and am blown away by the MVC framework, DRY and Active Record. Real programmers may say, "Yeah, no big deal," but for the humble masses that just want the ability to deliver a custom site that will never see high traffic volume, the processing effeciency of a framework just isn't an issue. If you want to create the next coming of Face Book hire real programmers. If you want your website to do what you want and not force-fit your expectations to the constraints of an out of the box CRM or CMS, all at a reasonable price, then RoR looks really fine.

  88. Re:the answer: it depends by david_bonn · · Score: 1
    I think we are in violent agreement.

    I know about db/schema.rb. But your entity relationships are strewn in the model definitions. Yes, you could use "rake db:structure:dump" (or "rake db:annotate" that I swiped from one book on Rails), but you still have to remember to do that. This is essentially a minor problem, but every neophyte rails programmer I've encountered gets confused by this, especially when they are coming into an existing project.

    As for database-independence, it really depends on the applications you write and the customer. For nearly all of my clients I've been writing one-off applications that have to talk to pre-existing databases -- in that case the database wrapping in Active Record can't buy me very much. As for your comment about a huge multi-table select versus sending an object messages, yes, it is much much simpler to implement that with Active Record's object syntax, but it is guaranteed to be quite a bit slower than a hand-constructed select statement. And that is one case where performance would quite often matter.

    If there was clean support for views in Active Record (none of the plugins I've seen make me very happy) I'd be a happier coder.

    I like ruby and I like rails and agree that it is very hard not to write ugly code in PHP.

  89. From a guy who has professionally used PHP and ROR by aoism · · Score: 1

    First off, let me disclaim this with yes, I know ROR is a framework and PHP is a language. Yes its not quite the same comparing PHP to ROR. They are still both tools used to achieve the same result on the web. I haven't used CakePHP so this is only PHP vs ROR. Trols begone :) I know there are a lot of PHP haters on the ROR side, and a lot of ROR haters on the PHP side. I've used PHP for nearly 8 years now and I love it. About a year ago I got a job offer at a startup and they wanted me to do rails instead of PHP. So, I've been pushing rails to its limits for the last year trying to get things done with the same strength and speed of my former PHP apps. Both are good and bad in their own ways. Here is yet another random coder's 2 cents: PHP: Pros: GREAT community. Easy to read and accurate documentation Fairly easy language to pick up Fast! The performance of PHP is the best of the web languages I've used. Awesome for creating small scripts in a hurry (ie, displaying an MOTD on your site or something of the like) CLI php works just as web php does Easy to get working with most major webservers Cons: A royal pain in the ass to maintain if your program starts getting large. Very easy to make insecure (reg. globals anyone?) No built in testing No built in MVC (this is easy to fix this, but still, i *hated* using smarty or the like for my templates) Lots of crappy applications give it a bad name :) (phpnuke comes to mind) No namespaces! Hard to scale Ruby on Rails: Pros: Tons of stuff built right in like ActiveRecord, MVC, etc. ActiveRecord is awesome for simple queries Its ruby guts makes for some pretty easy to read code (saying "puts 'hello world' unless social" is much easier to read than "if (!$social) { print 'hello world'; } Built in testing framework is a awesome and is an incentive for people to test more (I NEVER tested in PHP, i do all the time in rails) You can create impressive sites fairly quickly Namespaces, glorious namespaces! Easy to scale. Add more mongrel clusters and you're done. Cons: Tons of stuff built right in (it is bloated all to hell) ActiveRecord is SLOW SLOW SLOW for complex queries (Pear DB DataObject kicks its ass) The community is very young and immature -- its a mash up of a few guy's blogs, a few wikis, and $9.99 podcasts The API documentation is lacking, and in a lot of cases, completely wrong. You have to read the source code to figure out what the API should be. Extremely verbose if you want a quick and simple piece of code on your static site (as in the aforementioned MOTD example) No easy integration with major webservers. You have to proxy and mod rewrite all over the place to get it to live in harmony with static files or other code (like PHP) Those are the major points that I can think of at this time. There are tons of other, smaller things that I encounter on a day to day basis. In the end, I think both are strong in their own ways. I feel its important to not marry either one and look at them as TOOLS that are to be used in the proper situations. If there is one thing I can't stand, its a purist. Purists box themselves in and turn in to stubborn old foagies that no one wants to deal with. Be open to using any tool that gets the job done in the most professional way possible.

  90. Comment removed by account_deleted · · Score: 1

    Comment removed based on user account deletion

  91. Different tools, different jobs by gardenermike · · Score: 1

    Lots of posters have been talking about "scaling." I've done a lot of work in Java, PHP, and RoR, including scaling each of them up to millions of hits per day.
    The thing is, scaling hardware isn't trivial, and requires very different expertise than building web applications. That's just the nature of it. Rails can scale great; so can PHP, Java, or whatever. Find an expert and they can make it work.
    What is much more difficult is to make the code itself scalable. Without a fairly rigid adherence to good design principles, projects that grow larger and larger soon become an unmanageable spaghetti nightmare.
    This code scaling is where Rails shines like the sun. It religiously follows good design principles, to the point that you have to try to end up with a mess. For those who have worked in large projects, having that kind of structure is a great joy.
    I have never once, nor has anyone I have spoken with, seen a large PHP project that did not turn into spaghetti. The language itself presents huge problems that way: all functions are in the global namespace, as are all variables by default. On the other hand, PHP is very fast, efficient, and effective for little one-page sites.
    In short, if your application is going to be very small, and will never, ever grow, use PHP. Otherwise use something else. Rails isn't the only good framework in a good language out there: Django would be a good candidate; even Perl can work for you. Using a decent framework with a language that is well designed will save you all sorts of headache as your project grows.

  92. Re:From a guy who has professionally used PHP and by Anonymous Coward · · Score: 0

    Be open to using any tool that gets the job done in the most professional way possible.

    Like, say, the paragraph break?
  93. Re:From a guy who has professionally used PHP and by Anonymous Coward · · Score: 0
    Are you really saying that one of the cons of PHP is that it doesn't have MVC built in? And the pro of Ruby on Rails is that it does? MVC is a design construct, it would never be "built in" to any language. You can use your language of choice to apply this methodology in your applications, which is one of the points of Ruby on Rails (and Django (Python), CodeIgniter (PHP), Struts (Java)...insert MVC framework here for language of choice) in the first place. To help you implement the MVC design pattern into your Ruby web applications.

    If it's becoming a royal pain in the ass to maintain large applications in PHP, I hate to say this, but chances are there are other problems going on that really have nothing to do with PHP (or whatever language you are choosing to use).

    Be open to using any tool that gets the job done in the most professional way possible.

    Very true, but make sure you take the time to learn the tool in order to implement and use it properly.
  94. No to raw PHP; consider symfony by PhoenixRising · · Score: 1

    I'm making the assumption that you're talking about creating a database-driven website that's going to need a lot of the CRUD functionality that web dev frameworks facilitate; if this isn't true, the answer is probably "none of the above".

    Given that: hand-coding PHP to do this kind of site is almost certainly going to be a painful mistake. You're either going to end up reimplementing your own web development framework, or repeating yourself a huge amount and generating error-ridden and unmaintainable code. Especially if you're going to go with a PHP-based solution, you want to use some kind of framework to minimize the amount of code you have to write. (PHP is, after all, training wheels without the bike :) ).

    I'm leery of CakePHP; it's written in PHP 4, which pretty much guarantees bad coding practices. (Oh, you wanted /objects/? Ha!) I've had very positive results with symfony, as several others have mentioned. One thing in particular that it has that's been super-handy is, in addition to scaffolding à la Ruby on Rails, the ability to generate highly customizable "admin" interfaces on the fly, based on a configuration file. This makes interface creation more declarative than programmatic, which IME does wonders for maintainability.

  95. Pointless... by big+dumb+dog · · Score: 1

    You are going to build "something". Should you use:
    1. Wood
    2. Steel
    3. Plastic

    * If you tried to answer this question without a use case, you're WRONG!

    --
    "Seven years of college down the drain. Might as well join the f-ing Peace Corps." - John 'Bluto' Blutarsky
  96. How about D. None of the above? by jocknerd · · Score: 1

    I prefer to work with PostgreSQL for the data and Django for the website.

  97. DB vendor neutrality madness by Tablizer · · Score: 1

    Database-independence is a nice idea, but in reality, how often over the lifetime of your website will you migrate to a different database? Usually your database is chosen for you. Usually a switching databases involves coordinating with a lot of people who you'd usually rather not have to deal with

    Agreed. The development community is often obsessed with DB vendor neutrality and pay an up-front complexity tax to (try to) achieve it. Most of the time for custom apps it is just not worth it. Authors that over-emphasize this should be slapped. (And if you know its coming, there are ways to write SQL and schemas to reduce vendor issues.)

  98. what everyone is missing here... by Anonymous Coward · · Score: 0

    This article attempts to compare a language with 2 frameworks. Apples and oranges.

    PHP lacks a concise easy to use framework that's ubiquitous.

    Rubyis a language and has an ubiquitous framework with plugable extensions called Ruby on Rails.

    I don't know about the third option, but glancing says it's an attempt at a framework.

    The best PHP framework i've seen so far is Symphony, which is a near-clone of Ruby on Rails (odd that the best PHP framework is swiped primarilly from RoR. Gotta be a reason there somewhere).

    Java is a language which has a sort-of framework on top of it with many non-plugable libraries.

    ASP and .NET were designed as a language + ubiquitous framework from the start.

    So, to all you php lovers/RoR lovers/Java lovers, how about we compare apples to apples instead of stoking the "mine is better than your's" wars?

  99. All About the Project by DonBueck · · Score: 1

    As someone who regularly designs applications in both .NET and PHP, I've learned that the language (Ruby, PHP5) and the platform/framework (Rails, CakePHP, .NET) should usually be chosen based on the needs of a particular project. For instance, I would never use PHP or RoR to design a large enterprise level system; I've found .NET and MSSQL to work far more reliably. On the other hand, PHP5 has come a LONG way for small to medium level projects, and I would use it in a heartbeat on one of those.

    When you talk about the different choices for each platform, ALWAYS ask what would suit the needs of the project.

    From a subjective standpoint, I really cannot stand CakePHP. It's bloated and has a pretty bad Active record implementation. What usually works best, in ANY platform, is to either invest some time in designing a framework yourself, or use an extremely light-weight framework to get off the ground.

  100. Security by NotNormal · · Score: 1

    My question would be concerning the sensitivity of the data that is to be presented. Are we talking about sensitive customer information (i.e. ssn's) or a private area (i.e. members only section) or is security not a concern at all (i.e. personal blog)?

    PHP has some serious security flaws http://www.php-security.org/ That would make it inappropriate to use for the first case, but fine for anything else. It appears that Ruby security flaws are not as well documented, probably since it's a newer language. However, I also doubt that it would be appropriate for the first case. Simply based on the fact I don't see any financial sites running on either platform.

    --
    ~ Normality is merely the achievement of the mediocre...
  101. Don't Fear SQL by Tablizer · · Score: 1

    I've heard this argument again and again, but we have many customers, each of which have their own preferred database. We typically develop and use PostgreSQL ourselves, but being able to offer MySQL, Oracle or MSSQL support to our customers, so that they can leverage existing resources, is invaluable. If you live in your own closed-wall little world, then perhaps you'll only ever use one database. Or, if you're developing a web app which will remain under your complete control. BUT, if you have paying customers and distribute your app to them, database independence becomes extremely important.

    I generally see custom applications written for a particular shop for a particular need. If you sell the same package to different customers with different DB's, then indeed a heavy DB wrapper may pay off.

    In my opinion, the most useful such tools are often those that simplify the repetitious portions of SQL (such as INSERT statements), but don't necessarily try to hide all SQL. Writing certain kinds of SQL thru API's can be a royal PITA. The OOP community has falsely convinced many developers that all SQL is evil. They are just being paradigm biggots. (Note that I don't think SQL is the ideal query language, it could be improved, but hiding it all thru bloated API calls and writing manual loops is often worse.)

  102. mod parent up, please! by merreborn · · Score: 1

    The grandparent post is nearly as clueless as the "script kiddies" he attempts to call out.

    1. Re:mod parent up, please! by corychristison · · Score: 1

      Regardless, projects should not depend on and assume you have it. Which was the point I was trying to make. Try reading, fucktard.

  103. simple things.. by greywire · · Score: 1

    Firstly: I admire ruby as a language. I like to explore new languages, new ways of doing things, etc. At one time I thought Lisp was really cool too. And many others.

    PHP for all its faults is:

    Very well documented. This is huge, whether you are a beginner or an expert. Yes, there are ugly inconsistent naming conventions, seemingly unneeded duplication (all the DB interfaces. But check out PDO..), etc.

    Easy to set up and deploy (never mind being so ubiquitous as to rarely need to be setup)

    Relatively fast.

    "Simple things should be simple. Complex things should be possible". PHP is. Some people would argue that being simple to use for newbees or for quick-and-dirty apps is bad. The only reason this is bad is because people misuse it. This is a problem with people, not the language. I don't need my language to restrict me. Many of the security issues and bad code with PHP are due to people simply not knowing what they are doing with a powerful tool.

    Procedural and object oriented. You purists out there pushing for 100% object orientation are missing the fact that sometimes its not the right solution. There is a time and place for each.

    I am not thrilled with the attempt to contort relational databases into an object oriented methodology (ORM/active record). I love the idea of code generation to save on the drudgery of lower level coding but I don't think this is the way to go. Which leads me away from the RAILs bandwagon.

    Personally I am leaning towards Kohana framework (fork of Codeigniter): no ORM (not built in, anyway) but code for helping you construct SQL, Templates are just PHP (remember that PHP was just a template language originally?), use whatever AJAX bits you like (I do like prototype.js from rails, scriptaculous and ext framework). I plan to write my own code generator to handle the 80% of the boring HTML forms and DB table code, while it stays out of my way for the other 20% I know will need to be coded by hand.

    --
    -- Senior Software Engineer, Attorney appearance services, locallawyerapp.com.
  104. ERLANG! by dawsdesign · · Score: 1

    No, real men code their sites in erlang. http://erlyweb.org/ And don't rate this post as funny :P

  105. Python frameworks: deployment and config issues by walterbyrd · · Score: 1

    I like Python better than PHP, but I think there may be compelling
    advantages to PHP when it comes to frameworks. Issues that concerns me
    with Python, and Python frameworks, include: hosting, deployment,
    configuration and administrative overhead.

    I get the impression that Python framework developers just assume the
    user has complete control over the server. Those who develop Python
    frameworks seem to have little regard for the realities of shared
    hosting. System requirements tend to be sky-high: Apache 2.x,
    mod_python (latest version), fastcgi (at least), command line access,
    PostgreSQL (recommended). Assuming you can meet the system
    requirements, you still have server configuration issues such as
    setting up the Path, and maybe the .htaccess file.

    For example, as I understand it, in Django:
    * The database model has to be manually synced to database from the
    command line, anytime any change is made to the database.
    * A configuration file has to be created for every application.
    * Urls have to be configured in the urls.py file to match the view.
    * The webserver has to be restarted every time modify your code - or
    touch every file if using fastcgi.

    configuration. I don't think this amount of configuration is required
    by Rails, or the PHP frameworks. Am I wrong about that? And is it
    really an issue?

    1. Re:Python frameworks: deployment and config issues by aevans · · Score: 0

      If you can't afford around $15/month for a VPS where you can install python, you don't have any serious development to do.

    2. Re:Python frameworks: deployment and config issues by Anonymous Coward · · Score: 0

      This is why there are no equivalents of major php applications in Python widespread. It would be better to make easy to deploy/sustain framework for python.

  106. I'm going with PHP 5, myself by Watts+Martin · · Score: 1
    This is actually an issue I've been wrestling with recently.

    From a language standpoint, Ruby -- and Python -- are simply much nicer to deal with than PHP usually is. As you probably know, PHP started life as a series of Perl scripts, and even though it left that behind long ago it still reminds me a lot of Perl in its quirkiness and overall feeling of being held together with Scotch tape and spit.

    I'm using CakePHP for a work project now and it highlights a lot of these problems. It tries to be object-oriented; for instance, it closely mimics Ruby on Rails' MVC system. Except, you know, when it doesn't: for instance, it returns data results as arrays, rather than objects, so you'll end up writing code like this:

    $item = $this->Item->findById($id);
    $duedate = $item['Item']['due'];

    Rather than Ruby's roughly equivalent:

    item = Item.find(:id)
    duedate = item.duedate

    ...and when you're dealing with more complex relationships (say, you have an order record which has multiple line item records which you need a field from), Ruby's conciseness starts looking mighty attractive compared to Cake's bloviation.

    Having said that, though, I put the qualifier "usually" in there for a reason. If you were actually taking advantage of PHP 5, that PHP code could, and arguably should, be simply:

    $item = Item::find($id);
    $duedate = $item->duedate;

    PHP 5.1's new PDO data abstraction layer is pretty easy to work with, lets you work directly with objects, lets you iterate through returned record objects correctly with foreach loops. While there's a lot of data abstraction choices for PHP, PDO is pretty competitive in performance with any of them, very straightforward and, in recent versions of PHP, just baked right in.

    PHP 5's object system in general is actually much better than I'd been giving it credit for until I finally dug into it, too. It's definitely worth taking a bit of time -- if you're used to any other OO system, it won't take long -- to learn things about it.

    I wrote on my blog not too long ago that PHP shares a largely self-inflicted image problem with Javascript: they can both be fairly powerful, well-executed languages, but they're burdened with a whole lot of crap. Part of that crap is just cruft that's been thrown onto the language (particularly in PHP's case), and part of it is that most people who program in both PHP and Javascript really aren't programmers, and boy, does it show.

    I suspect for my next big project, I'm going to write in PHP 5 "natively"; as impressed as I am with what CakePHP is trying to do, their implementation is grating, and I don't think any framework that insists on backward compatibility with PHP 4 is going to be able to move past that. While it may seem a little perverse in this framework-happy age to start from scratch, really, you don't have to start from scratch: PHP's PEAR library contains a fair amount of good components (a fair amount of less good ones, to be sure, too).

    As for performance, I think scalability issues with both PHP and RoR get overstated by critics. Ruby's biggest issue at this point performance-wise is simply that it's a very slow language. Rails does a lot of caching tricks to minimize this, but any other language can do the same caching tricks. PHP doesn't have that problem. Neither does Python; I saw someone tagged this article rather facetiously with "django," but you know, Django's a pretty good framework, and I'd give it a serious look for any project were I you. (I'm still giving it a look myself.)

    The other issue you face with Rails and Django is deployment. PHP tends to pretty much just work when you slap it up on most web servers; Rails and Django, well, don't. You need a host who knows what they're doing with those frameworks or you need to be hosting it yourself, and learn what you're doing. Rails' deployment syst

  107. 'eval' is for tools, you say? by tepples · · Score: 1

    There are plenty of very high traffic sites based in PHP. So it is a serious tool. No, anyone who voluntarily uses a language with create_function is a serious tool. Then so is anyone who voluntarily uses Python, Ruby, JavaScript, or any of several Lisps, as they have the eval function which does the same thing.
    1. Re:'eval' is for tools, you say? by Anonymous Coward · · Score: 0

      as they have the eval function which does the same thing.

      No, create_function does not do the same as eval. create_function is a substitute for closures (which "Python, Ruby, JavaScript, or any of several Lisps" all support), but in the same way that sticking your dick in a rotting cabbage is a substitute for being happily married to a beautiful rich supermodel.
  108. Don't use any of them by Super+Techie · · Score: 1

    I would pick Django. Scales better than most interpreted languages, and offers the chance to write more maintainable code than PHP.

  109. HTML::Mason? by element-o.p. · · Score: 1

    I am a sys admin by trade, and I build web sites for fun, so this may be obvious to someone (read "not me") who does web development for a living, but how does Perl+HTML::Mason compare with PHP, RoR, Django, etc. in terms of speed, scalability and maintainability for commercial/very popular sites? Just curious, since Mason is what I've used on my projects...

    --
    MCSE? No, sir...I don't do Windows. Yes, I am an idealist. What's your point?
  110. Perl Catalyst by mattr · · Score: 2, Informative

    1. Maturity of solution;
    Catalyst and Perl both more mature than the frameworks/languages mentioned.
    2. Features;
    CPAN is bigger, Perl has more functionality which is why there is more than one way to do it (TIMTOWTDI) in Perl.
    3. Size of community of skilled users (to build a team);
    More skilled Perl programmers.
    4. Complexity/ease of use (for neophytes to master);
    Mmmm well can't say. PHP based thing with only one layout you can use might be simplest for a newbie. On the other hand, are you trying to make a serious webapp or just a cookie cutter steaming phpnuke thing? Am interested in Ruby mainly because it just might reduce typing but then again maybe not. Just seems neat. But for making a live system I'd go with Perl.
    5. Greatest strength of your choice, and the greatest weaknesses of the other two.
    Many available modules. Other two have a much shorter [programmer pool size] x [framework and modules powerfulness] vector.

  111. Re:It makes little sense to say Rails doesn't scal by Anonymous Coward · · Score: 0

    Granted, I wouldn't write Digg in it, but *I'll never write Digg in anything*. Neither will 99% of the world's programmers

    Another way to put this:

    I'm a startup. RoR lets me get a 99% solution in practically no time at all. I can get everything except possibly high-volume scaling (and it's not even clear to me that it can't do that). With that 99% solution, I can show it to people and get users. I can show it to investors and get money. With that money, I can spend my time optimizing (hi, Don!) or even rewriting in Java or C or assembly or whatever.

    If I had started out in Java or C or assembly or whatever, I'd never have made it past step 1. It would scale awesomely, but never have shipped because I'd have run out of money first. (I've written large programs in Ruby, Java, and C. They all have their uses, but very few startups are using Java, and for good reason.)

    This is just another case of "correctness, then performance". I don't think I've ever seen that fail, and I've seen countless instances of the opposite way failing.

  112. Is Symfony slow? by walterbyrd · · Score: 1

    No offense, I'm asking because I don't know. I have seen a report where django, rails, and symfony were compared, and symfony came in dead last - by a substantial margin.

    I don't have a lot of faith in benchmarks. I like to think I have an open mind.

  113. Not one thing listed to consider was correct by Secret+Rabbit · · Score: 1

    This mentality is one of the larger reasons why the IT industry is in the shit right now i.e. people don't consider which is the right tool FOR THE PROBLEM. All that largely goes on is people trying to bang square pegs in circle holes getting the expected results.

    1. Maturity of solution;

    I couldn't care less. As long as it works as advertised and is bug free (as much as it can be).

    2. Features;

    As long as it has everything that I need, who cares what else is included. Hell, even if it doesn't, one can write it themselves. As long as the list (and complexity of the items) isn't prohibitive... At any rate, I don't expect many languages would be prohibitive in this respect.

      3. Size of community of skilled users (to build a team);

    If you build it, they will come... sorta. Basically, if what you're building is worth while, and you've shown that you're in it for the long haul, don't worry about building a team of competent programmers. They /will/ show up once things get going. You just have to be picky when it comes to who you give cvs write access to and, for that matter, what contributions you commit yourself (i.e. quality control).

      4. Complexity/ease of use (for neophytes to master);

    Screw neophytes. All they produce is crap code which /no-one/ wants in there code-base. If they aren't competent enough to write in a given language, then they shouldn't be contributing. And arguably, for these people, the language wouldn't matter when it comes to the quality of the code they produce.

      5. Greatest strength of your choice, and the greatest weaknesses of the other two.

    The problem domain has yet to be specified. So, this is an unanswerable question.

  114. Re:Symfony (PHP 5 Framework), Notes on other Webki by tayhimself · · Score: 1

    I have used Symfony for several smallish intranet projects that are used for data entry forms and data export. It is flexible and customizable enough to be almost confusing, but you can gradually learn how to use all the little bits to your advantage.
    It has far more features than Zend Framework (which you can use with Symfony if you wish) and is more hackable than CakePHP.
    I started using Symfony after first using html_quickforms/smarty (pear modules) and then looking at Rails and CakePHP. Rails was a new language with a new framework so I decided against it at the time, and Cake seemed really rigid. Now that I am comfortable with a sophisticated framework like Symfony, I will check out Rails to see what the hoopla is all about.
    For now though, I see little need to.

  115. In Summary by Anonymous Coward · · Score: 0

    So in Summary, no matter what you choose folks will complain about "how crappy it is" and how much better their solution is.

    My advice.
    1. get the requirements for the app you need to build
    2. choose a solution that handles all of point 1 (x 2)
    3. use an agile developmental methodology.
    4. make sure the code you write is maintainable and extendable. (i.e. joe college grad can modify it)
    5. have unit tests and code reviews.

  116. What would you use for a fairly complex biz app? by walterbyrd · · Score: 1

    Probably only one developer. I like structured, readable, maintainable code.

    I am leaning towards python and a python framework, but I am not happy about the deployment and configuration issues associated with python.

    Is there that big a difference between php and python? Is python worth the trouble?

    As you may have guessed, I know some python, and some php, but I no expert in either.

  117. Mutually Exclusive? by Tablizer · · Score: 1

    I've worked in all three, repeatedly, and there's really no contest. Rails is so much easier to get concepts out, and has so many fewer bugs (in my experience), that it's silly to use PHP at this point, unless you have overriding reasons for choosing it aside from inherent qualities.

    Do these have to be mutually-exclusive? Could a Rails framework be built for PHP? I've heard debates that Rails really needs the "meta" abilities of Ruby, but others have disagreed. Seems nobody will know for sure until its tried.

  118. Re: PHP should be banned by Anonymous Coward · · Score: 0

    PHP: The quickest way to learn bad programming habits, bar none. Even worse than Visual Basic. You will hurt yourself and never understand why.

  119. Comment removed by account_deleted · · Score: 1

    Comment removed based on user account deletion

  120. Comment removed by account_deleted · · Score: 1

    Comment removed based on user account deletion

  121. Pear isint a framework you fuckard by Anonymous Coward · · Score: 0

    It is a class libaray similar to cpan. I can't belive you got modded up noob. Your the shit eating skript K1D

  122. django by Vexorian · · Score: 1

    What about django ? It is bettart ! This allows python fan mods to give me mod points, do fast.

    --

    Copyright infringement is "piracy" in the same way DRM is "consumer rape"
  123. Comment removed by account_deleted · · Score: 1

    Comment removed based on user account deletion

  124. Getting a Rails server up and running in 5 minut by patio11 · · Score: 2, Funny

    Use Deprec (www.deprec.org I think) on a clean Ubuntu install. Seriously, when I found it it was almost a religious experience (and we're talking Baptist-esque rolling in the aisles and PRAISE HIM! OH! religion here).

  125. Re:It makes little sense to say Rails doesn't scal by azenpunk · · Score: 1

    using PHP to write a graphics driver is like attempting to change a car tire with a banana

    Everyone knows that bananas are for attacking self defense instructors

    http://en.wikipedia.org/wiki/Self_Defence_Against_Fresh_Fruit

  126. Too broad a question, no? by phobonetik · · Score: 1
    If you were going to "start a website", you would need to know a lot more about the website before you could make a choice.

    I would advocate all three, together with our own Google Summer of Codey-licous SilverStripe platform :)

    My main point is that there are far more variables that need exploring, and then you can find the right too.

    For instance, one decision would be: Is it a small team of people working on this project, who want to rapidly work together in a closed application (e.g. building a software as a service application)? If so, then Ruby on Rails could work better, but on the other hand, if your website/project is going to be open source, or needs a community of people to look at it, then PHP might be better.

    I think sites like opensourcecms.com could do better at seperating the tools out with questions like that!

    And yet, PHP and ROR are like scattered lego blocks on the floor, waiting to be patiently assembled. If someone asks me "to build a website", I would use a system that is much closer to a working website, and tweak it.

    The comments in this read about "building a digg" etc, are in my opinion, not what people generally think of "when building a website". Digg is a custom-built application that cannot leverage from existing systems as well as a website can. It probably could have just as well been done in perl or ROR. There would be different challenges, and a different number of servers and staff, but fundamentally it would have been successful enough to pay people to figure out how to overcome those challenges.

  127. Re:the answer: it depends by Bluesman · · Score: 1

    I was thinking about the non-parameterized database queries that were ripe for SQL injection attacks that persisted up until recent versions. Just that the developers would let something so huge like that slide for so long made me extremely wary of using PHP, because that's an indication to me that they didn't know what they were doing, or just didn't care.

    I'm sure it's better now, but the bad first impression I got has persisted, and PHP isn't so great that I'm willing to take the risk with it.

    --
    If moderation could change anything, it would be illegal.
  128. There are more choices than this by JiveBay · · Score: 1

    If you use PHP4 you can use CakePHP or CodeIgniter If you use PHP5 you can use Symfony, CakePHP, CodeIgniter or the Zend Framework. CodeIgniter has good documentation and its 100% complete unlike CakePHP. http://codeigniter.com/ Of course PHP has many more frameworks than the ones I mentioned, there are probably well over 15, but those are the ones with the biggest amount of users. From what I've read the Zend Framework is more like a big library and lets you pick and choose what you want with no set structure. I've seen tutorials where others can use the Zend Framework with CakePHP, Symfony and CodeIgniter. The pros to sticking with PHP or a PHP framework is that you probably already know the language. Need security tips for PHP? Visit Chris Shiftlett's blog (he does a good job covering several issues, plus there are books on Apache Security and PHP Security, get them and read them). http://shiflett.org/ I dont see PHP dying anytime soon, there are way too many open source apps written in it, plus tons of new stuff is coming out, like SimplePie, and other good stuff. PHP Developer's web site has some good news on it. http://www.phpdeveloper.org/ Django and Rails have a downside to you having to learn a language and a framework and most often at the same time which makes things confusing for awhile. Django isn't 1.0 yet so while its stable, its still undergoing changes and nothing is exactly set in stone until the 1.0 milestone. Unfortunately there arent any Python books for just Web Development, so that makes it more of a challenge. Rails has a definate lead over Django, since there are well over 100 books on Rails and only like 2 planned for Django. Of course Rails was got more hype earlier on and came out before Django, plus the screencasts helped promote it, a lot. Pick whichever language or framework you want, there are pros and cons to them all.

  129. Re:What would you use for a fairly complex biz app by styrotech · · Score: 1

    I am leaning towards python and a python framework, but I am not happy about the deployment and configuration issues associated with python.


    There is nothing about Python web frameworks that is inherently difficult to deploy or configure. If anything they seem to be similar or even easier than Rails or Java web frameworks.

    But if you are coming from a PHP perspective it can seem harder. But that is really more to do with the ubiquity and popularity of PHP has artificially made it seem easier than the others. The web hosting world puts a lot more effort into supporting PHP than anything else - in fact it almost ignores everything else. If you want shared hosting for Ruby, Python, Java, .NET etc you really need to go to a specialist provider for those platforms.

    The lowest common denominator deployment/configuration requirements are easier with PHP, but once you start getting into more complex configurations the gap between PHP and more professional platforms gets a lot smaller.
  130. A Simple matter of Critical Mass by celtic_hackr · · Score: 1

    PHP users seem to spend inordinate amounts of time worrying about the latest exploit ...

    This is true of every successful application. Once any useful application reaches enough deployment, it
    becomes a target for malicious crackers. Furthermore, the more any application can do the more opportunity for
    security holes. Since languages are nothing more than complex applications, anything built on languages
    will have vulnerability opportunities. Yet further, the more important the information which is handled by an
    application the more determined the assault. Finally, I see no lack of exploits being found for Java
    either, with several exploits reported over the summer.

    That's all I have time for on this "article" without meat, and a jockeying of "my web software is better than yours",
    peppered with a few intelligent responses. Oh, wait, I forgot ... this IS /. ;')
  131. My web framework by martin_the_geek · · Score: 1

    I am putting together a framework at http://methodsupport.com/program/About.html for generating process/method(ology) support websites.

    The emphasis is on document (paper form equivalent) based processes automated quickly and easily.

    At this stage it is pre-alpha, but I hope to get a minimum feature set in place soon and upgrade it to alpha.

    The source is available from the Sourceforge page.

    At this stage, I need any comments or advice that anybody can give me.

    --
    Regards, Martin IT: http://methodsupport.com Personal: http://thereisnoend.org
    1. Re:My web framework by bryguy5 · · Score: 1

      I've used CakePhp extensively and have researched rails and symphony.

      PHP is a great choice for web development because of its ubiquiteness you are going to be running on an apache/linux stack or Windows/IIS webserver and I would choose between php or .net respectively. (or maybe JAVA if you are already using it) as your programming language. There are other options but I'm just looking at cheap hosting, available programmers, and free and example code.

      A framework is a huge benefit for keeping a medium or large project on track and organized amongst multiple programmers.

      The downside is extra overhead. If your business model/application requirements require a lot of hits/volume per server you may not have the option of the overhead. I would recommend load testing earlier than later. You may want to go with the framework to get the app working quickly and then rewrite it once successful to handle the volume.

      Ask yourself can you afford a front controller, Can you afford not to have a front controller?
      If the answer is no - you don't need a framework you need a library.

      More importantly can you afford an ActiveRecord implementation? - Does the caching help you or do you really need to hit the database everytime? Is it worth your time just to write your own queries?

      A good framework or library will get you over so many hurdles quickly so I highly reccomend it, but it is not going to perform as well as carefully crafted code that does only what it needs to and no more. Is speed of development or volume per server your biggest hurdle?

      Symphony and CakePHP are both great choices and can both be used with PHP5

    2. Re:My web framework by martin_the_geek · · Score: 1

      My framework works by code generation, so any overhead is at 'compile' time. Also, I am looking at office-internal systems, which typically are low volume , often 1-1000 users. By ActiveRecord, I presume you mean an implementation that saves recent records in RAM to avoid a database hit — I haven't got that far yet, and there is always the issue of co-ordinating multiple servers.

      --
      Regards, Martin IT: http://methodsupport.com Personal: http://thereisnoend.org
  132. Re:the answer: it depends by Dragonslicer · · Score: 1

    PDO has existed for quite a while now (bundled as of 5.1, available from PECL since 5.0). I would guess that the lack of support for prepared queries was because of the focus on MySQL, which didn't support much of anything beyond "SELECT *" until relatively recently. The newer versions of PHP (5.1.x and above) really are a vast improvement over earlier versions (I started during 4.0.x, so I remember the bad old days).

  133. Re:with MySQL, eh... so much for having a choice by szap · · Score: 1

    ...never trust benchmarks given to me by one of the two sides...

    Here you go. http://tweakers.net/reviews/649/7
  134. First language without sin cast first stone by Tablizer · · Score: 1

    For some real entertainment, check out the semantics of the === operator.

    Then don't use it. The only need to use it i've seen is a few cases where functions use zero-based character indexing when they should have used one. I get around it by appending a space to the beginning of the target text, emulating 1-based indexing. If you use a tool long enough, you learn to get around it's gotcha's. I've seen no evidence that PHP has significantly more gotcha's than other languages. EVERY language has a Corner Pile of Stupity where it appears the author was buzzed out on 60's substances for the day. You learn them and the work-around, and move on.

    Will the first language without sin cast the first stone.

    1. Re:First language without sin cast first stone by Anonymous Coward · · Score: 0

      PHP has a small corner of things it got right, and a large pile of things it got completely and fundamentally wrong. My work-around is to not use PHP if I can bloody well help it, but not because of stupidities like not even having anything like an eq operation and getting the concept of it completely wrong in the process, but because its idea of libraries is STILL to throw a bunch of crap into the global namespace.

      Hell, this whole conversation isn't even worth keeping my name on. Anon checkbox ahoy.

    2. Re:First language without sin cast first stone by Tablizer · · Score: 1

      but because its idea of libraries is STILL to throw a bunch of crap into the global namespace.

      Well, I hate languages that require instantiating wordy objects or that dot-postfix syntax for little things like slicing a string. That's one of the reasons why Java code gets so damned verbose such that Hello World takes 5 pages. I agree that PHP could have made the more obscure stuff into object libraries; but I've yet to have any significant name-space problems. Another molehill.

  135. ActiveRecord and my web framework by martin_the_geek · · Score: 1

    OK, I've looked up ActiveRecord now. What I am doing is similar but a bit more sophisticated, in that it can put together parent and child records into a single object. Also that it can generate the whole site this way, although you may want to add in some of your own code if you want/need.

    --
    Regards, Martin IT: http://methodsupport.com Personal: http://thereisnoend.org
  136. TIOBE by perrin_harkins · · Score: 1

    Did you notice the explanation of how they create the "TIOBE Index"? They run some Google searches and count the results. That's it. I wouldn't take it too seriously. And this person is asking about Ruby, which is miles below Perl on this index. In terms of actual jobs, this chart seems to show that Perl is doing quite a bit better than these other dynamic languages.

    I suspect Perl's strength in the job market has to do with what you mention as a weakness: it's association with things beyond just web development.