Advice for a guy who is finally FED UP w/ the Zend Framework

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

how come? that's exactly what it is. if they try to access /book/234/ and there is no book #234, that == not found, right? I mean of course you should give them helpful information on the 404 page, but what else is that situation if not 404?
jmut
Forum Regular
Posts: 945
Joined: Tue Jul 05, 2005 3:54 am
Location: Sofia, Bulgaria
Contact:

Post by jmut »

The Ninja Space Goat wrote:how come? that's exactly what it is. if they try to access /book/234/ and there is no book #234, that == not found, right? I mean of course you should give them helpful information on the 404 page, but what else is that situation if not 404?
in 99% of cases if they try this..it will be by hand..and not using the interface provided...hence..you can safely ignore this....request and just return to normal list of books or whatever. You don't have to do error.....and I certainly think this is not exceptional situation...not to have certain record.
Exceptional is db down...blabla....
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

request and just return to normal list of books or whatever
I disagree... that is not expected behavior. What if the record used to exist, but for some reason no longer does? They try to access it, and it goes to the list of books? That would confuse and irritate me. If I got a 404 I would at least know (and so would google) that it no longer exists.
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

I saw you starting to ask questions about Zend a while back and was wondering how that would turn out for you. I figured it probably wouldn't be a happy ending.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

The Ninja Space Goat wrote:
request and just return to normal list of books or whatever
I disagree... that is not expected behavior. What if the record used to exist, but for some reason no longer does? They try to access it, and it goes to the list of books? That would confuse and irritate me. If I got a 404 I would at least know (and so would google) that it no longer exists.
That is not the expected behavior for web standards mavens, but it is the expected behavior for someone looking for a book! Not only would I show a list of books, but if I knew that the 200 series were mysteries I might show a list of available mysteries. This is one of the things that Front Controller (for totally incorrect URLs) and Action Controllers (for bad selectors) excel at dealing with in a consistent, organized manner.

This is especially true for retail sites, but true for all sites, you need to make every click count -- even if it is the wrong click.
(#10850)
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

I agree... but I'd still send a 404 and tell the user the page they requested doesn't exist ;)
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post by Kieran Huggins »

Old pages linked to via Google or someone "sharing" the page in some fashion maybe...

As a user I would expect there to be a 404 page, but with contextual information. Maybe a 404 specific to books? The controller at least gives you a hint as to what they intended to see.

At any rate, there should be a 404 header for spiders and the like.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

Kieran Huggins wrote:At any rate, there should be a 404 header for spiders and the like.
So someone linked to one of your clients' sites and mistyped the URL and you're going to tell Google "No thanks, there must me some mistake." ?
(#10850)
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post by Kieran Huggins »

I think that's the most correct thing to do: indicate that the requested resource doesn't exist.

Am I mistaken?
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

I think it is the technically correct thing to do. But given the reality of links and typed-in URLs, I think it is rarely the appropriate thing to do. Users and site owners want useful sites with high rankings much, much more than they want technically correct sites.
(#10850)
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post by Kieran Huggins »

I don't see how a helpful 404 page would harm users following incorrect or outdated links. Also, it would only help preserve SEO by encouraging a more accurate and up-to-date index.
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

You should display an error page when a resource can't be found, if you redirect somewhere the user won't expect that. Imagine the user story:
  • User clicks to view more details about a book
  • User is redirected back to the book index whence came (as if he hasn't moved at all), only the book in question has been removed
Some users might be concerned they just deleted the book from existance, none of them would truely understand what had just happened or how likely it was to happen again. You should always display a page that can restore some confidence to the user about what just happened and, if possible, provide the user with the tools to continue navigating the site in the way he originally intended to.

Redirects complete with 301s are acceptable when the resource does exist but has been moved, when you change your URL structure or the user makes a typo, for example. The two, 404s and 301s, can be treated as separate problems. If you don't send a 404 status header search engines will index a useless page.

Back to the main issue: Yes, NSG I'm completely with you, ZF is crap. I believe I vocalized that opinion a while ago.

I've heard lots of good things about Symfony and I know some pretty big companies (ebay) are using it. Symfony documentation seems very detailed. ROR is another serious contender, I was working towards dropping PHP in favor or Ruby and Rails but since I've been reading about Symfony I'm not so sure. Definitely want to try both now.
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post by Kieran Huggins »

ole++

well said.
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

umm I decided to go with cakephp simply because of its code generation stuff (I really needed the site framework up quickly to allow the client to start entering data). I am very happy with it. It took a little getting used to, but I've found it to be top-notch. It was a toss-up between symfony and cake. In the end I chose cake because 1) I've used it before and 2) it was the most rails-like which suits the project I am working on very much (scaffolding).
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

Cool. It's interesting to here you say that, about rails and all.
Post Reply