When try - catch is inevitable ?
Moderator: General Moderators
-
jankidudel
- Forum Commoner
- Posts: 91
- Joined: Sat Oct 16, 2010 4:30 pm
- Location: Lithuania, Vilnius
When try - catch is inevitable ?
Please show me an example when try - catch can't be substituted for if(!$something)....
Re: When try - catch is inevitable ?
I don't think there are such examples because languages with exception support still Turing-equivalent to languages without exceptions. But exceptions may allow for cleaner, clearer code.
Re: When try - catch is inevitable ?
Show me an example of a PHP script that can't be written in assembly language
Re: When try - catch is inevitable ?
That's a bit of a tautology, isn't it? Given PHP is an abstraction of C, which is an abstraction of Assembly?josh wrote:Show me an example of a PHP script that can't be written in assembly language
Re: When try - catch is inevitable ?
I guess that's the point. tautology = different ways of saying the same thing. Conditionals & exceptions are different ways of saying the same thing. (thanks for the new word!)
Re: When try - catch is inevitable ?
You can thank xkcd (http://xkcd.com/703/) for bringing that word to my attention 