Slashdot Mirror


Taking the Sting Out of PHP 5 Programming

bfioca writes "Where are the all-in-one PHP frameworks that make building well-factored and maintainable applications as easy as building simple sites? O'Reilly ONLamp's recent article Simplify PHP Development with WASP shows how to make a simple database-backed site with WASP in just a few lines of code. Other PHP 5 frameworks such as symfony and PRADO have been getting a lot of recent attention as well."

159 comments

  1. Drupal? by rjung2k · · Score: 3, Informative

    I don't claim to be a web architecture guru, but what's wrong with Drupal? Open source, PHP 5-friendly, and does everything from vanity sites to corporate sites.

    1. Re:Drupal? by albalbo · · Score: 3, Interesting

      I think you have to hack it to get it to work multisite? Also, the URLs are pretty horrible.

      That's not to say stuff like PRADO is any good either - I used it for a commercial site, and it's a pain to maintain. It's an ASP-style component system, and doesn't fit the web model - if you want to do 'Ajax', for example, you're screwed.

      symfony looks interesting, though, and much more lightweight.

      --
      "Elmo knows where you live!" - The Simpsons
    2. Re:Drupal? by Anonymous Coward · · Score: 0

      The problem with these off-the-shelf content management systems is that they invariably have security flaws which are exploited.

      Although security by obscurity is not the answer it certainly protects you against the 'script kiddies' out there.

      As a programmer I always feel uncomfortable using third party systems because at the end of the day if I lose my job because of my own coding errors then fair enough, but if it's because I've used someone else's code in an effort to take short cuts it's a different matter entirely.

    3. Re:Drupal? by carndearg · · Score: 2, Informative

      Drupal is a content management framework, these are application frameworks. In other words Drupal is the application and once you've installed it and whatever modules you need all you have to do is input your content while an application framework requires you to use it to write an application before you can think of content. Drupal is very useful if you want to do what it or one of its modules already does but it is less flexible for custom applications.

    4. Re:Drupal? by arivanov · · Score: 1, Informative

      Looking at the frequency of attempted exploits for drupal holes on my website there is a lot wrong with it (I do not even have PHP installed). At least from security perspective.

      --
      Baker's Law: Misery no longer loves company. Nowadays it insists on it
      http://www.sigsegv.cx/
    5. Re:Drupal? by slashdotnickname · · Score: 2, Interesting

      We actually tested out Drupal for possibly doing a customer's portal site last year. It had a lot of features and was quick to set up, but it was a nightmare to customize it beyond anything simple. I think it's a great product for non-techies to get something up with, but it's too restrictive for any complex business logic needs.

    6. Re:Drupal? by WebCrapper · · Score: 2, Interesting

      Couldn't agree more.

      In the long run, I would rather write my own CMS than use someone elses. When I first learned PHP, I wrote my own system. Now that I'm older and less stupid, I realize how many security holes where in the application, but in the 3 years I used it, not one hiccup because it wasn't documented anywhere.

      I messed around with Mambo (sorta, kinda, like Drupal) and really didn't like it. I hacked it a little to do what I wanted, but found it wasn't for me.

      At the same time, I'm a little at a loss. I'm currently writting an OSS application and while I know there will be security flaws, I'm stuck on what I want to do with the data. Do I encrypt everything, have the option of a global storage DB (my DB, not the one people install the application on), etc... Too many choices and they could all, somehow, become a security issue.

    7. Re:Drupal? by rdean400 · · Score: 2, Insightful

      I looked at the symfony site. Once I got to the HTML templates with embedded PHP, I closed the window. If I want to combine code with HTML, I'll use JSP or ASP - the component model and syntax are cleaner.

    8. Re:Drupal? by truthsearch · · Score: 3, Informative

      No, it takes no hacking to work multisite. I'm running 3 sites on one code base right now. The URLs are very short. There's nothing horrible about them. And if you turn on the right module you can automatically link to /title/page+title. Learn about an app before complaining about it.

    9. Re:Drupal? by truthsearch · · Score: 2, Interesting

      If you want to do anything beyond things that relate directly to content management then Drupal's not a great option. In theory you could strip out most of the module and use it as an app framework, but you won't get gaining too much over writing your own foundation. Drupal is mostly specific to CMS needs.

    10. Re:Drupal? by kbahey · · Score: 2, Informative

      You probably saw scans for the old versions of xmlrpc.

      This was a third party library that we incorporated in Drupal a while back to do some remote stuff (e.g. remote blogging, ...etc.)

      If you do not use third party client apps to post, you can delete the file xmplrpc.php altogether if you wish.

      When it was discovered that it has security flaws, we replaced it completely.

      Newer versions are as secure as they can be.

    11. Re:Drupal? by kbahey · · Score: 4, Informative
      Disclaimer: I am a Drupal community member and developer.

      I think you have to hack it to get it to work multisite?


      Nope.

      Drupal has multi site out of the box, and has been like that for years. For some 18 months, I ran 4 different domain out of the same code base and the same database even (with database prefixes).

      Also, the URLs are pretty horrible.


      Drupal boasts "clean URLs" out of the box as well. This means that urls do not have to be www.example.com?q=node/123 but rather www.example.com/node/123 (this requires mod_rewrite).

      Moreover, Drupal has out of the box the path module which allows you to alias any page to any URL you like. There is also a contributed module (pathauto) that makes this totally automated.

      Check my web site for examples (all URLs are aliased).
    12. Re:Drupal? by metaclous · · Score: 0

      That's ridiculous. Drupal is framework, and its default use is content management. If you want to use it as a custom application, its node system and aspect-oriented hook system make it extremely flexible.

    13. Re:Drupal? by danielDamage · · Score: 1

      Drupal is a lot of things, but it isn't exactly a web framework. It does a great job of supplying a basic toolset for building a certain kind of web applications, but it doesn't make it ANY easier for you to do things that are outside its scope. Great for a blog, pretty good for a BBS, not so good for any kind of sophisticated reporting.

      More generic frameworks, however, just let you take a dataset and turn it to a table, or quickly bind a database row to an object and a submit form for that object. Etc.

      --
      Slices, dices, eats your lunch.
    14. Re:Drupal? by Anonymous Coward · · Score: 0

      This is retarded, why is this modded up?

    15. Re:Drupal? by scragz · · Score: 1

      Personally, I consider "www.example.com/node/123" to be an incredibly nasty URL. It's completely arbitrary and holds no semantics. Not knocking Drupal in particular, just that a lot of people seem to think that the lack of a question mark makes a URL "clean". If node 123 is a blog post about slashdot, it should be something like "www.example.com/blog/slashdot-dupes-article-ninet een-times". I have a homegrown framework that does stuff like this automatically; it's not that hard.

      My only experience with Drupal was working on downhillbattle.org a year or two ago. I'm sure the framework has progressed since then, but I remember the URLs were really annoying and the whole thing was really hard to work in for a site that wasn't a cookie-cutter CMS site.

    16. Re:Drupal? by scragz · · Score: 1

      Ah crap, I didn't read the last two sentences of your post. Nevermind then, cheers on that.

    17. Re:Drupal? by carndearg · · Score: 1
      You're right of course, Drupal is extremely flexible. But if you want to write a custom app that nobody's written before as a module you still have to get your hands dirty and write that module from scratch for Drupal's API. The idea of an application framework is to provide a mechanism to simplify the development of new applications rather than just an existing application with an API to plug your coded-from-scratch application into.

      Both types of approach have their advantages and disadvantages. Drupal's advantage is that it comes out of the box with most of the applications you'd need for most websites of its type. By comparison an application framework comes out of the box with no application, i.e. you have to create something in it to make it do anything. But conversely that application creation process is intended to be simpler in the application framework than it is writing a Drupal module. Which is not such a ridiculous idea IMHO.

    18. Re:Drupal? by clydemaxwell · · Score: 1

      I must be confused -- are you saying php isn't supposed to be embedded with html? Have you...have you ever used php?

      --
      Browsing with classic discussion, noscript, at -1 and nested
      no hidden comments and I only mod UP
    19. Re:Drupal? by WWWWolf · · Score: 1
      Drupal boasts "clean URLs" out of the box as well. This means that urls do not have to be www.example.com?q=node/123 but rather www.example.com/node/123 (this requires mod_rewrite).

      In my humble opinion, www.example.com/node/123 isn't a "clean" URL. Or rather, it's a tad bit too clean. It's cleaner than the querystring one, but in my opinion a numeric ID isn't good as an identifier of anything. URLs should be recognizable on sight. If you see an URL and have to ask "Hmm, was that the article about kernel build options or the one about the schematics of the orbital brain lasers?", that's bad.

      Adding a title or date might be much better (a la the format many blogwares use, www.example.com/article/2006/01/23/whining-about-p ermalinks).

    20. Re:Drupal? by Anonymous Coward · · Score: 0

      totally classless programming?
      better use something onphp-based, Luke

    21. Re:Drupal? by Anonymous Coward · · Score: 0

      If people read posts thoroughly, they'd probably prevent a great deal of un-needed chatter.

      Drupal can do better url re-writing, with a module that automagically re-writes based on the section/category and title of the post.

      For all you Drupal whiners, get a life. Use the software before you knock it. It's a great CMS with incredible potential, that's completely usable, TODAY. The community is very active and the product is constantly getting better!

    22. Re:Drupal? by rdean400 · · Score: 1

      PHP requires no such thing.

      Mixing program code with HTML is retarded, no matter what the language. Even JavaScript should be kept compartmentalized.

    23. Re:Drupal? by droolfool · · Score: 1

      I agree about PRADO. It's a POS. I mean, when I chose it for a simple website, at first I thought it was so cool. I could create web pages so easily! No need for stinkin' HTML. Then I realized I was spending *much* more time dealing with PRADO's model than I would spend building the HTML myself. It's based on ASP.NET, but only on the worst part of ASP.NET.
      Nowadays I would choose Cake or some other decent framework.
      (Yes, I have used WebForms myself. Sorry, WebForms fanboys. I hate WebForms, period).

  2. Just use Ruby or Python by Anonymous Coward · · Score: 0, Flamebait

    The best way to take the *sting* out of PhP is to use Ruby or Python.

    1. Re:Just use Ruby or Python by onion2k · · Score: 2, Insightful

      Currently I'd discount Ruby from any sizable web development as it's still very much a minority language and it'd be practically impossible, or outragously expensive, to hire a Ruby developer. If your development team or company vanish (run over by a bus, move to Australia, whatever) you need to be able to get someone else who can come in and maintain the code quickly. That just wouldn't happen for a site written in Ruby. Of course, it'd be fine for any small development like a homepage or a blog .. but PHP would be equally fine for such an unimportant venture despite it's shortcomings. To a lesser extent the same can be said for Python. There's a lot fewer Python developers about than PHP, but there are some.

      Caveat: IAAPD (I Am A PHP Developer), so perhaps I'm horribly biased.

    2. Re:Just use Ruby or Python by Anonymous Coward · · Score: 0, Flamebait

      LOL... I'll take the "sting" of PHP over the "pounding hangover" of Python or the "intestinal cramps" of Ruby any day.

      When I first started with PHP, I was able to make effective use of it very quickly. I enjoyed learning it and "got it" faster than I have ever gotten any other language. When I first looked at Python, I felt old, familiar, throbbing hangovers brought on by Perl returning. When I took a serious look at Ruby (actually Ruby on Rails) I realized that without learning Ruby itself, I'd never really master building a site with Rails. Learning Ruby is, to me, more of a hassle than it is worth. Heck, learning to use C was much easier than learning Ruby, IMNSHO.

    3. Re:Just use Ruby or Python by varanid · · Score: 2, Interesting

      considering the forum in posting, I wouldn't be surprised if I was modded down, buut I signed up on slashdot finally just to make this my first post as a reply

      while I agree its a niche language now, it won't be long I imagine till ruby ges more mainstream. The main thing holding ruby back so far has been a lack of books on the subject. hoowever, that is quickly changing and already ruby is more popular than python in japan.

      caveat emptor: I've only been dabbeling in ruby for the past week or so

      anyway, so far I rather like the language as it somehow manages to emain fairly concise yet readable unlike perl and as a language, I find it alot more powerful than php.

      ruby + the rails network shhouldn't be dismissed just yet and php programmers would be wise to at least devote some time to learning ruby. I don't imain, assuming you knoow OOP, anyone would have much of a problem learning ruby, and it scales much better for large apps

      note: I myself have used php extensivly in the past but I am now seriously considering going to ruby on rails as my nnew dev environment

    4. Re:Just use Ruby or Python by colinrichardday · · Score: 1

      Interesting, as PHP's syntax is closer to Perl's than Python's is. What about Python reminded you of Perl?

    5. Re:Just use Ruby or Python by Anonymous Coward · · Score: 0
      Currently I'd discount Ruby from any sizable web development as it's still very much a minority language and it'd be practically impossible, or outragously expensive, to hire a Ruby developer.

      Ah, but Rails people are always saying how it has made them 10 times more productive, so as long as they aren't ten times as expensive you come out ahead.

    6. Re:Just use Ruby or Python by danharan · · Score: 2, Interesting

      There are a lot more Ruby developers than Ruby jobs.

      And they tend to be better developers too, those that enjoy hacking and being productive.

      --
      Information: "I want to be anthropomorphized"
    7. Re:Just use Ruby or Python by hotfireball · · Score: 1

      How long is the largest chunk of code Larry Wall has written in Python? It was 23 lines longer than the largest chunk of code Guido has actually written in Perl. The difference is that Larry's code worked, and Guido's still doesn't...

    8. Re:Just use Ruby or Python by CoughDropAddict · · Score: 2, Insightful

      If your programming immune system immediately rejects any language that is more mindbending than the simple if/while/for/switch/function constructs of C-like languages, you will forever be a pretty naive programmer.

      As an example, JavaScript has OO, but no classes! How do you suppose that is? It's prototype-based OO. It's an interesting alternative to class-based OO. Well-rounded programmers can pick up a concept like that rapidly -- they don't just say "this is too much of a hassle."

      The basics in Ruby are no harder than C or PHP. Things only get more difficult when you start saying things that simply cannot be said in C or PHP.

    9. Re:Just use Ruby or Python by colinrichardday · · Score: 1

      I didn't know that Larry Wall wrote stuff in Python, or that Guido wrote stuff in Perl.

    10. Re:Just use Ruby or Python by Anonymous Coward · · Score: 0

      For the umpteenth time, Ruby has been around since 1995. It didnt spring out of the RoR guys ass OVER FUCKING NIGHT! You just heard about it and quickly jumped on the web bandwagon because it is "fun" to use. Right. Fuck off.

  3. Bogus by Anonymous Coward · · Score: 4, Insightful

    Give me a break, depending on such things is terribly bad for maintainable code. Exactly the opposite of the billing given above. Will code written with it be compatible with PHP 6? How long after PHP 6's release will such tools be made compatible? If you need tools to simplify php coding, you might as well just forget it.

    If you want a quality product, there are no shortcuts. There is no such thing as a free lunch.

    A big thumbsdown on this kind of crap. "Sting" to PHP 5 programming? Get real.

    1. Re:Bogus by afd8856 · · Score: 3, Insightful

      You are either ignorant to what a real open source framework would represent (limit code reinvention, benefit from community effort, etc) or are not in the target group of such a framework (maybe you work for a big company that has a large programming team, who knows).
      Either way, I can tell you that, from my personal experience, learning and adopting a framework in your work can have a lot of benefits, for me, as a small custom business solutions provider.

      --
      I'll do the stupid thing first and then you shy people follow...
    2. Re:Bogus by Nigel182 · · Score: 1

      Yeah, what a horrible idea to establish a framework that can standardize the code in multiple projects and code written by multiple people in the same project. It's better to start from scratch every time so that everyone's code works differently. Then when it comes time to maintain the code, you get to figure out the application's structure for each project and hopefully each person's code who worked on the project!

    3. Re:Bogus by Anonymous Coward · · Score: 0
      Too right - I completely agree. There is NO STING in PHP 5 programming. Using a framework solves a non-problem in an obscure way. Tired of rewriting code - simply use PEAR.

      Languages like Ruby need a framework because:

      1. There are few web-centric functions available
      2. They run as persistent processes (via FastCGI)
      3. There is an obvious need for model-view-controller
      If you want MVC in PHP, it's piss easy to write it yourself. In fact everything in PHP is piss easy! Frameworks? No thank you!
    4. Re:Bogus by Anonymous Coward · · Score: 0

      The only point I see in this is the php 6 comment. Given the php history of breaking code between releases, I think he has a valid point. If you write a java based site and then upgrade from 1.4 to 1.5 it will still run. .NET 1.0 code runs on .NET 1.1 as well. Also, open source tends to change apis in general. If you start with a framework today, you may need to either rewrite good portions to remove the framework when your sysadmin wants to go to php6 for security reasons or port your app to the new framework which may require several hours of coding as well. There's maintaining software and then there's rewriting portions when you shouldn't need to. PHP people like to encourge both.

    5. Re:Bogus by DavidHOzAu · · Score: 1

      You PHP trolls are so cute, with your crappy code full of security holes, barely performant under load even though you run on a blazing fast interpreter.

      And I'm sure Chinese is better than English, too. All of us english-speaking people are so limited with only 26 letters to play with.

      Oh puhleeze, both are programming languages! , and they can coexist together if you do it right. True hackers don't care what language they program in, they adapt. If the-other-side in the Php-or-Perl issue offends you that much, perhaps you should start thinking in algorithms rather than whatever-language-i-am-coding-in.

    6. Re:Bogus by heinousjay · · Score: 0

      I'm not saying anything about the language, just the code I've seen written. It's the price of being immensely popular - you get a lot of slackers who can't code worth shit.

      So basically, I agree with you, and still hold my opinion.

      --
      Slashdot - where whining about luck is the new way to make the world you want.
    7. Re:Bogus by Anonymous Coward · · Score: 0

      PHP 6? If you've made your web app and it runs, has all the needed features, and you can extend it using PHP 5, you will never ever HAVE to move to PHP 6.

      Therefore it doesn't matter if the toolset moves.
      In fact you're going to want to keep a version of the toolset you used in case it does shift out from under you to some popular demanded area.

      Having said that, compare making a form in PHP by hand and hand coding the error checks to doing it in a framework... the php looks a lot better than C, but the framework might have something like: make_selection_from_db('users','name') and check_selection_in_db('users','name') and you'd be feeling like you already saved some time.

      Because there's no need for PHP5 or any version to provide such specific additions, it ends up being a seperate framework. The actual frameworks mentioned here are actually better than just adding a few functions. They give you a premade methodology to follow. If you can fit your webapp to it, you've just save a lot of decision steps that are error prone.

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

      "If you write a java based site and then upgrade from 1.4 to 1.5 it will still run."

      Couldn't be more wrong. I abandoned java programming when 1.4 broke 1.3 apps. The JRE is the silliest thing I have ever seen. The client needs to download it for one, versions conflict, you have the choice of what generation of java applications you want to run. PHP has a much better record of backward compatibilty. I have written stuff for php 3 that still runs fine on php 5.

      I will reemphasise, if you want something to work properly, it must be done serverside. Java is pure evil. Conflicitng versions, no backward compatibilty, the conflict between MS and Sun's JREs... just not worth it. The platform independence of java is a complete myth, a total load of bunk. Use C(++) if you want to write an application to run on a clients machine.

    9. Re:Bogus by Anonymous Coward · · Score: 0

      Basically, you are correct, there is a lot of crap php code out there. (take SMF as an example).

      However, you presume that my php applications are not efficient, stable and secure. I pride myself on those attributes of my php work. I'm sure I could do the same in perl as well. I have seen some pretty nasty perl work too (this site's performance leaves a lot to be desired).

      So take your superiority complex and bugger off, please.

    10. Re:Bogus by cwf0621 · · Score: 1

      I guess I don't get your point. It seems to me that the code is more obviously upgradable if I use WASP (or any other OS framework for that matter). Imagine this scenario: 1. My company writes 8 major applications this year w/o using a framework of any kind. 2. PHP 6.0 comes out. 3. I have 8 applications to herd through the upgrade process. Or imagine this scenario: 1. My company writes 8 major applications this year using WASP. 2. PHP 6.0 comes out. 3. I have 1 application to herd through the upgrade process (WASP itself). 4. There is a team helping me upgrade it. Of course maintainability is about more than just dealing with upgrades so I like the idea of my approach to development being the same as everyone elses so that if changes need to be made and I am on a beach somewhere I don't need to be interuppted.

  4. What about PHP using HOOD? by dotslashdot · · Score: 1, Troll

    For the rest of us hip hop inclined programmers, there is PHP using HOOD (Hizous Object Oriented Development) in case you get tired of the WASP crowd.

  5. I don't see the magic words MVC... by aphexddb · · Score: 4, Insightful

    JASPF (Just another silly PHP framework)

    If you are looking for quick app development and you aren't joe home user making a website you are going to need something thats based off a model -> view -> controller architecture. Symphony does this, so does the cake framework.

    --
    "We're all mad here." --Cheshire Cat
    1. Re:I don't see the magic words MVC... by Nigel182 · · Score: 2, Informative

      Quick note: WASP does use the MVC paradigm. Here's a link to the MVC portion of the sample application tutorial. http://wasp.sourceforge.net/content/?q=node/7#Mode l.2C_Views.2C_and_Controllers

    2. Re:I don't see the magic words MVC... by PhotoBoy · · Score: 1

      No dummies can use any language, coders who are too undisciplined to be able to write well structured maintainable code without needing a framework are the dummies.

  6. Also check out by Frekko · · Score: 1
  7. I need PHP by Charbax · · Score: 1

    I want to make some original PHP apps on my websites but I still don't know PHP. So it would be great to have some GUI application or something that let's me realize a PHP/MySQL application just out of a database model that I would draw and some specific actions specified. So I am checking these solutions out, and if someone has more solutions for me that would be great.

    1. Re:I need PHP by yddod · · Score: 0

      Who fixes the bugs?

    2. Re:I need PHP by killjoe · · Score: 4, Insightful

      So let me get this straight. You don't know PHP, you don't want to learn PHP but you want use PHP to build some web apps. Did I get that right?

      Seems like a fools errand to me. I predict you will fail miserably and your web site will be hacked within 24 hours of you putting it up.

      You really should learn the language that you are trying to build web sites in.

      --
      evil is as evil does
    3. Re:I need PHP by Charbax · · Score: 0, Troll

      I think it should be possible to have a GUI application, that let's the user design a database. Then this GUI let's the user assign some functions between each table of the database. And at last define the .php pages and design them with Wysiwig. Lastly the .php files are uploaded to the server and it should work! That's what I am looking for. But for now I will try cake, prado and symfony and see what I can do with them.

    4. Re:I need PHP by hazah · · Score: 2, Informative

      Look, unless you are able to at least glue these components with SOME code, you aren't going to get anywhere. Just forget about it, because such an elaborate GUI does NOT exist. GUI isn't your solution either, since you don't understand the fundamentals of the problems you are trying to solve. Sorry, but you're either going to have to hit the books, or pay/convince someone else to do this for you.

    5. Re:I need PHP by Charbax · · Score: 3, Funny

      I think I understand the fundamentals, I just don't know PHP.. I can design a database, and I can understand the kind of interaction there needs to be between the tables. Imagine a GUI, first step design a database, with tables and relations. NExt step, you can define some tables as some standard ones, like "username" or "password". Then choose the actions that the PHP pages will do and include, for example the username and password box. And then define on the "logged-in" php page what can happen from which tables. Imagine such GUI that does not create every advanced PHP system, but is advanced enough to design ones own Digg.com kind of system, own search, own custom cms, members area, digital files store and lots of stuff like that. It will generate the php pages and it will be possible to view source and edit them to cutomize them..

    6. Re:I need PHP by Magic5Ball · · Score: 2, Informative

      Macromedia/Adobe Dreamweaver has *limited* support for what you describe (table views [kind of], forms, db updates, page layout, and maybe cookies). You still won't be able to design digg.com with zero understanding of how PHP and web apps work though, regardless of how good the tool is.

      Also, your understanding of databases and interfaces needs to be more sophisticated than building a contact manager in MS Access...

      --
      There are 1.1... kinds of people.
    7. Re:I need PHP by Charbax · · Score: 1

      I don't know about contact manager in m$ access. I just surfed around and google tells me about: BigProf AppGini 3.01: "It converts your database structure definition into a powerful PHP application that connects to MySQL database. It creates HTML forms for handling your data and all the PHP scripts behind them." http://www.download.com/AppGini/3000-2210-10070978 .html?part=dl-AppGini&subj=dl&tag=button PHPMagic: " Automatic PHP code generator to manage the data of MySQL databases. The very intuitive graphical interface of PHPMagic allows you to create powerful web database applications in a very short time." http://www.websitedatabases.com/download.html I will see if one of those will let me do a new digg-like application for my website.. Or maybe I might go back and try Dreamweaver again, though I doubt it's able to do the php stuff that I need. Thanks!

    8. Re:I need PHP by hazah · · Score: 1

      I don't think you are listening. What you want is a *dream*. It is not something that has been developed. Believe me I looked. I am developing with the same techs. you describe and I would love a few short cuts. I found them, they are called libraries. You still have to write code. Period. Propel + phphtmllib are very powerful. Many standard pear packages are definately a boost. But the bottom line is that these neat components need glue code.

    9. Re:I need PHP by Geoffreyerffoeg · · Score: 1
      Why don't you learn PHP?

      If you know some programming already (even BASIC will suffice), then you can pick up PHP. If you know C++, even better. If you don't know programming, step away from the PHP and go learn something that won't let people hack your websites (and even if you don't get hacked, will allow your website to keep running in the meanwhile).

      If you don't know HTML...uh...make sure you're comfortable with it before starting, because it's almost impossible to make a useful webpage if you can program everything but can't output it.

      Save this as a .php file and run it on your server:
      <html><body>
      <h1>Multiplication table</h1>
      <table>
      <?php
      for ($i=1; $i<=10; $i++) {
        print "<tr>";
        for ($j=1; $j<=10; $j++) {
          print "<td>";
          print $i * $j;
          print "</td>";
        }
        print "</tr>";
      }
      ?>
      </table>
      </body></html>
      There you go, you can see the syntax of PHP now. If you want to use databases, make sure you know SQL first (e.g., "SELECT first_name, last_name FROM customers WHERE age<18"), and then you can use the following commands for MySQL: mysql_connect, mysql_query, mysql_result. For the manual, see php.net. If you're not using MySQL, the commands are similar for other database versions.
    10. Re:I need PHP by Charbax · · Score: 1

      Okay thanks, I hope not.. I have looked a bit more and found a couple more applications that generate PHP, hopefully one of them realises my dream: phpCodeGenie: "Just design your database tables and phpCodeGenie can write the php scripts and programs for you." http://www.hotscripts.com/Detailed/20039.html dsQwikSite: http://www.dbqwiksite.com/

    11. Re:I need PHP by niteice · · Score: 1

      You mean something like Microsoft's Visual Web Designer. Unfortunately, that still requires you to know some VB or C# to make stuff happen. Fortunately, you don't need to learn all the ASP controls, as VWD lets you drag controls onto a page and it generates the proper HTML. You only need code to associate actions to the controls, as opposed to also generating the controls like in PHP. Heck, it'll even play nice and make XHTML 1.1. Very handy stuff.

      --
      ROMANES EUNT DOMUS
    12. Re:I need PHP by Anonymous Coward · · Score: 0

      Who fixes the bugs?
      Me.

    13. Re:I need PHP by jdowland · · Score: 1

      Generating code is not enough to actually use it. You need to understand the interfaces for what is generated, the implications for fitting bits together, how to determine when things are under load, how to figure out what needs replacing / rewriting / upgrading, how new language features might improve things, how to patch security flaws... In short, you need to learn the language. But IWWY I'd learn something other than PHP (ruby or python perhaps).

    14. Re:I need PHP by Magic5Ball · · Score: 1

      Interesting. Any one of those four apps would be useful for generating forms from existing databases. You could almost get to a (really fugly) blog using AppGini, although using the wizard to make something that makes RSS feeds would be a bit of a pain.

      I'd love to see what happens when you try to edit an application generated using one of these tools with Dreamweaver (to make it pretty), and then tried to change the functionality of the app using the original tool.

      --
      There are 1.1... kinds of people.
  8. SNOOP development? by dotslashdot · · Score: 0, Troll

    And don't forget SNOOP (SNoop Object Oriented PHP) for the rest of the hip house crowd who doesn't like the Country WASP crowd.

    1. Re:SNOOP development? by Anonymous Coward · · Score: 0

      SNOOP? You gotta check out HIZzleOOPfizzle (Highly Integrated Zoned Object Oriented PHP). It's off the teezy. Cheddah!

  9. Sting? by shiznatix · · Score: 1

    Taking shortcuts is just a bad idea. At my company we call shortcuts being 'lazy'. Just do it right without trying to lean on somthing else to help you out. It is just a couple more { and } to make your code work for soon-to-be versions of PHP without this garbage. Also, what is this 'sting'? Find it hard to use some OOP? If that 'stings' you then maybe you should not be coding in PHP. Moral of the story: being lazy will produce bad code that needs to be delt with in later versions of PHP. Save yourself the time now.

  10. Well check this Troll Tech VBA thingy by RedLaggedTeut · · Score: 1

    Maybe something like http://developers.slashdot.org/article.pl?sid=02/1 2/19/1740205&tid=156 mentionened on /. would appeal to you, although I wouldn't recommend it (well, people like me usually get to rewrite stuff like it)

    --
    I'm still trying to figure out what people mean by 'social skills' here.
  11. Using a Framework for YOUR applications!? by Archi87 · · Score: 1

    If you simply want a site with some 0815 stuff (like a Guestbook, News, Articles, Photogallerie) use PHP-Nuke and try to create you're own template (or ask a friend to do it for free).

    If you want to create anything else (like a corporate site with support system [ticketbased], shop [enduser and reseller], productinfo,... or a browserbased) do it yourself or have a company done it ;-)

    And if you really want to stick to a framework - create your own framework :D


    Sebastian (using his very own framework AdvFW2 v0.3.9 since 2 years [but it's php4-based because I use it for projects I do for friends for free])

  12. I should think so too. by afernie · · Score: 3, Funny

    Sting has had his finger in entirely too many pies since The Police broke up...

  13. Taking the sting from PHP coding by Anonymous Coward · · Score: 0

    Oh that's really easy, anyone with a clue for code can tell you that one. Can you say "Use XML"? I knew you could....

    1. Re:Taking the sting from PHP coding by benpjohnson · · Score: 1

      Hmm My App isn't running nearly slow enough... I know theres this XML thing...

  14. Facetious by Anonymous Coward · · Score: 1, Insightful

    What company do you work for? If you were writing an enterprise Java application, for example, would you call using Spring or Hibernate "lazy"? Also, what makes you think that this code isn't forward-compatible? It's just a few files of normal PHP code, automatically generated from XML manifests, from what I gather. Finally, what makes you think they even need the code to work in the next iteration of the language interpreter? If they're a contractor that gets paid and bails before anything breaks, then using even the shoddiest frameworks will indeed "Save yourself the time now."

  15. Modern web programmers have moved elsewhere by a55clown · · Score: 1, Offtopic

    I remember a time when PHP was the next latest and greatest thing. Then MySQL tied into it which made it all the more better. Lately, however, a lot of programmers have moved onto Ruby on Rails. It almost seems like magic at the speed at which you can make useful stuff.

    1. Re:Modern web programmers have moved elsewhere by ooh456 · · Score: 1

      I for one am sick of ROR people on this site slamming PHP.

      Like I am gonna learn some new language because a bunch of trolls spam post to every PHP article.

    2. Re:Modern web programmers have moved elsewhere by a55clown · · Score: 1

      i'm a php coder, fyi, and haven't had time yet to learn ruby on rails. i'm just putting it out as an alternative to php. i have yet to find a decent framework that can produce useful web objects as fast as ruby on rails.

      i'm sure you've seen the video - reminds me of a console version of every single vba demonstration i've ever seen.

    3. Re:Modern web programmers have moved elsewhere by ooh456 · · Score: 1

      Sorry if i've unfairly vented my anger. It's just that every time someone posts a good PHP article I have to wade through a million ROR posts.

    4. Re:Modern web programmers have moved elsewhere by Anonymous Coward · · Score: 0, Insightful

      When your app isn't just a simple CRUD tool, your perception of RoR may change. To replicate the functionality of my PHP app, I would end up with almost as much code as I already have. And for that small benefit I would be locking my employer into a still-rare language. Listening to RoR zealots, you'd think that it takes a year to build a web form by hand. Web apps took off because they were simple, people...the only difference now is that we have people screaming that everything needs to be OO and not reusing code wherever possible is blasphemy. First the "real" programmers ignored web apps, then they ridiculed them, and now they're fighting them with rotten frameworks that don't do what we need. Web apps of the simple sort that have made the web what it is have already won; the zealots just haven't realized that yet.

    5. Re:Modern web programmers have moved elsewhere by GigsVT · · Score: 1, Troll

      Lately, however, a lot of programmers have moved onto Ruby on Rail

      No, they haven't

      You are buying into the hype. Apparently a miniscule but vocal minority of people have even heard of Ruby on Rails. Most of them seem to read this site.

      --
      I've had enough abrasive sigs. Kittens are cute and fuzzy.
    6. Re:Modern web programmers have moved elsewhere by GigsVT · · Score: 1, Interesting

      Excellent post.

      I have read the tutorials for Ruby on Rails and some of the PHP frameworks that rip it off. It seems like a hell of a lot of work just to avoid writing a few lines of code.

      We are developing a CRUD-only framework at work, sort of in homage to this current fad, but ours won't be OO, and it won't keep you from having to write code either. It sure as hell won't use XML for anything. We might release it as free software after we see how well it works out.

      I don't know why all these framework sites talk about how much fun it is to develop with their framework. What ever happened to being maintainable or scalable or even useful? "Fun" isn't a quality I generally look for in my programming tools.

      --
      I've had enough abrasive sigs. Kittens are cute and fuzzy.
    7. Re:Modern web programmers have moved elsewhere by MickoZ · · Score: 1

      There is nothing wrong for anything to be fun, enjoyable, etc. This post is more philosophical and not tighly coupled to PHP or RUBY or WHETEVAH.

  16. Attempts != Problem by truthsearch · · Score: 2, Insightful

    So portscans of my Macs prove there are many Mac exploits? Drupal has had just a few very specific security issues, just like any other internet-based app. There are many thousands of drupal-based sites, so evil-doers have written scripts to hunt down and take advantage of those that haven't upgraded. Nothing here uncommon to any other system. My drupal referrer logs fill with thousands to requests for IIS-specific files, yet I've never run a site on Windows.

  17. Missing the point! by Anonymous Coward · · Score: 1, Insightful
    By demonstrating that it is possible to create and use complicated, "enterprise-class" frameworks effectively in PHP 5, WASP will help more developers make the switch.

    Complicated? I didn't realize that complicated frameworks were the pinnacle of modern software development. Here's a newsflash: PHP is popular not because of its rigid structure, nor the availability of misguided "frameworks", but because it allows people to solve problems in a flexible way with little overhead. Yes, a lot of people take it too far in this direction and turn their code into a disaster area, but others manage to build maintainable, useful apps without obsessing over whether or not their program fits into a particular "model". In addition, future maintainers of these apps won't have to read manuals about how to use the framework of the day to make changes. Strict interpretations of pseudo-standards or the use of mind-bending frameworks do not help to develop applications faster, or even better.

    I wonder how many "enterprise-class" applications fall flat on their faces because the frameworks on which they are built are not flexible enough to support what their users really need. I know it's happened where I work, and the answer "oh, the framework doesn't support that" led to the success of other projects that came out of nowhere and took hold because they met the demands of users as opposed to the technical demands of project managers. In the real world, a simple PHP app may very well push an "enterprise-class" and "three-tier" monolith out of its way if it does what the users want.

  18. *Please* use Ruby or Python by Anonymous Coward · · Score: 0

    LOL... You actually bothered to learn all those horribly inconsistent functions? is_null, isset? strtolower, hex2bin? strip_tags, stripslashes? strpos($haystack, $needle), preg_match($needle, $haystack)? Or are you accepting that looking at the docs every half an hour is normal?

    PHP has a lot of shortcomings, and it's a shame that it's been marketed so well that people like you are so used to it that you can't be bothered to learn anything better. Will you still say how good PHP is when you've looked at the docs for the hundredth time, or tried to use Unicode, or use the wrong function? I doubt it.

    To anyone else out there: PHP sucks. It has inconsistent function naming, no namespaces, far too many functions, next-to-no unicode support, catering to the lowest common denominator (who aren't expected to know how to escape a string (magic quotes) or use the query string arrays (register_globals (now deprecated, good))). Perl, Python and Ruby have none of these shortcomings. Learn something else - you'll appreciate it.

    1. Re:*Please* use Ruby or Python by baadger · · Score: 1
      LOL... You actually bothered to learn all those horribly inconsistent functions? is_null, isset? strtolower, hex2bin? strip_tags, stripslashes? strpos($haystack, $needle), preg_match($needle, $haystack)? Or are you accepting that looking at the docs every half an hour is normal?


      With a manual as clear, conside and accessable as PHP's, who cares? There are hundreds of functions in the 'core', but not all of those in the PHP manual are compiled in on most setup's. Who really learns the libraries and functions of any programming language by heart? Familiar and aware of? Yes. Memorise? No

      I know a fair bit of Python and know Perl well. PHP simply cuts Python up when it comes to easy to use documentation regarding web development. Perl is well documented and my current preference for webdev.
    2. Re:*Please* use Ruby or Python by imroy · · Score: 1
      With a manual as clear, conside and accessable as PHP's, who cares?

      I haven't looked at the PHP docs for a while now, but one Perl programmer made up a table of PHP functions that even PHP programmers find useful! That page also has a *lot* of good comparisons to Perl. It's amazing how much baggage PHP has accumulated over the years.

    3. Re:*Please* use Ruby or Python by Parham · · Score: 2, Informative

      This is the one point I have to agree with. PHP has great documentation (with loads of comments). I had to learn Python in school and to this day I still can't browse around the documentation properly without getting frustrated. Python is a great language, it enforces great structure and readability, but the docs for it are incredibly annoying.

    4. Re:*Please* use Ruby or Python by hotfireball · · Score: 1

      Yeah. Now is good time to throw ~70% of it...

    5. Re:*Please* use Ruby or Python by rbanffy · · Score: 0, Flamebait

      To put it shortly, PHP is VB3 for the web.

    6. Re:*Please* use Ruby or Python by Anonymous Coward · · Score: 0

      70%? It's all still true as far as I can see. Please post the 70% that isn't true anymore.

  19. Like Zope? Does anybody use this stuff? by walterbyrd · · Score: 1

    Zope is supposed to be some great product. But, when I do a search for Zope on dice.com, I might get one hit.

    I get the feeling these php frameworks might be even more obscure.

    Now, compare that to a product like ColdFusion.

    I don't use any of those products. But, I've got to wonder.

    1. Re:Like Zope? Does anybody use this stuff? by Anonymous Coward · · Score: 0

      What is there to wonder about? Zope programmers are productive and happily employed, thus there are fewer job postings. ColdFusion developers are useless fuckwads who can't hold a job, so companies are always looking for someone to take over their buggy ColdFusion apps.

  20. Ruby has a steep learning curve by Anonymous Coward · · Score: 0

    The thing about Ruby: it's so easy to learn. I'd say you could take some schmoe with experience in functional and OOP languages (Smalltalk, Lisp+Java, any other combination), and train them for Ruby development in two days.

  21. I also rolled my own farmework and... by AnthongRedbeard · · Score: 1

    I have my own framework I've used for several years now and slowly upgraded. I enjoyed writing it because it forced me to learn the principles of what all the other frameworks were doing. I couldn't understand why people wrote frameworks the way they did until I ran into the same situation. However, I made some significant apps with my framework that companies are using and I found myself writing lots of documentation on them and brushing up the comments... It would have been great if I used published and documented framework just so I wouldn't have to do the tedious stuff for other people to ever maintain it.

  22. a framework is NOT a shortcut (or a CMS!) by webwright · · Score: 4, Insightful

    I tear my eyes out everytime someone calls a framework a "shortcut". Usually they follow it by "There's no substitute for good coders writing good code." The business reality is that most coders are not exceptional, and some are pretty lousy. You can spend all of your budget on human resources finding epic-quality coders (and then scratch some more to come up with their epic-salaries) or you can do what the rest of the world does-- get the best programmers they can find and afford. A framework helps un-exceptional coders write better (and more consistent/maintainable) code. This arguments seems akin to saying "forget word processors! Just get someone who can make Vi or Emacs dance and turn 'em loose." It seems to me that the evolution of software is pretty much the act of layering increasingly-smart frameworks on top of machine language to allow high quality results more accessible to more people.

    1. Re:a framework is NOT a shortcut (or a CMS!) by RosenSama · · Score: 1
      A framework helps un-exceptional coders write better (and more consistent/maintainable) code.
      I believe this is true if better coders than you have wrote the framework. Otherwise, it's really saving you the up-front time you would spend writing your own framework. But, if your own team is as good as the framework authors, they could probably write better code that is more closely aligned to your purposes given the time.
  23. Stupid article, obfuscated and biased examples. by Anonymous Coward · · Score: 1, Interesting

    This article appears to be written for fools. One of the author's examples of WASP's superiority is that this:

    <li flexy:foreach="arTasks,key,task">{task[Name]} - <i>{task[Due]}</i></li>

    is better than this:

      <?php
            $arTasks = array();
            foreach ($arTasks as $key => $task)
            {
      ?>
                    <li><?php echo $task['Name']; ?> - <i><?php echo $task['Due']; ?></i></li>
      <?php
            }
      ?>

    Because "Already you can see one of the biggest benefits of working with WASP: no need for embedded PHP code."

    Well, it might look that way, because he deliberately coded the PHP version in the messiest way possible. He could have simply done this:

    <? foreach ($arTasks as $key=>$task) { echo '<li>' . $task['Name'] . '-<i>' . $task['Due'] . '</i></li>'; } ?>

    The WASP sample doesn't look so much better now, does it? Not so much so that it's worth downloading some unknown framework and inheriting someone else's bugs and execution overhead and security holes?

    1. Re:Stupid article, obfuscated and biased examples. by PhotoBoy · · Score: 1

      Well said, plus the example is just replacing one type of language for another. If you're going to embed code within HTML why not just use PHP? With PHP you don't have to learn some new scripting language to put in the HTML and you don't have additional processing overhead for the framework to intereprete the HTML files. It's just putting a scripted language on top of a scripted language. Why do it?

  24. actually, the "sting" of php5 is... by acroyear · · Score: 2, Insightful

    the fact that because of all of the php-4 compliant code that it breaks, few ISPs doing web hosting services are in any hurry to upgrade because too many customers simply don't have the time to rewrite their applications to be compliant with php-5, much less take advantage of any or all of the new features.

    this is hitting me hard as i'm trying to put together an xml-intensive app and am stuck using home-grown open-source XML parsing and generating packages, mostly unfinished, that won't be finished because they've been superseeded by the php5 libraries that i can't use yet.

    --
    "But remember, most lynch mobs aren't this nice." (H.Simpson)
    -- Joe
    1. Re:actually, the "sting" of php5 is... by GigsVT · · Score: 1

      I'm not sure what sort of compliance you mean.

      Our 15,000 line app went from PHP4 to PHP5 with very few changes.

      Unless you are relying on very legacy things that have been depricated throughout the PHP4 tree, you should have nearly no problems.

      --
      I've had enough abrasive sigs. Kittens are cute and fuzzy.
    2. Re:actually, the "sting" of php5 is... by Anonymous Coward · · Score: 0

      I think what he's saying is that he'd rather build an obsolete application than switch hosts.

    3. Re:actually, the "sting" of php5 is... by mortonda · · Score: 1


      this is hitting me hard as i'm trying to put together an xml-intensive app and am stuck using home-grown open-source XML parsing and generating packages, mostly unfinished, that won't be finished because they've been superseeded by the php5 libraries that i can't use yet.


      This is exactly why I'm switching to Ruby and Ruby on Rails. If I have to rewrite the whole applicatin, I'm going to switch to something better.

    4. Re:actually, the "sting" of php5 is... by acroyear · · Score: 1

      its the lesser-known things, the ones deprecated for "security" or whatever reasons, that are the problems, like when PHP got rid of global forms variables. every php upgrade i've endured has changed some semi-unspoken rule about something that has broken my code until i get around to fixing it. php5 may be the easiest upgrade, or may be the worst, but in any case, it is time that an ISP/web-hosting companies customers (including myself) have to plan for and for several sites, the demand is the opposite: we don't have time to plan for it, so please don't upgrade.

      php's reputation for screwing backwards compatibility is finally betraying them.

      --
      "But remember, most lynch mobs aren't this nice." (H.Simpson)
      -- Joe
    5. Re:actually, the "sting" of php5 is... by acroyear · · Score: 1, Troll

      Ruby has yet to show itself to me as "something better". it simply "something else". Python was "something better" and has managed to still be too damn much trouble every time I say "i'm going to do this project in python so i can learn the damn language".

      and go back and read my post: even if i wanted to switch, i might not be able to because my webhost company may not support the language (though with mine, i could probably talk them into it if i felt like it), and that doesn't solve the REAL problem of PHP (upgrades break backwards compatibility), it merely sidesteps it by changing dependencies.

      There is nothing in Ruby so far that has shown me that it won't be doing exactly the same thing of breaking backwards compatibility ever major upgrade the way php has.

      --
      "But remember, most lynch mobs aren't this nice." (H.Simpson)
      -- Joe
    6. Re:actually, the "sting" of php5 is... by acroyear · · Score: 1

      who the hell marked that as "troll" ??? -- simply saying that Ruby is not a silver bullet or that it won't have the same aging problems as every other language in software HISTORY hardly qualifies as "trolling".

      --
      "But remember, most lynch mobs aren't this nice." (H.Simpson)
      -- Joe
    7. Re:actually, the "sting" of php5 is... by Anonymous Coward · · Score: 0

      php's reputation for screwing backwards compatibility is finally betraying them.
      See, that's what it means when you change the first number.

      1.x.x is backwrds compatibile with 1.0.0, but 2.0.x is NOT backwards compatible with 1.x.x.

    8. Re:actually, the "sting" of php5 is... by acroyear · · Score: 1

      excuse me mr. AC, but even from 4.0 to 4.1 to 4.2 (and on) the changes made, mostly security related, that have broken my (completely standards compliant) code.

      --
      "But remember, most lynch mobs aren't this nice." (H.Simpson)
      -- Joe
  25. Re:PHP for the enterprise? by Anonymous Coward · · Score: 0

    Wow, you know you might be right. Maybe that's why Yahoo switched to PHP a couple years ago. hmmm

  26. Zend Framework by Anonymous Coward · · Score: 0

    There's also the Zend Framework, to be released soon:

    http://shiflett.org/archive/171

  27. Never ever use PHPNuke by NoSuchGuy · · Score: 2, Informative

    Bad security by default.
    Read here.

    --
    Grundgesetz * 23. Mai 1949 - 30. November 2007 - http://www.vorratsdatenspeicherung.de/
    1. Re:Never ever use PHPNuke by Archi87 · · Score: 1

      Sorry, I didn't knew that PHP Nuke had such serious vulnarabilities.
      I only know that some friends of mine use it for their MMORPG-Guildsite, I'll ask them if they have their PHP Nuke patched.

      But it seems like you can get Patches on this site.
      And there are other Content Managment Systems out there, too.
      Try searching Sourceforge for "CMS" and you'll find many open source systems, not only PHP based (Perl is nice, too...)
      Or use a google to search for free CMS...

  28. What About Molins... by bet0x · · Score: 1

    Molins is a framework for PHP5, inspired in Struts, but also it have a lot of features of other sub-projects of Jakarta, like Torque or Commons (FileUpload, etc). Integration with Smarty, and classes for logging, testing, etc. It's 200% object oriented. Come, take a look at http://sourceforge.net/projects/molins/ ;)

    --
    bet0x
  29. What's problem? by hotfireball · · Score: 1, Flamebait

    PHP coders really needs some framework. Because I don't realize how else they can work with the "technology"-like thingy which has bad recursion, lots of not-thread-safe stuff, poor OO, hell slow interpreter, no namespaces, non-standard date format, 4x more built-in functions than Perl (however the functionality of them just same), inconsequent function naming convention and no unicode so far. For those who dislikes Python and likes PHP, I would like to offer one experiment. Please do the simple task: make array of arrays of dict of dict of array of dicts structure (you may feel free to make it slightly other) and then try to change/replace/remove/add and compare each element of any place. Afterall compare perfomance and readability of the code.

  30. Livepipe! by Azound · · Score: 1

    Don't for PHP Livepipe!

    It's a PHP5 framework for web developers that was recently released and looks promising.

    http://livepipe.net/

  31. php5? i'll bake another cake better... by Anonymous Coward · · Score: 0

    http://www.cakephp.org/
    check its Object class implementation... for php4

  32. Framework Soup by Tablizer · · Score: 1

    I've found that the best way to build a framework is to figure out the style of the company/organization in question, and then slowly build up a framework that fits over time. And, don't make your code married to the framework, just date it. Leave ways to code around it if it does not fit a particular situation.

    For example, here is a simple set of functions to format a typical data entry form with title on the left side and input box/item on the right. If you want to code HTML directly instead of use the helper functions, you can. Thus, you get a shortcut, but not one that is forced on you.

        formHeading("My Sample Form", formName)

        rowStart("Name")
        {input type=text name="myname"} // HTML
        rowEnd()

        rowStart("Date")
        {input type=text name="mydate"} // HTML
        rowEnd("format mm/dd/yyyy")

        rowStart("Category")
        {select name="mycat"} // HTML ....

        formFooter(...)

    (Curly braces used instead of angle braces (HTML)here to avoid slashdot edit conflicts.)

    1. Re:Framework Soup by Jerf · · Score: 1

      I think you're right. I've been around the loop a few times now, and I've examined any number of frameworks. I've used a few, but more often, I've rolled my own.

      The big advantage of frameworks is they make the things the designer wanted to make easy, easy. The problem with frameworks is they make things the designer never thought of or never wanted either harder than it would be to do it directly, harder than it should be, or, in the worst cases, flat out impossible.

      I've found that for larger projects, the disadvantages frequently outweigh the advantages.

      I'll still use components here or there, but anything claiming to be an all-in-one approach is genarally more trouble than it's worth for anything over a couple of man-years*. Web frameworks are damned easy to build, as you can witness by the proliferation of them.

      If I was knocking up a personal website, I might use a framework of some kind. But for anything serious, they're just so often a source of more trouble than gain after the first six months.

      One of the reasons this work is that your local, custom framework can be "instantiated lazily"; you only add things as you need them. Framework purveyors have to work very hard to cover a lot of cases, you just need to cover the ones you use. With decent unit testing (don't leave home without it!), you can end up with a radically simpler system that works for you, rather than you working for it.

      (*: Yes, yes, "mythical man years". The phrase can still have meaning.)

  33. Taking the sting out? by Tony+Shepps · · Score: 1

    I know PHP has matured as a technology when people feel it's painful to use.

    I realize that programming languages are supposed to be painful, but for me, PHP 3 made programming fun again. As a sysadmin sort it was remarkable to be coding and enjoying it. This seemed to be true no matter whether it was a 10-line hack to get something done on a website, or a top-down structured project.

    And you know when then turnaround happened? When PHP stopped being fun? I have an opinion. I think it coincided with the discovery that global variables were found to be harmful. Suddenly this thing which had so much instinctive power, required the use a system array with a specific syntax.

    1. Re:Taking the sting out? by mcrbids · · Score: 1

      I know PHP has matured as a technology when people feel it's painful to use.

      Are you KIDDING?!?!?

      15 years ago, I took some college classes on programming. Then, the "thing to do" for intro programming was Pascal - with all the super-strict data types, memory allocation, linked lists, and compiling crap. I hated it - somebody would type a number 3, I'd add 5 to it, and get 56. It was painful to get an input form that somebody could type some stuff in.

      Yes, I know about the ASCII char table, and it seems just stupid to me that I, as the programmer, have to know this just to add 3+5=8.

      When I discovered it 5 years ago, PHP had fixed all that. Its functions are generally self-descriptive, adding a "5" to any "3" results in an "8", there's no compiling or anything like that, the syntax error messages give a clear idea where the problem might be, and the php.net website is very well maintained. And, I don't have to worry (much) about memory management, either.

      The lack of all these worries means I can just focus on the problem at hand. PHP has made me love programming!

      You want globals? Set "php_value register_globals on" in your apache config or .htaccess. It's possible to write secure code with register_globals on, it's just more difficult. Far too many programming mistakes came from this.

      Otherwise, just take pride in writing decent, secure code, and get on with it!

      --
      I have no problem with your religion until you decide it's reason to deprive others of the truth.
    2. Re:Taking the sting out? by Anonymous Coward · · Score: 0

      Sure. If by decent and secure you mean inconsistent, ugly (not as bad as perl, granted), inefficient and bloated, incredibly error-prone, unmaintainable, and non-backwards-compatible.

      PHP is okay for little scripts and personal sites. In anything beyond that, it becomes your worst nightmare. Why does $a = $b; work even if $b doesn't exist yet, and at best displays a warning if you've enabled the corresponding non-default option? With such a huge standard library, where's some decent database abstraction? Why the hell does the . operator go against so far against common usage and sanity to be concatenation? (answer: bad design choices in the beginning, which has also spawned such ugly workarounds as the === operator)

      In short, why is it so popular? I can only speculate that it caught on as an alternative to Microsoft's similarily crappy but nicely-marketed ASP of the time, and that embedding is as easy as pie for newcomers from PERL. As you said, it might have superficially seemed nicer than Pascal, but times have changed. It needs to die already.

    3. Re:Taking the sting out? by kuzb · · Score: 1

      Global variables are not harmful at all. The misuse of global variables is. This is a very common misconception shared by most new PHP programmers who read the wrong material on the web, or listen to other inexperienced PHP programmers for security advice.

      Now, I'm going to take a leap here, and assume you're actually talking about the register_globals directive, and not global variables in general. From the site: [..]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[..] - the whole reason for register_globals was because the creators of PHP knew lots of bad programmers were going to use PHP to do silly things. In hindsight, it was probably not the best move. A language should not go to great lengths to shelter it's users.

      Any bad programmer can write bad code in any language. The thing to remember is that it's a bad carpenter who blames his hammer for not automaticly avoiding his thumb during use.

      --
      BeauHD. Worst editor since kdawson.
    4. Re:Taking the sting out? by Anonymous Coward · · Score: 0

      Spoken like a true Java marketing drone. I'm surprised you didn't throw in a Sun ad or two while you were on your soap box.

    5. Re:Taking the sting out? by mcrbids · · Score: 1

      Why does $a = $b; work even if $b doesn't exist yet

      <?
      $a=$b;
      if (isset($a))
                      echo 'good';
      ?>

      PHP Notice: Undefined variable: b in /home/httpd/html/test.php on line 3

      and at best displays a warning if you've enabled the corresponding non-default option?

      This is default behavior that I see on my CentOS 4.2 linux server.

      With such a huge standard library, where's some decent database abstraction?

      Ever heard of PEAR?

      Why the hell does the . operator go against so far against common usage and sanity to be concatenation?

      As opposed to... eh, bash? (where the dot means "include file...") or perhaps perl regex, (where dot means "any character") or perhaps javascript (where dot means method of object nnn).

      Just what IS the "common usage" for these dot things, anyway? Perhaps you meant "my preferred usage"?

      (answer: bad design choices in the beginning, which has also spawned such ugly workarounds as the === operator)

      Actually, I *LIKE* the "==" vs "===" thing. There are times when I don't mind a string "0" being considered equivalent to the integer 0. Other times, I do care. Most times I don't, so "==" works well. How is this a "bad design choice"?

      As you said, it might have superficially seemed nicer than Pascal, but times have changed. It needs to die already.

      And it's a good thing that PHP as a language doesn't depend on YOU. But, I'm curious, what do you think should replace it?

      --
      I have no problem with your religion until you decide it's reason to deprive others of the truth.
  34. Simple example by sabit666 · · Score: 1

    Why do they always have to go with `simple' example?? Why not go into some depth and show a moderately big project with some complex feature implementation?

    1. Re:Simple example by Anonymous Coward · · Score: 0

      Thank you! I've checked out a few of the frameworks listed in the comments by various posters and it seems like all of them have included a 'demo' app which revolves around a simple "Hello World" or a "Build a Blog in $x minutes!" I think this is ridiculous as it does nothing to differentiate this framework from framework 'foo' and doesn't inspire a lot of confidence. Admittedly, there might be a degree of ignorance on my part when it comes to building MVC apps (most of the frameworks I've seen use the pattern, with the exception of PRADO), however if a framework were to go that extra step and provide a more complex demo app, showing off its capabilities and the advantages of MVC patterns I would be all over it.

    2. Re:Simple example by mwvdlee · · Score: 1

      What would be even better is, if the framework would be the refined by-product of a large scale project.
      Most frameworks are built from some sort of ideology without any real need; they are solutions in search of a problem.

      --
      Slashdot social media options: AIM, ICQ, Yahoo, Jabber and Mobile Text. Why no MySpace?
  35. Frameworks, stygma, and rolling by eruanno · · Score: 2, Insightful

    Frameworks are fantastic beasts. I fear them yet I adore them at the same time. I do this with anything that I didn't write. Indeed, I moreso do this with anything that I do write!

    To the point: I see a lot of people bashing the concept of frameworks and stating that you shouldn't use frameworks because it's just being lazy or that frameworks are a bad thing. I believe this negativity comes from inexperience and ignorance.

    I agree, these are biting words, but consider the fact that the arguments used to support these ideas are based on incorrect assumptions and false information: thusly revealing that they know nothing about the framework(s) nor have they used them. (Either that, or they've used them incorrectly, producing a negative response! Try brushing your teeth with a hacksaw!)

    Goals of various frameworks are many, with each framework focusing on something completely different. I'll consider the framework that I am currently in the process of developing as an example: this framework's goal is to provide a semi-rigid structure for web application development, with particular emphasis on separating executive logic, data logic, and interface logic. (For anyone that doesn't know right off, this is the MVC pattern.) I chose this pattern simply because it suited how I like to develop my programs and gives me the amount of flexibility I need to provide for easy ways to quickly develop and make changes, to work with teams, and to better see how my code is interacting with the flow of the program. What happens with something doesn't work? Well, I pinpoint what type of error is ocurring, then I can cut out two-thirds of the code (granted, very little code is required for the model to actually work).

    I read a number of comments ago that PHP was designed without a rigid structure to provide for rapid development and flexibility. The commentor is absolutely correct, but it wasn't designed to disallow structure completely. In fact, with the blank canvas that PHP does provide, it certainly welcomes all attempts at structuring code. This is evident in its (newly-revamped) support for object oriented design as well as even basic support of functions.

    Another argument that I heard levied against frameworks is that they sometimes don't support certain functionality. There are two responses for this: firstly, not every solution is perfect; secondly, some frameworks are poorly designed. Of course, the second point is just that and requires no further exploration. However, the first point must be clarified. Certainly, we all agree that there are no perfect solutions, but doesn't this seem a bit like a copout? I don't believe so: I believe that limitations from using a well-designed framework stem from a lack of understanding its design or from not having enough creative foresight to know how to use it effectively. At this point, I seriously have to ask you if this framework suites what you're trying to do.

    Honestly, not every website will benefit form a framework. You have to realize this. Don't use the framework for more or less than it's intended for.

    One last address: for those that think that using a framework inherently means added complexity, sometimes you're right. However, you must realize that some more complexly designed websites with intricate functionality (to a safe degree) could benefit from using frameworks just as you can benefit from using standard functions for writing quick scripts.

    M.T.

    --
    "Support Bacteria - Its the only culture some people have" - Circa 1985
  36. Re:I need something that needs PHP by Anonymous Coward · · Score: 0

    I know a bit of PHP but I can't think of enough content that would justify anything more than a straight html site.

    (and I don't like other people's ideas either!)

  37. What the hell is wrong with you? by rylin · · Score: 1

    Let me get this right..
    You have a low-enough UID to supposedly be somewhat knowledgeable, yet you advocate writing frameworks and not marrying the code to the framework..?
    Then why the hell are you mixing the View in with the Model (and most likely Controller too?)

    Honestly, it's people like you who give PHP a really bad name.
    Any sane person would AT LEAST be using a templating system like Smarty.

    1. Re:What the hell is wrong with you? by Tablizer · · Score: 1

      For the record, I don't believe in MVC. Plus, what is a "controller" is often not well defined. The "seperation of concerns" stuff is also dreamy mantra. In practice the borders are fuzzy. Some people make interfaces for every little sneaze and call this "separation", but it results in simply more layers that have to be changed when the interface has to change due to requirements changes.

      Beurocratic interfaces are not change-friendly. There are no "immutables". Everything is game. Generally one should make interfaces to reduce duplication, not simply to wrap things for the hell of it.

    2. Re:What the hell is wrong with you? by SComps · · Score: 1

      When has a UID been considered an indication of knowledge? Last I was aware, a low UID simply meant they'd held an account on this website longer than most. I know some pretty dumb people that have been around for a long time; course I also know some pretty dumb people that seem to appear every time there's a dissenting opinion.

  38. your mama doesn't see the magic words by danielDamage · · Score: 1

    And I don't see the magic numbers for Cake or Sympfony...which is 1.0, at least.

    Besides, from the front page of the WASP sourceforge site:

    Web Application Structure for PHP - A powerful multi-tier MVC web application framework built on Object Oriented PHP5. Uses PEAR DB_DataObjects and Html_Template_Flexy.
    --
    Slices, dices, eats your lunch.
    1. Re:your mama doesn't see the magic words by WWWWolf · · Score: 1
      And I don't see the magic numbers for Cake or Sympfony...which is 1.0, at least.

      I thought "BETA" was supposed to be what Web 2.0 was all about?

      Come on, for example Rails got popular when it was hyped like "It's a dream to develop for! And version 0.12 is out!"

      =)

  39. Slashdot for Self-Promotion?! by GoCats1999 · · Score: 2, Insightful

    I'm disappointed that Slashdot editors are allowing more and more people to use /. simply as a means for self-promotion. Case in point: here we have a posting by Brian Fioca, referencing an article by Brian Fioca, which talks about a framework by Brian Fioca.

    And I wonder why I'm always so surprised that people complain about bias in the media...

    1. Re:Slashdot for Self-Promotion?! by bfioca · · Score: 1

      I would say that I'm certainly not using slash for self promotion. I'm not promoting myself for any consulting services or anything of that nature. I simply made available code that people might possibly be useful to people and wanted to let people know about it. Is't that the spirit of open source?

  40. Where has gone the REALLY good ideas, namely, KISS by Skal+Tura · · Score: 0, Troll

    all i can say: WTF is this?
    Has all wise people suddenly disappeared?
    Where has the philosophy of KISS disappeared? namely: Keep It Simple, Stupid!

    WASP seems far from simple, let's take this example:
    Request::getParameter('Add') != null
    wtf? Why can't one do $_POST['Add'] != null?
    What format even is Something::Something ??

    TaskWrapper?

    What's so bad with plain Modular Design + Smarty?

    I can do easily with it after building the init scripts (transfearable from project to project) something like this with 8 lines or so.
    namely
    if ($_POST['Add'] != null && $_POST['Job]' != null) {
          $Job = Validate($_POST['Job'], 'string'); //my own function
          DoQuery("INSERT INTO 'todo' VALUES('', 'Job', '" . timestamp() . "')"); // again here is my own functions
    }
    ??
    Note that is untested code etc. and probably wrong :)
    I could bet that WASP doesn't have such an good documentation too, making it harder to development.
    Why do we need PEAR objects for everynew project? etc.

    You can do hell of a fast code with standard PHP too, tested dozens of times that ain't even hard if you just remember KISS.

    Now, i've done a browser game (http://www.paradox-online.net/ ) with PHP, also i'm working on a framework (http://framework.artichost.net/ ) and game will be using it in future as the basis. So i know what i'm talking about.

    Now, could someone make me see the PRO side of using WASP for example?
    In my eyes, all WASP does is adds complexity, which NEVER is good. You need to KISS it, make it easy to maintain, easy to debug, easy to read etc.

    You have to work on some massive things before you realize that, complexity ain't the way to go. (My browser game, over 14k lines of PHP code initially... cutting it down a lot at this dev period on it, while increasing features... all thanks to KISS philosophy... Oh yeah, you can cut most loops of queries straight at the MySQL query, making your code even shorter and more fault tolerant... ;) so remember KISS)

  41. Re:Where has gone the REALLY good ideas, namely, K by Anonymous Coward · · Score: 0

    Has it ever occured to you that Request::getParameter() could do logging, check if the variable isset() and so on and so forth? Or are you just a fucking idiot that just discovered functions and does not think ahead?

  42. PRADO bad. CakePHP + PHPTAL is my PHP ticket. by Qbertino · · Score: 1

    Of course PHP is somewhat quirky. We all know that. I'd also rather do all my stuff with Python, Zope and Django. But it happens to be that everything is run in PHP nowadays and lots of clients want PHP modifications or an extension to one of the 10 million PHP/MySQL CMSes out there.

    Luckily there are neat tools that make professional PHP project work very easy and fun:

    PHPTAL (http://phptal.motion-twin.com/) is a PHP based redoo of Zopes TAL (Template Attribute Language) - the best Templating concept ever. Makes Prado look even more sucky than it is allready.

    CakePHP (www.cakephp.org/) - the PHP addition to the MVC Framework hype that Ruby on Rails kicked off. Just the right thing for larger Projects that cry for clean frameworks. Very neat.

    --
    We suffer more in our imagination than in reality. - Seneca
  43. i'd like to know by jaimz22 · · Score: 1

    i'd like to knwo what people see is "so wrong" with php5? i mean, damn php6 is in alpha stages, why the hell can't people update to php5 :p

    almost EVERY host supports php4. only ha handle full have php5.

    "we support the latest technologies... this include php4, even though php 5 had been production stable for 2 years"

    i know that has nothing to do with the article, but i had to rant :p

  44. Re:Where has gone the REALLY good ideas, namely, K by MickoZ · · Score: 1

    Skal Tura said:
    "WASP seems far from simple, let's take this example:
    Request::getParameter('Add') != null
    wtf? Why can't one do $_POST['Add'] != null?
    What format even is Something::Something ??"

    ------------

    Well Something::Something is simply the syntax to access a static function of a class. It is simple.

    See http://www.php.net/manual/en/keyword.paamayim-neku dotayim.php

    Either I misunderstood, but it is not like it is one of the most obscure thing in PHP to know that one.

  45. Also could like like... by freezin+fat+guy · · Score: 1

    Yeah, good point. Could even like like...

    <? foreach ($arTasks as $key=>$task) echo "<li>{$task['Name']}-<i>{$task['Due']}</i></li>"; ?>

    ...although I prefer not to use short tags in the interest of XML compliance. (The parser will try to parse XML declaration tags.)

  46. Re:Where has gone the REALLY good ideas, namely, K by Skal+Tura · · Score: 1

    Uh, yes it seems normal to me after i checked that doc.
    I've never needed something like that.

    so i've used Object->Function :)

    and yes, i would define that "obscure thing in PHP" as that was the first occurence ever i've seen :: used in PHP. and believe me when i say i've read A LOT of PHP code from many different coders & open source projects.

  47. Re:Where has gone the REALLY good ideas, namely, K by MickoZ · · Score: 1

    Yeah, I can see someone developing without ever need one. But sometime you just want to stick static variable or function to an object and that come handy.

    But if you do something like this:

    $o = new Object();
    $c = $o->add($a,$b);

    Well you instantiate the object to use a static function (considering that it is not working on the object, but just using parameter and returning a result).

    Therefore doing

    $c = Object::add($a, $b);

    seem more logical in that scenario (or maybe use a stand-alone function).

    There is probably well logical reason sometime to bind one static function to an object (beside just regrouping function at one place).

  48. Re:Where has gone the REALLY good ideas, namely, K by Skal+Tura · · Score: 1

    I still don't see much of a benefit on doing that, you mean that i don't need to instantiate the class to be an object? (ie. no $something = new Class;)

    I used a fairly complex OO orientated data structure on my browser game (something like 3-4 A4 pages long just the objects alone), and never needed anything more than more dimensions into the goddamn OO support in PHP >_ i worked around it by doing 2 different Object trees and using a pointer variable to the second one :)

  49. Re:Where has gone the REALLY good ideas, namely, K by MickoZ · · Score: 1

    Skal Tura said:
    "I still don't see much of a benefit on doing that, you mean that i don't need to instantiate the class to be an object? (ie. no $something = new Class;)"

    No, I may have expressed myself wrongly or it is just still unclear to you.

    Actually if you call Object::someMethod(); you are just calling the method that is defined as static for the class (even if in PHP4 for example, there is no static).

    In that static method, you won't be able to use thing like $this, because you are not working on an instance of the object ($this being a pointer to the instance of the object), you are just calling it.

    So if you have a function that doesn't do anything on the object itself, but you want it associated with your class definition, you may use it that way.

    Example that I saw is like when you want to retrieve a list of Something.

    You will do:

    Something::findAll(); // return an array with the list of all Something
    Something::findById($id); // return an instance of Something or null if not found
    etc.

    You could as well code a function:

    find_all_something(); or something_find_all(); amd it will be the same.

    Some more code (unfortunaly it doesn't look as right on slashdot preview, but you may copy it in some editor to read it better)

    class Something
    {
        var $id;
        var $name;
        var $description;
    . /* setter and getter, those work on the instance directly. */
        function setId($id) { ... }
        function getId() { ... }
        function setName($id) { ... }
        function getName() { ... }
        function setDescription($id) { ... }
        function getDescription() { ... }
    . /* to save or delete (i.e. destroy) your object */
        function save() { ... }
        function delete() { ... }
    . /* to retrive something (i.e. from database), I already talked about this */
        function findAll() { ... }
        function findById($id) { ... }
        function findByIds($ids) { ... }
    . /* if you want to sort a list of something, you can use that function
        * to help sort the result.
        * example: usort($list_of_something, array("Something", "compareByName"));
        * see: http://ca.php.net/manual/en/function.usort.php
        */
        function compareByName($a, $b) { ... }
    }

    So you may work it out like this: /* $list_of_something = array(); */
    $list_of_something = Something::findByIds(array(3,10,14)); // retrieve Something with id 3, 10 and 14
    $list_of_something[] = Something::findById(126); // add Something with id 126

    usort($list_of_something, array("Something", "compareByName")); // will sort the list by the name of Something.

    Well here you don't use Something::compareByName() ... but it is used staticly.

    When I write this, I feel it is clean (of course it is a pretty simple case too). But I think those can be useful and clean way to use static method for a class.

    Hope that help ;-)