When try - catch is inevitable ?

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
jankidudel
Forum Commoner
Posts: 91
Joined: Sat Oct 16, 2010 4:30 pm
Location: Lithuania, Vilnius

When try - catch is inevitable ?

Post by jankidudel »

Please show me an example when try - catch can't be substituted for if(!$something)....
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Re: When try - catch is inevitable ?

Post by Weirdan »

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.
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Re: When try - catch is inevitable ?

Post by josh »

Show me an example of a PHP script that can't be written in assembly language
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Re: When try - catch is inevitable ?

Post by Jenk »

josh wrote:Show me an example of a PHP script that can't be written in assembly language
That's a bit of a tautology, isn't it? Given PHP is an abstraction of C, which is an abstraction of Assembly?
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Re: When try - catch is inevitable ?

Post by josh »

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!)
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Re: When try - catch is inevitable ?

Post by Jenk »

You can thank xkcd (http://xkcd.com/703/) for bringing that word to my attention :P
Post Reply