SitePoint Sponsor

User Tag List

Results 1 to 21 of 21
  1. #1
    SitePoint Addict timvw's Avatar
    Join Date
    Jan 2005
    Location
    Belgium
    Posts
    354
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Why would you choose PHP?

    I notice that usually the threads about application design usually can be summarized that one might want to implement a framework like asp.net / struts / jsf in php.

    Now i wonder:
    - Why do you spend time in making something similar if you can have the real thing(s)?
    - Why do you choose to not use the great ide's available for the real thing(s)?

  2. #2
    SitePoint Enthusiast
    Join Date
    Jul 2003
    Location
    New York
    Posts
    57
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There is no comparison...
    PHP is a language, ASP is a language, Java is a language, Ruby is a language.

    While....
    Rails is a framework, Java Server Faces is a framework, Struts is a framework, .NET is a framework.

    Developers are trying to port these great frameworks over to their favorite language. What's wrong with that? If you want to make comparisons, compare PHP to Ruby or Mojavi to Rails, but not a language to a framework. They aren't the same thing.
    viveHosting.com
    Affordable Hosting, Reliable Service

  3. #3
    SitePoint Enthusiast
    Join Date
    Jun 2004
    Location
    Stillwater, MN
    Posts
    96
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by vivehosting.com
    Developers are trying to port these great frameworks over to their favorite language. What's wrong with that? If you want to make comparisons, compare PHP to Ruby or Mojavi to Rails, but not a language to a framework. They aren't the same thing.
    I believe the original poster is pointing out that it seems like a lot of wasted effort. Why make a Struts port for PHP? Well, the answer isn't the same for everyone.

    I'm using PHP because of the portability. When Ruby reaches a mass audience it will be all Ruby all the time.
    Rad Smith
    My blog

  4. #4
    SitePoint Guru Galo's Avatar
    Join Date
    May 2005
    Location
    Holland!
    Posts
    852
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I like the fact that there are 2 P's in a programming name

    Why would one pick any language.... hmmmm....
    Business as usual is off the menu folks, ...

  5. #5
    SitePoint Addict
    Join Date
    May 2003
    Location
    The Netherlands
    Posts
    391
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    IMHO the decision to use PHP is been done mostly long before the need for a framework. The way I see it, most of the PHP developers leaning towards framework solutions do so as a result of a certain coding evolution. After having built a few applications on your own in PHP you come to realise that you should find a way to be able to reuse the 95% of the code you're repeating time after time, which leads to OOP, in case you were coding procedural, or to a framework, in case you were doing OOP and applying patterns to small pieces of that code. Struts, JSF or .NET are all good examples of frameworks widely accepted and tested. Inspiration from those examples are a natural starting point.

    I think the question you're raising is the last step in that evolution. After having worked (tested) with a few frameworks, or even tried to roll your own, and probably realising you're looking for solutions to your own framework problems in those examples all too often (besides the fact that implementing solutions found on other frameworks might not always apply so transparently to PHP), you may come to the conclusion that you're better off using any of the other existing languages (frameworks) than keeping on scratching your head to get around the trouble with PHP. At the end of the day, it all comes down to productivity.

    A good example that comes to my mind is MVC. IMHO, if you believe MVC is the paradigm you need or you'd be the most comfortable with, you should step aside PHP and try something else, as implementing MVC in PHP is IMHO, by long, not the best combination. Java or .NET, on the other hand, lean much better towards that concept.

    My .02 cents.
    There’s more than one way to skin a cat.

  6. #6
    SitePoint Addict timvw's Avatar
    Join Date
    Jan 2005
    Location
    Belgium
    Posts
    354
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I agree, the topic seems like a good troll But that's not my intention

    Quote Originally Posted by nacho
    I think the question you're raising is the last step in that evolution. After having worked (tested) with a few frameworks, or even tried to roll your own, and probably realising you're looking for solutions to your own framework problems in those examples all too often (besides the fact that implementing solutions found on other frameworks might not always apply so transparently to PHP), you may come to the conclusion that you're better off using any of the other existing languages (frameworks) than keeping on scratching your head to get around the trouble with PHP. At the end of the day, it all comes down to productivity.
    This is exactly what i'm asking myself these days.. I see demo's from oracle adf and jdevelopper and i wonder: where are the PHP equivalents? I'm not saying that it can't be done in PHP i'm wondering why i haven't seen it done in PHP yet. Or where i should look..

  7. #7
    SitePoint Wizard DougBTX's Avatar
    Join Date
    Nov 2001
    Location
    Bath, UK
    Posts
    2,498
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by timvw
    where are the PHP equivalents?
    I can't think of anything written in PHP which has mademe go "Wow!", except PHP itself. It is a brilliant example of what happens when you lower the barrier of entry.

    Rails is an example of someone inspired by the "wow" of the immediacy of PHP, and applying it to another language.

    Douglas

    Off Topic:

    I think the "There is no comparison..." argument is BS. Claiming that PHP is "just a language" ignores PHP's biggest strengths.
    Hello World

  8. #8
    SitePoint Wizard dreamscape's Avatar
    Join Date
    Aug 2005
    Posts
    1,080
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    the real thing? I didn't know PHP was not real. Well that's news to me. Guess I better see a psychiatrist.

  9. #9
    SitePoint Guru silver trophy Luke Redpath's Avatar
    Join Date
    Mar 2003
    Location
    London
    Posts
    794
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by vivehosting.com
    There is no comparison...
    PHP is a language, ASP is a language, Java is a language, Ruby is a language.

    While....
    Rails is a framework, Java Server Faces is a framework, Struts is a framework, .NET is a framework..
    Sorry to be pedantic, but ASP is a (basic) framework too (though far from a full stack). The language is VBScript or JScript.

  10. #10
    SitePoint Wizard DougBTX's Avatar
    Join Date
    Nov 2001
    Location
    Bath, UK
    Posts
    2,498
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by dreamscape
    the real thing? I didn't know PHP was not real. Well that's news to me. Guess I better see a psychiatrist.
    He's using "real" to mean "not a clone".

    Douglas.
    Hello World

  11. #11
    SitePoint Wizard dreamscape's Avatar
    Join Date
    Aug 2005
    Posts
    1,080
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by DougBTX
    He's using "real" to mean "not a clone".
    Ladies and gentlemen, Sherlock Holmes is among us.

    [both comments were made tongue in cheek]


  12. #12
    SitePoint Wizard DougBTX's Avatar
    Join Date
    Nov 2001
    Location
    Bath, UK
    Posts
    2,498
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I guess your wit is above me
    Hello World

  13. #13
    SitePoint Member
    Join Date
    Sep 2005
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Because PHP is easier to use, and easier to learn?

  14. #14
    SitePoint Wizard
    Join Date
    Jan 2004
    Location
    3rd rock from the sun
    Posts
    1,005
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Because the community and support network is very good.

    Because I keep learning from others who are willing to share their code and ideas.

  15. #15
    SitePoint Wizard
    Join Date
    Aug 2004
    Location
    California
    Posts
    1,672
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by DougBTX
    I can't think of anything written in PHP which has mademe go "Wow!", except PHP itself. It is a brilliant example of what happens when you lower the barrier of entry.

    Rails is an example of someone inspired by the "wow" of the immediacy of PHP, and applying it to another language.
    One of the big differences between PHP and other languages is that in other languages you can do the "Wow" in the language itself. In PHP you need to do "Wow" things in C, and there has been a very small club of people who could do that -- and that club has proved to be less than visionaries of late.

    I think what I am finding in PHP is that interesting framework stuff probably needs to be written in C as an extension, because they have just not put the support for interesting things into the language. Maybe PHP6.
    Christopher

  16. #16
    SitePoint Guru
    Join Date
    May 2005
    Location
    Finland
    Posts
    608
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by arborint
    I think what I am finding in PHP is that interesting framework stuff probably needs to be written in C as an extension, because they have just not put the support for interesting things into the language. Maybe PHP6.
    What I'd really like to see in PHP6, in addition to niceties such as namespaces, would be closures. Mere anonymous functions would be a start, as create_function is not only ugly as hell but also abysmally slow and just as evil as eval.

    Then again, why not just convert to Ruby :/

  17. #17
    SitePoint Wizard
    Join Date
    Aug 2004
    Location
    California
    Posts
    1,672
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Ezku
    What I'd really like to see in PHP6, in addition to niceties such as namespaces, would be closures. Mere anonymous functions would be a start, as create_function is not only ugly as hell but also abysmally slow and just as evil as eval.
    Namespaces and closures seem like niceties. I am looking for a something beyond (__get/__set/__call/etc) to really get inside objects when necessary to dynamically do interesting things: modify, inspect, combine, etc.
    Christopher

  18. #18
    SitePoint Addict
    Join Date
    May 2003
    Location
    The Netherlands
    Posts
    391
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by timvw
    This is exactly what i'm asking myself these days.. I see demo's from oracle adf and jdevelopper and i wonder: where are the PHP equivalents? I'm not saying that it can't be done in PHP i'm wondering why i haven't seen it done in PHP yet. Or where i should look..
    First of all, sorry for the late answer. I hadn't heard of oracle adf before and after having taking a look at the description I have to say it looks nice. I don't work with Java though, so I won't be able to make a right judgement.
    I find reusable GUI components for the Web also a very interesting idea, and as soon as I'm able to dedicate a little time, I'll be looking into the components wei and other guys at PRADO have been making over the time as an inspiration for my own. I couldn't tell how portable they are but I know they have put much effort in it and I guess making some own versions shouldn't be that difficult. I used to build JavaScripts widgets before I got into PHP and I enjoyed very much.

    While lurking and googling some time ago I also found this Active widgets with PHP and ASP implementations if I remember correctly. It might be a start?

    Quote Originally Posted by paulyG
    Because the community and support network is very good.
    I agree totally. Incomparable.

    Quote Originally Posted by arborint
    I think what I am finding in PHP is that interesting framework stuff probably needs to be written in C as an extension, because they have just not put the support for interesting things into the language. Maybe PHP6.
    I think you might have somehow hit the nail in here. I personally feel that the framework nature of PHP works against a mature vision within web development (where the need for a general purpose programming language gets bigger with the time). Wrapping existing functions into objects in order to be able to build your own framework feels kind of unnatural. If they were to provide all the stuff in an OOP way we wouldn't have this kind of discussions. Maybe, and I'm sure somebody has already pointed it out, they should leave PHP 4.x for what it is (a CGI-ish framework) and grow up towards a general purpose language with PHP6.
    There’s more than one way to skin a cat.

  19. #19
    SitePoint Addict timvw's Avatar
    Join Date
    Jan 2005
    Location
    Belgium
    Posts
    354
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by nacho
    I find reusable GUI components for the Web also a very interesting idea, and as soon as I'm able to dedicate a little time, I'll be looking into the components wei and other guys at PRADO have been making over the time as an inspiration for my own. I couldn't tell how portable they are but I know they have put much effort in it and I guess making some own versions shouldn't be that difficult. I used to build JavaScripts widgets before I got into PHP and I enjoyed very much.
    Here is the difference: with adf there is also a jdevelopper ide that allows you to drag-and-drop all those elements.. Apart from dreamweaver and phpvisualstudio i haven't seen much tools for php that allow you to do this...

    Offcourse, one could argue that j2ee is too complicated and therefore needs all those tools, and php can be done by hand. But i think there is a large potential for a decent php drag-and-drop tool

    Quote Originally Posted by nacho
    I think you might have somehow hit the nail in here. I personally feel that the framework nature of PHP works against a mature vision within web development (where the need for a general purpose programming language gets bigger with the time).
    I can understand what you are thinking, but i don't agree. I think php exists and is popular exactly because it is specialized/dedicated to solving problems in dynamic webpages. (For me it is atleast the reason why i started using php in 2000 instead of java/perl/c).

    Quote Originally Posted by nacho
    Wrapping existing functions into objects in order to be able to build your own framework feels kind of unnatural. If they were to provide all the stuff in an OOP way we wouldn't have this kind of discussions. Maybe, and I'm sure somebody has already pointed it out, they should leave PHP 4.x for what it is (a CGI-ish framework) and grow up towards a general purpose language with PHP6.
    I've never had the experience that php wasn't able to do what i wanted it to do That doesn't mean i can't appreciate the improvements from php4 to php5. I've had the experience that a couple of things can be done faster/easier in another language than php..

    I'll have a look at the active widgets etc... Another one that i have to check out is http://www.roundcube.net/?p=demo

  20. #20
    SitePoint Addict
    Join Date
    May 2003
    Location
    The Netherlands
    Posts
    391
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by timvw
    Here is the difference: with adf there is also a jdevelopper ide that allows you to drag-and-drop all those elements.. Apart from dreamweaver and phpvisualstudio i haven't seen much tools for php that allow you to do this...

    Offcourse, one could argue that j2ee is too complicated and therefore needs all those tools, and php can be done by hand. But i think there is a large potential for a decent php drag-and-drop tool
    Well, I think there is a potential for reusable components for PHP applications. Whether that should imply that those components should work through an IDE with drag-and-drop features I consider it an implementation matter. I honestly think it would be much more important to create a consistent set of components that most applications could integrate without much trouble, each on their own way. A common/agreed_upon interface for each component would probably suffice.

    Quote Originally Posted by timvw
    I can understand what you are thinking, but i don't agree. I think php exists and is popular exactly because it is specialized/dedicated to solving problems in dynamic webpages. (For me it is atleast the reason why i started using php in 2000 instead of java/perl/c).
    Off course I too praise the ease of use in PHP, and you're right, Rasmus Lerdorf has always said that PHP was created to solve a very concrete problem, nothing more, nothing less, but that doesn't mean the paradigm he was trying to solve back then hasn't changed ever since. In fact, back then, web applications were by far not what they are today, and some day not so far away from now, any little company that is now using a dynamic web site so to speak would have evolved to its own web/asp service.
    It's not that PHP needs to evolve in order to improve itself, but the need is dictated by the evolution of the web itself. If PHP was never to change, it wouldn't fit the problem-solving nature he started with anymore.

    Quote Originally Posted by timvw
    I've never had the experience that php wasn't able to do what i wanted it to do
    Me neither . I still have much to learn and discover in PHP, no doubt, but tell me where is the logic of wrapping a set of native PHP functions into objects just to be able to build an OOP application or to allow a common/more_consistent interface. And I don't think I'm saying nothing others have not said/thought before. As a matter of fact we now have PDO, for instance.

    Quote Originally Posted by timvw
    I'll have a look at the active widgets etc... Another one that i have to check out is http://www.roundcube.net/?p=demo
    The server didn't allow me to see the demo. Too many people logged in it seems. I'll take a look later. I have to say though that I'm not too fond of XMLHttpRequest being a requirement ...
    There’s more than one way to skin a cat.

  21. #21
    SitePoint Wizard DougBTX's Avatar
    Join Date
    Nov 2001
    Location
    Bath, UK
    Posts
    2,498
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by nacho
    The server didn't allow me to see the demo. Too many people logged in it seems. I'll take a look later.
    Same error here/now...
    Hello World


Bookmarks

Posting Permissions

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