You are here: Re: instantiating an object fails (design patterns) « PHP Programming Language « IT news, forums, messages
Re: instantiating an object fails (design patterns)

Posted by Chung Leong on 09/16/05 17:41

www.douglassdavis.com wrote:
> Let's say an invalid string is passed to construct it. What is the
> appropriate way to handle this? I know in Java I would probably throw
> an exception, but I don't know how much people really use exceptions in
> PHP right now. So, I don't want to depend on it.

That sounds like a programmer's error to me. The appropriate way to
handle this to be to let the programmer know that he/she made a
mistake. I would use trigger_error() or simply die().

Call me old school. In my opinion things that are within a programmer's
control are not exceptions.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация