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."
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.
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
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.
http://twitter.com/onion2k
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.
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
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."
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.
Developers: We can use your help.
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.
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.
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.
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
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.
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
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...