Slashdot Mirror


SolarPHP 1.0 Released

HvitRavn writes "SolarPHP 1.0 stable was released by Paul M. Jones today. SolarPHP is an application framework and library, and is a serious contender alongside Zend Framework, Symphony, and similar frameworks. SolarPHP has in the recent years been the cause of heated debate in the PHP community due to provocative benchmark results posted on Paul M. Jones' blog."

125 comments

  1. Symfony by royallthefourth · · Score: 1

    It's called Symfony, FYI

  2. blog by killmenow · · Score: 4, Insightful

    if his blog is running on this framework it's as slow as molasses

    1. Re:blog by nacturation · · Score: 2, Informative

      It is being Slashdotted right now, so it's not known whether the limitation is the framework speed, the server it's on, available bandwidth, database performance, or something else.

      --
      Want to improve your Karma? Instead of "Post Anonymously", try the "Post Humously" option.
    2. Re:blog by killmenow · · Score: 0, Flamebait

      Why yes I is, boss! An' I was a fuckin' yo mama just this mo'nin'.

    3. Re:blog by jo42 · · Score: 1

      He's running Wordpress. At least he could have of installed something other than a version of the hideous default theme that it comes with.

    4. Re:blog by Anonymous Coward · · Score: 0

      ...could have installed...
      Literacy rocks. Try it.

    5. Re:blog by XorNand · · Score: 1

      I once wrote a post on my blog that got frontpaged on /. and I had zero problems coping with the traffic. This was using Wordpress with the WP-Cache plugin on a modestly-powered server in a datacenter. I'm not really sure why so many people have issues (unless they aren't running WP-Cache, of course).

      --
      Entrepreneur : (noun), French for "unemployed"
    6. Re:blog by michaelhood · · Score: 1

      I once wrote a post on my blog that got frontpaged on /. and I had zero problems coping with the traffic. This was using Wordpress with the WP-Cache plugin on a modestly-powered server in a datacenter. I'm not really sure why so many people have issues (unless they aren't running WP-Cache, of course).

      Most people seem not to be aware of WP-Cache et al. It really should be rolled into the default base.. "if you are going to get more than a handful of visitors any time soon, check this box! [ ]"

  3. Foghorn Leghorn Alert by killmenow · · Score: 4, Funny

    That's a joke... I say, that's a joke, son!

    (just a little something I picked up in Sarcasm 101)

    1. Re:Foghorn Leghorn Alert by WrongSizeGlass · · Score: 1

      Someone should serve him up a mod point for the Foghorn Leghorn vernacular. Doesn't get much better than that curmudgeony old coc ... um, rambunctious rootser.

    2. Re:Foghorn Leghorn Alert by nacturation · · Score: 2, Funny

      I'm built too low. The fast ones go over my head. I got a hole in my glove. You keep pitchin' 'em and I keep missin' 'em. I gotta keep my eye on the ball. Eye. Ball. I almost had a gag.

      --
      Want to improve your Karma? Instead of "Post Anonymously", try the "Post Humously" option.
    3. Re:Foghorn Leghorn Alert by bwintx · · Score: 1

      Foghorn Leghorn upon being slashdotted: "Fortunately, Ah keep mah packets numbahed for just such an emuhgency."

      --
      Discussion System prefs link: http://slashdot.org/users.pl?op=editcomm
  4. Perfect timing... by Anonymous Coward · · Score: 0, Interesting

    Perfect timing. I was just about to write a rather complex web application. How does this (or PHP in general) compare to, say, PERL in the execution speed, memory usage, and code manageability aspects? I'm sure I can get some quality, unbiased opinions here on the topic.

    Thanks in Advance!

    1. Re:Perfect timing... by Sudheer_BV · · Score: 1

      I thought PHP is a programming language and Oracle a database.

      --
      Sudheer Satyanarayana
      www.techchorus.net
  5. google "cache:..." by MessyBlob · · Score: 2, Informative

    cache:http://paul-m-jones.com/?cat=27 into Google search (the original link). With any luck, the old content being referred-to might be there.

  6. Improving PHP by Anonymous Coward · · Score: 0, Interesting

    If the community wants to improve PHP they could start with making the function, class and method names case sensitive. For some unknown reason the powers behind PHP have chosen not fix this.

  7. At the end of the day... by Anonymous Coward · · Score: 0

    ... it's still PHP.

    Lipstick on a pig and all that.

    1. Re:At the end of the day... by Anonymous Coward · · Score: 1, Funny

      What does Sarah Palin have to do with this?

    2. Re:At the end of the day... by evanism · · Score: 0, Flamebait

      any PHP framework cant be as slow as Palin

      --
      Just bought a new quantum computer, but I'm uncertain how it works.
    3. Re:At the end of the day... by Narcocide · · Score: 1

      I dunno man Joomla is pretty fucking slow...

    4. Re:At the end of the day... by Anonymous Coward · · Score: 0

      He was offered a job as a lead php developer.

    5. Re:At the end of the day... by Anonymous Coward · · Score: 0

      He was overqualified.

  8. Performance? by palmerj3 · · Score: 1

    I think the 18 second load time the homepage is experiencing now should help discredit the benchmark results

    1. Re:Performance? by Sollord · · Score: 2, Informative

      Till one realizes that the site is posted on /. of all places and it might impact the server a small amount.

    2. Re:Performance? by Fnkmaster · · Score: 1

      Except that it uses Wordpress rather than PHPSolar or whatever it's called. Thus having no bearing whatsoever on the discussion.

      Epic fail.

    3. Re:Performance? by sootman · · Score: 1

      Is that "epic fail" on the part of the parent for not researching before he commented and being wrong, or "epic fail" on the part of the site owner for using WP instead of eating his own dogfood?

      --
      Dear Slashdot: next time you want to mess with the site, add a rich-text editor for comments.
    4. Re:Performance? by edrobinson · · Score: 1

      Home page loads in 2 seconds in my environment. Maybe it's that dialup modem under your desk - LOL

  9. Yet another... by menkhaura · · Score: 3, Insightful

    Yet another PHP framework. Won't this ever stop? Won't the development efforts ever be directed to only a handful of frameworks, to get the best we can instead of a gazillion half-(or un-) documented, over-(or under-) engineered frameworks?

    --
    Stupidity is an equal opportunity striker.
    Fellow slashdotter Bill Dog
    1. Re:Yet another... by BitHive · · Score: 3, Funny

      That's the beauty of PHP. Everyone rolls their own everything because they can do it better than the other guy(s). That's why PHP remains the most vibrant community for web developers: there is a huge exchange of ideas that get recycled into new frameworks every day. Unlike other web development environments where you have to contend with other people's conventions who probably aren't as smart as you. When you go PHP, you know you're getting quality because it takes a special type of developer to wield the incredible power that raw PHP gives you.

    2. Re:Yet another... by ArundelCastle · · Score: 1

      Oh, you mean a PHP cartel.
      Sure, that usually turns out fine.

      Also, if you happen to be involved in any open source projects, could you please stop diluting the workforce and just go work for somebody established? You're hurting the big guys.

    3. Re:Yet another... by onion2k · · Score: 1

      There aren't really any more production-ready frameworks for PHP as any other language. It's just a good deal easier to 'promote' a new PHP framework because people are so willing to put the story on a tech news website knowing that it'll generate plenty of chatter (mostly about how awful PHP is).

      When a framework developer starts selling their code on the basis of execution speed rather than ease of use, flexibility or completeness you know you can ignore it. Any proper framework will cache templates into native code, or maybe cache content into static HTML, so the speed of the framework itself is meaningless - a good one does at little as possible for each page view.

    4. Re:Yet another... by Anonymous Coward · · Score: 2, Insightful

      Yes, its totally beautiful that literally every time one gets involved in a PHP project some assclown involved has already decided to use the fad of the week framework, increasing frustration and limiting productivity as you search furiously for the non-existent documentation / examples to find the "framework" way to do some mindnumbingly simple operation that should have never been wrapped in a framework in the first place.

      Invariably the individual who has decided to use the framework usually has worked with it on a limited basis if ever before, and only wants to learn it because he's heard on some blog that it will increase his productivity. Since the average framework has a lifecycle of approximately 1 project all he's really done is slowed development of that project immensely to pick up a braindead API he will never see again.

    5. Re:Yet another... by nurb432 · · Score: 1

      Its not just PHP, the entire OSS world is like this..

      Everyone wants their own wheel as no one likes painting a wheel that belongs to someone else.

      --
      ---- Booth was a patriot ----
    6. Re:Yet another... by Kjella · · Score: 2, Insightful

      I don't know if you're trying to be funny but what you describe is framework spaghetti. Everybody thinks they know how to do it better, so they keep reinventing the wheel - poorly. Producing frameworks that aren't stable aren't frameworks, it's just make as you go implementation with a nice name and likely to be thrown out and started all over again by the next guy who favors a different one because nothing is really standard or a convention. But I suppose it keeps web developers paid...

      --
      Live today, because you never know what tomorrow brings
    7. Re:Yet another... by iamgnat · · Score: 2, Informative

      When you go PHP, you know you're getting quality because it takes a special type of developer to wield the incredible power that raw PHP gives you.

      You forgot a /s right? Cause you have to be joking.

      PHP is indeed a powerful language, but your average PHP developer has no clue what they are doing if they can't just copy and paste it from somewhere (and then they still have trouble explaining how it's doing it). I'm not saying that there are good PHP people out there (I know a few actually), just that it has been the language of choice for anyone that picks up a book and thinks they are now a programmer for some time.

      In my last job I worked extensively with PHP and often rolled my own libraries and objects even when the basic functionality exists simply because I disagree with fundamental decisions that were made (like how they (don't) handle errors being the most common. PHP supports Exceptions for christ sake. Use them!).

    8. Re:Yet another... by OzRoy · · Score: 2, Insightful

      This is what is so annoying about all these new frameworks.

      From a business point of view I will not develop with anything other than the most popular frameworks because if I need to hire a contractor, or even a new employee, it is more cost effective to use a popular framework that I don't have to train them in.

    9. Re:Yet another... by evanism · · Score: 3, Insightful

      I agree. The last 6 projects I've had the misfortune to take over were like this... unwieldy, evilly complex and error stuffed. What should have been simple was insanely complex. It took 4 to 6 weeks just to get anyone working on anything. I could have coded it in flat PHP in 2 days. Frameworks are the death of projects and its one of the reasons I no longer love programming.

      --
      Just bought a new quantum computer, but I'm uncertain how it works.
    10. Re:Yet another... by Anonymous Coward · · Score: 0

      No.

      This is the nature of open source. Opinions are like arseholes, everyone has one and everyone else's stinks. What is the 'best we can' ? Does the we in that sentence include me because it doesn't look like we'd agree?

      And this is where open source keeps tripping over it's own toes. You can't please everyone all the time. And the natural response from the majority? ... fork-off. So we end up with 670 different Linux distributions, 150 AJAX libraries, 50 mature PHP frameworks, multiple mature mysql distros. And everything has it's own foibles, problems, syntax, configuration settings ... gah!

      PHP has a beautiful API! If this isn't enough of a framework for you, enhance it. Anything not targeted at the base API isn't worth considering.

    11. Re:Yet another... by larry+bagina · · Score: 1

      "the other guys" is often "core PHP developers". For many tasks, they've got two or three half-assed functions that sort of do it, but depending on the version, the number (sometimes order) of parameters they take differs, so you might as well write your own function instead.

      --
      Do you even lift?

      These aren't the 'roids you're looking for.

    12. Re:Yet another... by biryokumaru · · Score: 0, Flamebait

      I'm not saying that there are good PHP people out there

      Good. Neither are we.

      --
      When you're afraid to download music illegally in your own home, then the terrorists have won!
    13. Re:Yet another... by ducomputergeek · · Score: 1

      Sounds like one of our recent projects. The programming team spent a week debating which PHP framework was the "best" framework for the project. Especially when they got into "does it have a library/module/api for service XYZ?". I got frustrated and hacked together a functional prototype in Perl over that weekend. No frameworks other than CPAN modules. It was admittedly ugly code (I'm the systems guy), but the programmers were able to take my foundation and complete the project about a week ahead of schedule for once. Every time they need some API or function, there seemed to be a Perl Module for it already in CPAN, tested, and pretty much exactly what was needed.

      PHP guys are easier to come by these days, but the last few PHP projects I've been involved in, it seems like they spend a lot of time trying out the Popular Framework of the year, only to decide to roll their own. I may be biased, but a lot of the projects seems like they could have been almost done if they just gone with Perl.

      But I'm just a systems guy. I'm biased towards Perl because I like getting shit done.

      --
      "The problem with socialism is eventually you run out of other people's money" - Thatcher.
    14. Re:Yet another... by Ukab+the+Great · · Score: 1

      While I am philosophically opposed to Ruby as a programming language, I ultimately decided to do all of my web development with Rails because the Ruby community (unlike the PHP community) puts all their development efforts behind a single, standardized framework that can have lots of books, tutorials, and examples written about it.

    15. Re:Yet another... by Anonymous Coward · · Score: 0

      You missed the point, here, then. Ruby itself is the fad of the week, and there is no competition within that ecosystem because nobody else except the Rails fad-seeking web develotards even give a shit about it. I reiterate that practically nobody gave a shit about, or even knew of, Ruby until the "Ruby on Rails" blog spampaign by that egocentric shitstain of a lead developer began. It's essentially an immature language previously relevant (and I may be assuming too much here, even) only in deep, dark corners of academia. Look at Twitter: it's always a great idea to run on a platform where much of your developer time is spent optimizing the language's virtual machine because it has never been scaled to a production implementation before, right?

    16. Re:Yet another... by Anonymous Coward · · Score: 0

      Last time I checked the pear stuff was outnumbering the cpan stuff. NB: I don't really code in either language anymore.

    17. Re:Yet another... by Anonymous Coward · · Score: 0

      Just curious, why are you philosophically opposed to Ruby?

    18. Re:Yet another... by truthsearch · · Score: 1

      Frameworks are just another tool. They're only useless for the smallest of projects. Most web apps need a basic set of features, which any decent framework will easily provide, alleviating the nuisance of having to rebuild that functionality for each project.

      Frameworks aren't a good tool for every project. That doesn't make them evil.

    19. Re:Yet another... by DaVince21 · · Score: 1

      If it's a sturdy wheel, people won't mind. Otherwise, Qt and GTK wouldn't be doing so well...

      --
      I am not devoid of humor.
    20. Re:Yet another... by thetoadwarrior · · Score: 1

      Why? The nice thing about freedom is you can try it your own way. Maybe you won't do it any better but at least you can try. Someone can come along and take your best bits and combine them with the best bits of other frameworks and make the Godzilla of frameworks if they want.

      If you feel the documentation of your favourite framework sucks then contribute. Making a great framework isn't just about writing code.

    21. Re:Yet another... by Anonymous Coward · · Score: 0

      cache templates into native code

      That is what smarty 'tries' to do... why can't people just write the php code themselves? Are they that dumb?

  10. Phpulse is still faster by Foofoobar · · Score: 0, Redundant

    Phpulses benchmarks still put it at 5 times faster than Solar without any caching.

    http://www.phpulse.com/benchmarks/?area=86

    --
    This is my sig. There are many like it but this one is mine.
  11. No. by weston · · Score: 1

    Yet another PHP framework. Won't this ever stop?

    No. It won't. There's probably always going to be new ideas about abstractions with the potential to save developers effort once they're implemented. I should hope so, anyway.

      Won't the development efforts ever be directed to only a handful of frameworks?

    The lion's share of attention is certainly directed towards a handful: Cake, Symfony, Zend (not actually a framework), and CodeIgniter probably topping the list, others like Akelos or Zoop or TinyMVC probably farther down but still striking the fancy of developers here or there.

    But it pretty much comes down to developer itches, and the fact that thoroughly understanding a system is usually a task roughly equivalent to writing it.

  12. Re:Rails 3.1 Comparison by rho · · Score: 1

    Yeah, because Rails is being used everywhere.

    --
    Potato chips are a by-yourself food.
  13. No more frameworks please! by Hurricane78 · · Score: 4, Interesting

    They are by definition antisocial, expect everything to revolve around them and don’t want you to use just pieces of them.

    Give us just a nice set of libraries. That’s it.
    Let us choose what parts to use, what parts to get from other libraries, and what not to use at all.

    Frameworks are like having to buy a bundle offer at the supermarket, when all you need is one part of it, and then at home also noticing that the parts are not playing nice with everything else.

    But I hope the craze will be over soon, just like the Flash intro craze, the Java Applet craze, etc.

    --
    Any sufficiently advanced intelligence is indistinguishable from stupidity.
    1. Re:No more frameworks please! by Aladrin · · Score: 1

      I've never understood this. Why are you telling other developers what to do with their time? If you don't want their framework, IGNORE IT. If you want libraries, build them.

      --
      "If you make people think they're thinking, they'll love you; But if you really make them think, they'll hate you." - DM
    2. Re:No more frameworks please! by Anonymous Coward · · Score: 0

      I briefly visited the website and couldn't find the gitweb or equivalent so that I could laugh at the source code. I did however find the class documentation to be amusing. eg:

      $struct->addNewKey = 'something new has been added';
      echo $struct->noSuchKey; // 'something new has been added'

      Pfft!

      I've already got all the useful functionality as libs that I authored myself and my code is probably of a higher standard. My vote would be to replace the term "web framework" with the term "web programming clusterfuck"; it's a much more realistic description. I doubt that even that change would stop poor programmers mistaking the authors self-promotion for programming ability -- which is the only way to explain the popularity of "web programming clusterfucks".

    3. Re:No more frameworks please! by Michael+Kristopeit · · Score: 3, Funny

      I've never understood this. Why are you telling other developers what to do with their time? If you don't want their framework, IGNORE IT. If you want libraries, build them.

      you do realize that you are doing exactly what you are claiming you don't understand why people do, don't you?

    4. Re:No more frameworks please! by corychristison · · Score: 1

      I am in complete agreement with you.

      I write all of my code. I re-use a lot of code I write in virtually every project I've ever worked on.

      Sometimes I only need one very simple part of that code (eg: session management). I should (and I do) only need to include one file. That's it. One file.

      I am disgusted with PEAR. Zend does not appeal to me and at a first glance this SolarPHP looks horrible. Just peeking at the index.php file it does not look nice. And they don't appear to close half of their .php files with '?>'. Why is that?

    5. Re:No more frameworks please! by Anonymous Coward · · Score: 1, Informative

      And they don't appear to close half of their .php files with '?>'. Why is that?

      Because you avoid errors with trying to send headers after output since someone left whitespace at the end of a ?>

    6. Re:No more frameworks please! by Anonymous Coward · · Score: 0

      FYI Zend Framework _is_ a library. You can selectively use different elements as needed in plain old PHP scripts or with other frameworks. I've used it as a library for both CakePHP and CodeIgniter apps.

    7. Re:No more frameworks please! by profplump · · Score: 1, Informative

      No closing ?> tag?

      Because it's not XML, and it does not need to balance. The closing tag is just there to stop PHP processing and return to normal text mode. If you have no normal text to display it's completely optional. Heck, it might even help keep you from having trailing space/newlines/etc. at the end of your programatic output.

      Now I personally prefer to close everything, and would never leave a hanging opening tag, but it's has no benefit toward processing the page.

    8. Re:No more frameworks please! by jjohnson · · Score: 4, Informative

      As the AC noted below, it's considered a best practice to omit the ?> to avoid accidentally including non-processed whitespace after the closing tag when you include the file. If someone hits space after ?>, and you include that file and then try to print a header, it causes an error.

      --
      Anyone who loves or hates any language, platform, or manufacturer, doesn't know what they're talking about.
    9. Re:No more frameworks please! by shelterit · · Score: 0, Flamebait

      > And they don't appear to close half of their .php files with '?>'. Why is that? Ah, now that is because they are smarter than you. :) The hints are; 1) whitespace control, 2) conscious idea of separating code and markup, and 3) slight but minuscule speed improvement.

      --
      -- Home, James - it doesn't matter where that thing has b
    10. Re:No more frameworks please! by royallthefourth · · Score: 1

      Many developers end up picking up the pieces of halfway finished projects leftover by others; nobody works in a vacuum.

      A good developer should care about what others are doing for a variety of reasons.

    11. Re:No more frameworks please! by Anonymous Coward · · Score: 0

      I don't care what they spend their time coding, its when they start to spew marketing-grade bullshit about the capabilities of their personal libraries, package them as a framework, and proceed to infect developers and fragment public domain code with yet another unnecessary, unoriginal, poorly conceived and poorly documented set of code generation tools that I get irate.

      Fuck this guy and fuck his new framework. The world needs another PHP framework like I need a hole in my head.

    12. Re:No more frameworks please! by Anonymous Coward · · Score: 0

      Solar *is* just a nice set of libraries. It has a separate application skeleton for those who want to get up and running quickly, as well as CLI tools to generate pieces of the basic structure.

    13. Re:No more frameworks please! by Anonymous Coward · · Score: 0

      I am happy you didn't get basted for the ?> comment. Good job everyone on showing restraint and taking the higher road.

      Truth is, when you think you've learned everything there is to know about the intricacies of languages and best practices... You've missed something and need to go back to the books. I'm slowly learning that lesson. Judgment requires experience and you need to know when you've got the experience.

    14. Re:No more frameworks please! by Dexx · · Score: 1

      I've seen other frameworks do that as well. Why not just make sure there's no whitespace at the end of the file? It's not that hard.

      --
      Feel the fear and do it anyway.
    15. Re:No more frameworks please! by Chris+Graham · · Score: 1

      cpanels online editor used to add them (maybe still does), possibly others do. It's easy for an online editor to accidentally do if they put some LF's before closing a textarea tag.

    16. Re:No more frameworks please! by amn108 · · Score: 1

      It's not that simple. What other web developers do, in the end bites YOU in the ass. Either in form of your boss asking you one sunny day "So, have you had any chance to experiment with that new Joomla thing?", and as you go on in your head "Noooo, please, not THAT conversation again!", he continues "You know, we expect our developers to pick up on the popular new technologies." Bla bla bla.

      The butterfly effect of the programming business. So, don't talk like, anyone can do whatever the hell they want with their 'puter. Frameworks sometimes negatively affect developers who have never heard of them, or never WANTED to, for all the good reasons. If it's not your boss telling you what to do, it also happens some client pulls you in for a job, and then you discover you are in for redesigning their Joomla/EZ/Wordpress/Asswork website. Something the client did not assume to mention, because they think all developers can develop anything using anything. Sort of like if architects were expected to design a functional house, sketching with crayons on ricepaper.

    17. Re:No more frameworks please! by amn108 · · Score: 1

      I completely agree with you. I don't think the craze will stop ever though. Part of the whole culture survives on the money, and money math unfortunately favors less work for more pay, i.e. using (leaky) abstractions that cut costs to get paid, even if the framework goes under later, it's not anybody's concern (except the client of course), because legally, the job was done. If you stretch this logic, you can see it is the same reason nobody codes in assembly for commercial production anymore - people always look for better tools. Sometimes though they find tools originally either made for something else (Flash) or the tools are so specialized, that even though they appear to fit perfectly for a particular kind of task, once the constraints or goals of this task change, it's a dead end for the tool user.

      I have a contact that tries to make a generic website, using Wordpress for some reason. I have asked why Wordpress, a blogging CMS, but the person cannot give a good answer. They had used it before for blogs, came to like its ease of use, and came to think it should also fit fine for anything else than blogs, despite the fact that Wordpress goes pretty far to mark itself as a blogging CMS, nothing else. The human element fails?
      Needless to mention, the person is pulling his hair now, because they need completely different functionality than Wordpress includes or easily allows for. But it is a bit too late, because a month was spent to set up the Wordpress site...

    18. Re:No more frameworks please! by CopaceticOpus · · Score: 1

      You have discounted the Zend Framework, but perhaps you should give it another look. It does exactly what you describe. If you want session management, you only need to include one or two files. You can ignore the rest of ZF and just take what you need! The code is generally clean and well documented.

      Zend Sessions: http://framework.zend.com/manual/en/zend.session.basic_usage.html

    19. Re:No more frameworks please! by thetoadwarrior · · Score: 1

      Don't use them then. PHP is nice and easy. You don't need frameworks and you can easily write your own. In my spare time I'm slowly building a PHP based CMS and it is very slowly because working on CMS systems as a day job means I find it hard to code them in my free time unfortunately. It will do what I want and hopefully be useful to others as I'll most certainly give it away and do something again to contribute to open source. It may fail and everyone will think it's shit but it will run my sites and I'll use it for others where I feel necessary so it will be as successful as I hoped. Anything over that is a bonus. Just helping one person get into programming is quite satisfying as it is especially if you help them do it properly.

  14. Re:Rails 3.1 Comparison by BitHive · · Score: 2, Interesting

    If we used what was everywhere everyone would be developing websites in .NET to deploy on their Windows intranet. But it's a lot easier to be sarcastic than have a point other than "lol nobody uses Rails" (as if that were even close to true).

  15. Re:Rails 3.1 Comparison by Anonymous Coward · · Score: 0

    So instead of a web framework in PHP, you're suggesting they use... a web framework in Ruby.

  16. Re:Rails 3.1 Comparison by BitHive · · Score: 1

    Masterfully observed

  17. Zend Framework For You, then by weston · · Score: 3, Informative

    Give us just a nice set of libraries. That's it.

    Pretty much Zend Framework in a Nutshell. Totally misnamed -- there is no Framework. It's a set of disparate libraries organized into a sort of class hierarchy that happens to have amongst it a Controller class.

    1. Re:Zend Framework For You, then by giuntag · · Score: 1

      Totally agree - and yet naming the eZ Components that way lost 50% marketshare to the zend framework on day one. Talk about fads not existing in the it world...

    2. Re:Zend Framework For You, then by Anonymous Coward · · Score: 0

      What I really want to see is a tutorial on getting started with Zend using it as a library instead of a framework.

  18. Re:Rails 3.1 Comparison by thasmudyan · · Score: 2, Insightful

    You may have a valid point, but I can't get over the trollish way you souped up those code examples to prove your point. You made the PHP example over-commented, bulky and redundant on purpose. A more accurate counterpart would more likely look like this:

    public function actionIndex()
    {
        $this->list = $this->_model->blogs->fetchAll(array(
            'where' => array('blogs.status = ?' => 'public'),
            'order' => 'blogs.created DESC'
        ));
    }

    Without knowing the actual library used for the PHP example, there might be saner and less ugly variants.

  19. Debate? by thePowerOfGrayskull · · Score: 1
    Let's see... the "debate" consists of 17 comments on some dude's blog.

    Curious, I searched for solarphp debate and the first 12 results are a verbatim cut-n-paste of the same summary that was copy-pasted into the Slashdot article.

    The subsequent results don't even touch on any kind of performance testing with solarphp. So, um... why is this on the front page again?

  20. Re:Rails 3.1 Comparison by Anonymous Coward · · Score: 0

    You could also abbreviate every. posts == p, Post to P, and status to s. and public to p, and created to c. Then it would be.

    @p = P.where(:s => 'p').order('created DESC')

    Even less typing. cause typing is so tedious and IDE's have autocomplete and copy paste.

    But then in PHP I could use something like http://framework.maintainable.com/mvc/3_model.php

    Or
    http://www.doctrine-project.org/
    http://xyster.devweblog.org/
    http://propel.phpdb.org/trac/

    And they may not be as AWESOME, but they're alright.

    In the end it depends what you want to do, how long you have to do it, what your stuck working with, and how fast it needs to run.

  21. What is the point of PHP frameworks? by SlappyBastard · · Score: 1

    I admit, I code a lot of PHP. And I have never felt the need to take a serious look at using any frameworks. Isn't the entire point of PHP that it makes a great rapid development platform?

    --
    I scream. You scream. I assume that means we're both acquainted with the problem. We proceed.
    1. Re:What is the point of PHP frameworks? by tthomas48 · · Score: 1

      I'd say that the reason PHP is so grate for rapid development is that it has a fantastic class library. I find that I need a good framework in any language for certain size projects. I'll admit that I use my own in my projects because when I started working in PHP there weren't good MVC or ORM libraries.

      But if I'm doing a five page site I'll just embed the html. But I think what you're describing is what makes a good developer. Are you smart enough to know when you should be using a framework and when you should be writing straight php files with markup embedded (and how to write the later so you can eventually move to the former if necessary)?

    2. Re:What is the point of PHP frameworks? by PhantomHarlock · · Score: 1

      I've found that as a hobbyist programmer, frameworks force me to be much more organized with my code by giving it structure. By the last project I did before I started using CodeIgniter, I had gotten pretty neat and organized, but CI takes it to a new level.

    3. Re:What is the point of PHP frameworks? by tthomas48 · · Score: 1

      I've found that too. I'm a java programmer professionally, but use PHP for my hobbyist stuff (which includes buyplaytix.com which is a pretty large app). And I find I have to find a balance between write-once and so cumbersome that I won't actually write new code. My favorite piece of code is one class that I feel perfectly straddles the line between ORM and writing ad-hoc SQL. And that's something I think PHP does really well. Finding that balance between over-the-top architecture and the completely unintelligible scribbles.

  22. forget all this what about HIPHOP compiled PHP by Anonymous Coward · · Score: 0

    Another framework. Big whoop. I'm more interested in things like HIPHOP that allow you to compile PHP to code for fast performance.

    http://developers.facebook.com/news.php?story=358&blog=1

  23. How does it compare to CodeIgniter? by PhantomHarlock · · Score: 1

    Anyone who's used both have an opinion of how it compares to CodeIgniter? I've done one project in CI and I've been pretty happy with it, thinking of using it to do some larger projects soon. It forces you to have neat, short code. Disadvantage is it's spread out a little more between files, but with an application like TextPad I can move back and forth between those files pretty easily.

    Looking at Solar, it does look like it has a crapload of classes that do useful things without having to reinvent the wheel. CI looks relatively smaller in comparison.

    The thing I like about CI is you just load the libraries or classes that you need for that particular app, so it remains very lightweight.

    1. Re:How does it compare to CodeIgniter? by Anonymous Coward · · Score: 0

      There are only a handful of classes required during a request on a bare-bones controller. Everything else is loaded as needed.

      Some of the structuring in Solar is very different to other frameworks. Models are loaded through the model catalog, and depending on the query can return either a single model record, or a model collection of records (these are basically structs so they can be treated as objects or arrays).

      If you don't see the sense of it, you will when you use it. Solars methodologies make it extremely flexible, so anything can be changed or extended if required.

  24. Clarification by Anonymous Coward · · Score: 1, Informative

    Pauls blog is indeed running Wordpress, but that's all it is - a personal blog. The framework site itself runs on Solar.

    This "performance debate" that people keep mentioning started back in 2006 when Paul benchmarked a select few frameworks (http://paul-m-jones.com/?p=236). Now even the creator of Symfony uses this method to compare performance. And Solar is still faster.

    It's not a new framework on the block. It has been in development for years and can behave as a full-stack framework, a collection of libraries, or something in the middle. Even Zend has borrowed ideas from Solar (http://paul-m-jones.com/?p=1113).

    I like to think of it as a framework for people who already know PHP. Having worked with CakePHP, CodeIgniter and a few others, there are far too many people in those communities who think that by using a framework they don't need to learn how to program. I'm pretty confident these people won't understand Solar. Hooray!

    Things to love about Solar: http://www.solarphp.com/trac/core/browser/trunk/info/description

  25. Bad Mod Alert. by weston · · Score: 1

    (Score:0, Offtopic)

    While the smugness of the parent post could be interpreted at a stretch as flamebait or trolling, it's in no way offtopic. Comparing code density/expressiveness between frameworks is topical.

  26. Re:Rails 3.1 Comparison by DavidTC · · Score: 1

    Um, why stop there? Forgive my lack of indent, I can't be bothered to figure it out.

    That function can be identically written as:

    public function actionIndex() {
    $this->list = $this->_model->blogs->fetchAll(array('where' => array('blogs.status = ?' => 'public'),'order' => 'blogs.created DESC'));
    }

    Also, I have the feeling that 'blogs' was just thrown in to make it longer. This calls a function on a 'blogs' object, which is presumably linked to the blogs table somehow, and will presumably use 'blogs' by default. You can just use 'status' and 'created' as the Ruby example does. So:

    public function actionIndex() {
    $this->list = $this->_model->blogs->fetchAll(array('where' => array('status = ?' => 'public'),'order' => 'created DESC'));
    }

    Also, I don't know in what universe you commonly pass a single array to functions instead of, you know, actual function parameters. While I'm sure in some universe there's some framework that lets you do that, in reality you'd have a fetchAll($where,$order=NULL) function that you could use here, with array passing used for really options stuff, and an array passed in for $where. And, also, inexplicably, your function name has doubled in PHP.

    So it would more likely be something like:

    public function index() {
    $this->list = $this->_model->blogs->fetchAll(array('status = ?' => 'public'), 'created DESC');
    }

    Vs:
    def index
    @posts = Post.where(:status => 'public').order('created DESC')
    end

    Yeah, that's massively shorter. Why, in PHP, you have to...um...explicitly use $this to access your own class and use array() to make an array. The horrors, the horrors!

    Why on earth you're writing a public function for this is beyond me, though. I think you just did that because PHP takes longer to define a public function.

    A sane programmer would just, instead of defining a class to have actionIndex() on, and then making such an object, and then calling $random_obect->actionIndex(); and then $records = $random_obect->list(); would just do this:

    $records = $this->_model->blogs->fetchAll(array('status = ?' => 'public'), 'created DESC');

    --
    If corporations are people, aren't stockholders guilty of slavery?
  27. Re:Rails 3.1 Comparison by DavidTC · · Score: 1

    I realized after I posted that I said 'you' a lot, and I was really talking about the grandparent, not you, thasmudyan.

    --
    If corporations are people, aren't stockholders guilty of slavery?
  28. Re:Rails 3.1 Comparison by BitHive · · Score: 1

    Actually I pulled the sample straight from the documentation for the project in the OP.

  29. Re:Rails 3.1 Comparison by BitHive · · Score: 1

    You seem to think I made up that example, when in fact I got it from the SolarPHP documentation: http://solarphp.com/manual/blog-demo.app.index#blog-demo.app.index.action

  30. Re:Rails 3.1 Comparison by BitHive · · Score: 1

    You also assume a lot about what the Ruby code is doing; this is where my Rails example is from: http://m.onkey.org/2010/1/22/active-record-query-interface

  31. Re:Rails 3.1 Comparison by BitHive · · Score: 1

    Look I'm sorry if I offended you, I didn't mean to cause so much outrage just by comparing code excerpts directly from the SolarPHP documentation ,with an example adapted from upcoming Rails 3.1 documentation.

    You sound like someone with a fair share of experience with informed opinions about the tools you like to use. Well, me too. I think your last remark is dead-on, but I had a different point I was trying to make. I never said "Rails is awesome, everyone should use it all the time!"

    I have to say though, your counterpoint is a bit forced. It's not about reducing keystrokes at all costs, it's about providing the programmer with useful abstractions and reducing the need for him to repeat him or herself. Let's be real here and just admit that PHP doesn't make this easy for frameworks.

  32. Re:Rails 3.1 Comparison by Bill,+Shooter+of+Bul · · Score: 1

    Why is every framework example about demonstrating how to create a blog?

    --
    Well.. maybe. Or Maybe not. But Definitely not sort of.
  33. Serious spagetti by Aethedor · · Score: 1

    A simple 'grep' told me that this framework has 820 PHP files. I know the Solar site holds lots of documentation, but to know and understand a framework, I want to see what the code looks like. Just to get an idea of its quality and security. With 820 files, there is no way I'm every even going to give it a try. In my opinion, it should take less time to understand a framework than it takes time to build your own simple framework. This framework, with its many files and 'complex' structure and object extending, definitly failed on that one. Another one for my ignore list.

    --
    It doesn't have to be like this. All we need to do is make sure we keep talking.
  34. Re:Rails 3.1 Comparison by amn108 · · Score: 1

    To paraphrase MadTV's Snoop Dogg video parody, "it's all about the blogz, baby, it's all about the blogz." I am ironic of course, but let's face it - the media paints this picture of Internet that is full of blogs.

  35. But it also allows new things to happen by SmallFurryCreature · · Score: 3, Insightful

    "Real" developers love to hate PHP because it goes against their rules, meanwhile the little language that could is the largest web language around. More site are run on PHP then anything else.

    Why? Because it can. All the devs who want standards and a standard framework are the kinda dev's that take six months to produce the first draft of the first requirement pre-meeting agenda action point item. Sure, that is great if you work for the state or the fortune 500, but the new stuff happens with tiny companies started in someone's garage where the code has to be working yesterday.

    As soon as other languages become capable of "just producing a site now", then PHP will start to becomes less dominant.

    And yeah, this practice does result in thousand of badly written site in urgent need of being cleaned up. That is not a bad thing, if it was left to the ruby crowd, those sites would never have seen the light of day.

    For people who understand business, having to rebuild your shop because it has become to small after a year is NOT a sign that you chose the wrong shop. It is a sign you did well. Only developers totally removed from the realities of daily life don't get this.

    Oh and if you need conventions in your programming, aren't you really saying someone needs to hold your hand? For me the only quality measurement that works for software in the end is "does it allow the owner to make money". It can be the most horrible spaghetti code you ever saw, but if it allows the company to flourish and grow, then it is good code. I have seen to many "proper" development on very large projects that followed all the conventions and produced steaming piles of crap that were unusable. Look to every single government IT project for examples.

    --

    MMO Quests are like orgasms:

    You may solo them, I prefer them in a group.

    1. Re:But it also allows new things to happen by The+Clockwork+Troll · · Score: 1

      Oh and if you need conventions in your programming, aren't you really saying someone needs to hold your hand? For me the only quality measurement that works for software in the end is "does it allow the owner to make money". It can be the most horrible spaghetti code you ever saw, but if it allows the company to flourish and grow, then it is good code. I have seen to many "proper" development on very large projects that followed all the conventions and produced steaming piles of crap that were unusable. Look to every single government IT project for examples.

      You're creating a false dichotomy. There is an apex where team, code, and product quality meet and support a great business to boot. I've been blessed to sit atop it (ouch!) and hope one day you can, too.

      --

      There are no karma whores, only moderation johns
    2. Re:But it also allows new things to happen by intel352 · · Score: 1

      have you ever tried to deal with the spaghetti "slap" code created by a developer to get a project done, that then needs further maintenance and features going forward? MUCH simpler with conventions, whereas otherwise you're dealing with B.S. quality code, trying to find what function does what/where, and figure out why the hell the previous person copy/pasted his code into 20 different files instead of just creating a single include or function. Conventions are good to have. I agree frameworks will slow you down if using for just one project with no prior experience, that is), but conventions will save your ass past the initial completion date of a project.

  36. Yes, it is by SmallFurryCreature · · Score: 1

    The "problem" is what do you do if you do not have your own library of functions written? Or the company doesn't?

    Then you can use a framework to get the basics down. Like for instance database abstration. What you say? That is already part of PHP...

    Actually, I get your point entirely. It is the same with smarty... why on earth should you use a template language, in a template language?

    I think all of this is partly because people expect it.

    PHP is a scripting language, closer to perl then C or Java and people are not really used to such languages. They have always been considered to be to primitive.

    And so the "proper" developers have always had a thing against PHP that allowed just anybody to start producing code and working web sites. You can see in a lot of frameworks the attempt to force PHP to become another language.

    Do you need a framework? No, unless you come from a background where just raw coding is not how you do things. There is a difference between scripting and "programming". Please don't hang me up on those terms, but you probably get my meaning if I say the average Java developer would choke on Perl and the average Perl developer considers Java to be hopelessly over engineered.

    One of my favorite discussions was with a Java developer about PHP's lack of proper garbage collection... he spend several hours trying to explain how important garbage collection is, in a script that runs for a few miliseconds and then is cleared completly from memory. It is like claiming that you absolutely need a parachute, on a kamikaze plane.

    --

    MMO Quests are like orgasms:

    You may solo them, I prefer them in a group.

    1. Re:Yes, it is by SlappyBastard · · Score: 1

      The "problem" is what do you do if you do not have your own library of functions written?

      I don't view myself as a hardcore coder by any means. I actually came to PHP from a college background geared more toward design, although I had coded some BASIC, Pascal, C and C++ as a kid. What I realized almost instantly when I got into the real world is that almost any system that prepped anything for you in advance has glaring limitations.

      And that goes all the way from learning that FrontPage sucks to learning that server-side includes suck all the way down to learning that frameworks are limiting.

      And, yes, I understand from experience there's a point where you're going too low-level. Hell, I've coded stuff in assembly (great learning experience, not peculiarly practically on a daily basis for most folks).

      For me, coding most stuff from scratch in PHP while keeping a few libraries of my own code that handle everyday stuff (SQL connects; scrubbing POSTs, GETs, cookies, files, etc.; money conversions; date conversions) was where the balance was struck.

      --
      I scream. You scream. I assume that means we're both acquainted with the problem. We proceed.
  37. Re:Rails 3.1 Comparison by thasmudyan · · Score: 1

    Actually I pulled the sample straight from the documentation for the project in the OP.

    I didn't realize this, sorry. But nevertheless, it seemed like an unfair and artificial comparison to me. Most people would agree that Rails is a nice, mature MVC framework and I doubt the same can be said about SolarPHP (which I personally don't know anything about). My perception was that your examples were chosen to present Ruby in a more concise and more elegant light, by force.

    Again, which is not to say that there isn't a good point to be made here. Ruby code tends to be a little more concise and, as a PHP-heavy programmer myself, I have to concede that PHP's syntax is anything but elegant. It's one step away from the surreal ASCII art that is Perl ;-)

  38. Thanks Paul! (nt) by commrade · · Score: 1

    Filler texts contained hearin contain no meaning even though they fit a certain grammar.

    Ipsum Lorem.

  39. 90s by Max_W · · Score: 1

    In 90s we had to build a complete interactive web-page in Perl or C, with html tags and JavaScript, and then print it out to a browser. And we were grateful.

    Nowadays, having PHP, which is so easy to use, people want to make it even easier. I don't get it.

  40. Re:Rails 3.1 Comparison by Bill,+Shooter+of+Bul · · Score: 1

    I mean, there *are* prebuilt blog software packages. Where does the real difference lie between a CRM and a web framework?

    Wordpress vs Zend? The wordpress example is even easier: getposts(); Thus proving its the best framework ever!!!!!

    Maybe I'm too harsh, but its like expecting a hello world program to be representative of the a programming languages ability. Sometimes it seems like there are all optimized towards creating a blog. Which makes as much sense to be as optimizing a language for hello world.

    --
    Well.. maybe. Or Maybe not. But Definitely not sort of.
  41. Re:Rails 3.1 Comparison by msgyrd · · Score: 1

    Disclaimer: I'm not a PHP or Ruby programmer. I come from the land of Java and Python.

    @posts = Post.where(:status => 'public').order('created DESC')

    $records = $this->_model->blogs->fetchAll(array('status = ?' => 'public'), 'created DESC');

    Assuming these would be returned from a framework library, or I can't readily access the source and this is just part of documentation.

    The first example is fairly readable, concise and sensible. Knowing a little about how Ruby handles things as objects, I "get it" and am comfortable with what @posts would probably contain. I'm fairly certain @posts is a plural set/object of more Post objects, which represents a row in a database, where status is public, then ordered descending. I can probably iterate through it. As an outsider, I could read this, lookup the column names for the row and almost immediately start using it.

    Knowing some of the problems with PHP and its community, I can make no assumptions about what $records will really be unless I know the author's style or am already familiar with the codebase. Ignoring your writeup justification for shortening, I can't guess what _model is, I don't know what blogs really represents, and I'm uncertain why fetchAll needs an array object passed as a parameter, I have to mentally replace the question mark with "public", then assume the second parameter is an order-by parameter since I see the DESC. Before I would be ready and comfortable to use $records in a meaningful way, I'd have to dump it to the screen or use a debugger, plus lookup the syntax for fetchAll, and I'd really want to know what _model and blog actually represented since you're now magically assuming the blog object links to a table somehow. I do not know if blog is iterable or if it's rows it has grabbed are even accessible. $records may be the result of some manipulation it performs on the query result. I just don't know, and that makes me uncomfortable.

    So while you've reduced character quantity to near comparable levels, you've not matched readability or understanding. You've merely condensed complex code into short complex code. Honestly, I think it's a philosophy difference between PHP and Ruby. Ruby the language strives for the principle of least surprises, and if the programmers utilizing it adhere to that, I can grasp their code pretty quickly. PHP is a grab-bag; you can make no assumptions, which is both a strength and a weakness.

    Granted, PHP can still be used successfully to start and run a business, but as a programmer with no professional experience in either language, I'm gravitated towards the Ruby example.

  42. Re:Rails 3.1 Comparison by DavidTC · · Score: 1

    Um, perhaps you need to think about what you're saying.

    You might not be familiar with PHP, and thus unfamiliar with how it how it handles objects, but it's pretty easy to guess how a framework would return all records from a query if you know anything about PHP. It would return an array of arrays. Perhaps the repeated array is an associative array, perhaps it is column indexed and there's another command to get the associative ones.

    You know, like the actual commands the language itself has, which I know because, heh, I'm a PHP programmer and know the language.

    I'm uncertain why fetchAll needs an array object passed as a parameter, I have to mentally replace the question mark with "public", then assume the second parameter is an order-by parameter since I see the DESC.

    fetchAll would need an array object passed as a parameter because you might want to use multiple WHERE clauses, which I, OTOH, have no idea how to do in the Ruby example. Likewise, I have no idea how to do a LIKE instead of an =, whereas I can see how to do that in the PHP command. Don't bitch because the PHP framework command is more powerful than the Ruby one.

    Likewise, while you don't know the format of the fetchAll() function, um, you're unlikely to magically know the format of the Post object, either.

    I can't guess what _model is, I don't know what blogs really represents

    Presumably $this->_model is how you look up the database framework, in the framework. But your confusion is because these two pieces of code aren't identical. The Ruby appears to be inside some sort of object that is already linked to the blog table (You'll notice it doesn't reference what table it's using at all.), whereas the PHP code to to call a function on that object. (Which is why, as I said, it was insanely stupid to write a function to do that, instead of just calling the existing function.)

    If the PHP was actually on the object, it would be calling the fetchAll function like $this->fetchAll(array('status = ?' => 'public'), 'created DESC');

    I'd give an example of what the PHP is doing in Ruby, but I have no idea how to access objects like that.

    I'm fairly certain @posts is a plural set/object of more Post objects, which represents a row in a database, where status is public, then ordered descending. I can probably iterate through it. As an outsider, I could read this, lookup the column names for the row and almost immediately start using it.

    And I, as a PHP programmer, have NO IDEA what a 'Post object' is or does. You somehow know it represents 'rows in a database'. Well, good for you, but that's not actually very intuitive at all. That's language knowledge you have. If you asked random people what a Post object would do to a database, most would guess 'insert and/or update a record'.

    In fact, looking at it, I think you're wrong, and Posts represents the table itself, which means that @posts almost certainly is not an array of them. (Which means, instead of being inside a table object like I said above, we're in a database object or possible Post is some global object, although that seems like a very stupid name. Also, why is it capitalized if it's a table name? I have no idea.)

    I do not know if blog is iterable or if it's rows it has grabbed are even accessible. $records may be the result of some manipulation it performs on the query result. I just don't know, and that makes me uncomfortable.

    Yes, not knowing the exact syntax of a language does result in several questions. Just like, you know, any language.

    And I urge you to actually read the paragraphs above, and compare your words:

    'I'm fairly certain @posts is a plural set/object of more Post objects' vs 'if it's rows it has grabbed are even accessible'

    'I can probably iterate through it.' vs. 'I do not know if blog is iterable'

    'fairly certain...status is public, then ordered descending' vs. 'may be the result of so

    --
    If corporations are people, aren't stockholders guilty of slavery?
  43. Re:Rails 3.1 Comparison by DavidTC · · Score: 1

    *checks it out*

    Yes, if you use fetchAll(), you have to pass in an array to do the select. Oooh, scary.

    Whereas, with Ruby, you apparently just keep appending functions to the object.

    Which then results in an interesting question: How the heck do you optionally add parameters to a select using the Ruby framework?

    In SolarPHP, you add, or don't add, a record to an array. In Ruby on Rails you...what?

    Apologizes as I don't actually know Ruby coding, but it would look something like this:
    Post.where($whereclausearray).join($joinarray).order($order).groupby($sortby).having($having)

    With all the ones you aren't using as NULL, just in case you want to use one? Hrm.

    Likewise, SolarPHP requires 'status = ?', whereas Ruby on Rails just has the field name, which is more 'concise'...as long as you don't need to make it 'status LIKE ?', which you can do in PHP, but not in the that Ruby syntax.

    Now, I'm sure you can actually do that query somehow, and my 'optional clauses' comment is silly but that's my point. You're nitpicking over rather microscopic language differences. Actually, not even that. You're nitpicking over framework differences, and pretending that a slightly more verbose language is somehow a lot worse.

    Any programmer with the slightest bit of knowledge knows that, while being more verbose doesn't make a language better (See: COBOL.), it also doesn't really make it any worse. Likewise, you haven't show that PHP actually is more verbose, just that a single function inside a framework (Which adds verbosity) is. Meanwhile, as I pointed out, the PHP function you're comparing to the Ruby function can, in fact, actually do more, so actually it's a case of 'comparing a command with more functionality to a simpler command with less'.

    As for the missing $this-> stuff in Ruby, apparently, Ruby is using global variables or something, or alternately those two commands aren't actually that comparable, the Ruby one being inside an object that knows what 'Post' is, and PHP one being somewhere else that doesn't know what 'blog' is. If the PHP one was inside the same object, it would be using $this->fetchall() instead of referencing some complicated chain to find it.

    --
    If corporations are people, aren't stockholders guilty of slavery?
  44. Re:Rails 3.1 Comparison by DavidTC · · Score: 1

    Erm, I don't think I said anything about what the Ruby was doing at all.

    --
    If corporations are people, aren't stockholders guilty of slavery?
  45. Re:Rails 3.1 Comparison by BitHive · · Score: 1

    My bad then, I thought your PHP examples were supposed to be functionally equivalent to my Rails example.

  46. Re:Rails 3.1 Comparison by BitHive · · Score: 1

    So you don't actually know Ruby or Rails, but you know that my example is less functional. You're kind of all over the place in the rest of your post, and the "ooh scary" remarks don't really help your case (which, as far as I can tell is "I am annoyed that you would compare PHP with Ruby unfavorably")

  47. Re:Rails 3.1 Comparison by DavidTC · · Score: 1

    It's your PHP example.

    I just rewrote it to be less expanded out, as you were bitching that PHP was too much typing or some other such nonsense.

    Your example idiotically had the php tags, it had braces on lines by themselves, it created an array and stored it in a variable instead of just using the array, etc.

    The PHP and the Ruby were both functionally one line, with two surrounding lines to define the function. The PHP line was about 50% longer than the Ruby one.

    Which would be a fine thing to point out, but pretending it was 11 lines is just, well, lying.

    I don't care if you got it out of an actual example from the framework site. Examples are often expanded to make them easier to understand.

    The actual fact of the matter is that SolarPHP and Ruby on Rails can both make a query, and assign it to an array on the current object, using a single command, no matter what sort of silliness you're trying to use to make it otherwise.

    It appears this specific command is slightly longer in PHP, and it also appears that it's slightly hard to access the framework, although that's almost certainly not true.

    As I've pointed out, your 'Post' there is either a) an idiotically-name global object (Ugh), or b) the Ruby is on the object with that function, and if that was true of where the PHP was, or the PHP could just use $this->fetchAll(), not $this->_model->blogs->fetchAll().

    --
    If corporations are people, aren't stockholders guilty of slavery?
  48. Re:Rails 3.1 Comparison by DavidTC · · Score: 1

    No, I'm annoyed you take an expanded example and compare it to the most concise way of doing something in Ruby, and pretend that demonstrates something.

    The two examples are essentially identical.

    They pass parameters different ways, but they are both functions, on a 'database table object' that return an array of result.

    That's it. That's how you do that in the framework. It's a single function on a specific object. You get an array of arrays back.

    You just decided to find an example with a bunch of padding around to pretend that PHP was absurdly more work to use, that people would 'rather type' the other.

    --
    If corporations are people, aren't stockholders guilty of slavery?
  49. Re:Rails 3.1 Comparison by BitHive · · Score: 1

    They're not identical at all, you just don't know that because you've spent all your time going apoplectic here instead of reading the links I posted.